Xiaomi Mi A2 Lite (xiaomi-daisy)

This device is also known as Xiaomi Redmi 6 Pro (sakura). The only difference is that sakura has MIUI preinstalled instead of stock Android One.
== Contributors ==
* Ash
* Alikates
== Users owning this device ==
== Installation ==
=== Fastboot Mode ===
First make sure to enable USB debugging in Android ().
Then with device powered off, hold the and buttons simultaneously for a few seconds, until Fastboot Mode screen appears.
=== OEM Unlock ===
Get device into Fastboot Mode, plug in USB cable, then:
$ sudo fastboot oem unlock
When prompted on device, use Volume-Up/Down buttons to highlight choice, then Power button to select it. The Fastboot Mode screen will appear again, and a message saying that the device isn't secure will appear briefly.
=== Installation ===
==== Build the image ====
$ pmbootstrap init # choose Vendor: qcom Device codename: msm8953
$ pmbootstrap install
==== Install the image ====
$ pmbootstrap flasher flash_lk2nd
$ pmbootstrap flasher flash_rootfs
==== Install to xiaomi-sakura ====
xiaomi-sakura has rollback protection, some manually steps are needed.
$ fastboot boot lk2nd.img
$ fastboot flash lk2nd lk2nd.img
$ pmbootstrap flasher flash_rootfs
== Mainline Kernel ==
=== Feature table ===
Parts 	Status 	Notes
Modem 	Partial	It works with ipa-lite since 6.7.0.
WiFi 	Works 	
Sensors 	Partial	Working with i2c-gpio from here. WIP SSC driver here.
GPU 	Works 	
Audio 	Works 	Everything works. Speaker works since version 6.4.7. Needs alsa UCM config from this package.
Touchscreen	Works 	Both touchscreen variant are supported.
Charger 	Works 	Driver added in 6.1
Panel 	Partial	Only supported hx8933, ili8707 and otm1911 models (not sure if there are any other panels)
GPS 	Partial	Driver added in 6.8.2
Camera 	Partial	ov5675 front camera was enabled in 6.7.2 and in megapixels 1.8.2.
There are variants with different i2c address 0x10.
=== Modem ===
Firmware loads and modem boots. It detects SIM card and can be unlocked and configured with qmicli.
Because audio needs more work i couldn't test audio quality on calls but with q6voiced it should work.
==== Mobile data ====
Mobile data works since 6.7.0.
To configure the mobile network settings, use NetworkManger (mobile network menu on phosh settings) so it sets up the network interface and IP routing.
After that, two new network interfaces should appear. The rmnet one is the connection to the modem, and the other one is virtual and the one that is used to transmit mobile data.
=== GPS ===
Qualcomm_Snapdragon_450/625/626/632_(MSM8953)#GPS
=== Touchscreen ===
Both goodix and edt touchscreens are supported. 
However, touchscreen selection is binded to the display panel, and sometimes the same panel comes with a different touchscreen. As a result, you might need to manually override it in lk2nd.
To do so, you will need to edit and compile lk2nd yourself. First, clone msm8916-mainline/lk2nd.
==== Edit touchscreen-compatible ====
Next, edit the following parts of the DTS file corresponding to your device.
sakura	lk2nd/device/dts/msm8953/msm8953-xiaomi-common.dts#L48-L59
daisy 	lk2nd/device/dts/msm8953/msm8953-xiaomi-daisy.dts#L23-L34
Play with the displays' touchscreen-compatible value. This value should be either of:
* "goodix,gt917d"
* "edt,edt-ft5406"
For example, if your touchscreen does not work, change every goodix to edt and vice-versa.
==== Build lk2nd ====
After that, you need to build the lk2nd image. Run the following command from the repository's root directory:
$ make TOOLCHAIN_PREFIX=arm-none-eabi- lk2nd-msm8953
See msm8916-mainline/lk2nd/README.md#building for more details on the building process.
The resulting image will be in the build-lk2nd-msm8953 folder as lk2nd.img.
==== Flash lk2nd ====
To flash lk2nd.img, run the following commands:
$ fastboot boot lk2nd.img
$ fastboot flash lk2nd lk2nd.img
Finally, you can run:
$ pmbootstrap flasher flash_rootfs
And reboot your device.
==== Goodix touch display calibration ====
Install if your replacement display with goodix touch controller is not calibrated well.
== Images ==
== See also ==
* Qualcomm Snapdragon 450/625/626/632 (MSM8953)
* Initial merge request
* Mainline merge request
* 
* 
* 
* Mainline kernel
* lk2nd
* Charger driver fork