[Xiaomi Mi 11i / 11X Pro / Redmi K40 Pro+] mslezak:
I'm trying to get the standard kernel configuration (defconfig) for this device as the Xiaomi repo is a mess. If you have a rooted phone, you can copy the /proc/config.gz to your /sdcard/ then to a Windows PC and extract it with 7-zip file manager: https://www.7-zip.org/ and post it here. To root, go here: https://en.miui.com/unlock/download_en.html

I managed to find all (?) the required files to build the kernel under different repos on the Xiaomi site (I had to look under different devices, the Redmi K40 Pro+ device tree is missing Camera and Display which is under the star-r-oss device tree, updated a few days ago). My GitHub is definitely not as clean as it should be after merging everything, but the point here is to have 1 repo where all development can begin easily. I will try to rebase it when I have time to make the commits clearer.

https://github.com/mrslezak/hadyn-r-oss/commits/haydn-r-oss

Consolidated Xiaomi sourcecode with some minor fixes added - device tree imported, QCACLD 3.0 added (not sure it's used by this kernel, but it was in their repo, so I put it under drivers/staging), camera and display for vendor pulled from a different device tree on their repo (it's the correct one, however - https://github.com/MiCode/kernel_devicetree/tree/star-r-oss/qcom/camera and /display). The defconfig is definitely wrong right currently. Hence my request here.

If you want to fork it, here is what you want to get started building kernels / troubleshooting build errors (this moves WAY up the Linux chain to 5.4.61, so get ready for some strange things...)

My compiler toolchains can be git cloned from here: https://github.com/mrslezak/toolchains

I am currently using the BuildClang12.sh build script in the directory which only uses Proton-Clang 12, so you don't need all the toolchains. The latest is Clang-13 but I have not attempted using it: https://github.com/kdrag0n/proton-clang . I have built many stable kernels using the build of Clang-12 in my toolchains repo, so I trust it and use it to build kernels for the Op8T with no issues whatsoever with many people using the kernels I built. It's of course your choice which compiler to use. You also need to clone the Anykernel3 repo: https://github.com/osm0sis/AnyKernel3 if you want to use my build script.

BTW if you want to get this phone, and can understand some Chinese (suggestion: cheat and use Google Lens + Translate), the 12/256GB + 108mp camera is available from the largest retailer in China (jd.com). You need an international debit card (CapitalOne charges nothing to convert Yuan to USD), however, and if your country charges import fees YOU WILL HAVE TO PAY THEM. Edge and Google can translate the website for you but you probably will need to order using their app on your phone (in Chinese only). It's incredibly hard to setup but you will pay retail price. And this rebadged device will only be available at 8gb/256gb max as a Xiaomi Mi i Global (700 Euros or $825 USD), where the Chinese variant Redmi K40 Pro + comes with 12GB/256GB (< $600 shipped express), and has the correct bands to work on LTE and eventually N41 5G on T-mobile's network in the USA when they build it out. It won't support NSA 5G (which is terrible anyhow where I live, it uses the congested LTE band 66 to connect to 5G band N71). Something to maybe consider if you have good NSA 5G where you live (USA only), this kernel will work on both phones once it's fixed up. Then I intend to "tame the beast" Snapdragon 888 which is already overclocked to death, running 840mhz GPU and the X1 prime core which is not designed to be efficient - power only. The A78 Cortex cores are much more battery friendly.

BTW you didn't hear it from me, but the 888+ is already in the source code for the 888 devices clocked at 900mhz GPU and who knows what CPU frequency. It already throttles like mad on most devices (except this one (best phone w/out a fan), the ROG5, and RedMagic 6, which both use external cooling fans to avoid throttling, and will set you back some $800-$1000+). I'm not a gamer, so this is the best choice for an 888 if you want a nice phone that doesn't throttle as much as any other on the market (based on stress test videos of all the phones on YouTube), and don't want an expensive phone either. Uses the same Super AMOLED panel as the S21 Ultra by Samsung, just at FDH+ instead of the higher resolution. And the cameras are the best in the category, other than the Mi11 Ultra, Samsung S21 Ultra, etc.