Xiaomi Redmi 4 Prime (xiaomi-markw)

== Device Notes ==
=== Touch Screens ===
Touch Screen 	Status
atmel,maxtouch 	Partial
edt,edt-5336 (edt,edt-ft5x06)	Works
Both variants of touch screen use the same pins, so we can't just enable both drivers at a same time.
Starting from 6.7.9, we let lk2nd to enable a device tree node of a touch screen. The touch screen won't work until you update lk2nd.
For now, lk2nd can only enable focaltech, so you need to build lk2nd by youself if you have atmel (just comment ft and uncomment atmel in dts/msm8953-xiaomi-markw.dts in the sources)
=== Modem ===
Voice calls are working, SMS - untested yet, but should work. Mobile data doesn't work for me (vipaol), but maybe you're lucky.
=== Cameras ===
Both sensors are working in megapixels, but camera switching doesn't work for an unknown reason (probably it used to be a bug of megapixels, but now we also have some problems with VFEs in the kernel). The config for megapixels is below: ... Now megapixels have config for markw out of the box.
Sometimes numbers of i2c buses with the cameras can be different (aliases in i2c should help, but the maintainer is lazy) and they should be changed in the config ("media-links" lines).
markw:~$ media-ctl -p | grep -E "s5|ov"
 <- "s5k3l8 3-002d":0 [ENABLED,IMMUTABLE]
 <- "ov5670 4-0036":0 [ENABLED,IMMUTABLE]
- entity 184: ov5670 4-0036 (1 pad, 1 link)
- entity 186: s5k3l8 3-002d (1 pad, 1 link)
# we can see rear camera on i2c-3, and front on 4
None of vfeX_rdiX other than vfe0_rdi0 will work on recent kernel versions, so we can't use both cameras at a same time because we have only one working "output channel". Also csid2 doesn't work, but csid0 and csid1 work.
=== Sensors ===
Connected to i2c-gpio
Sensor 	Model 	Status
Accelerometer/Gyroscope	bosch,bmi120 (bosch,bmi160) 	Works
Light/Proximity 	liteon,ltr559 (liteon,ltr501)	Works
Magnetometer 	yamaha,yas537 (yamaha,yas530)	Works
=== UART ===
The working voltage is 1.8 V.
Warning: the test points are very small, soldering is not recommended. It's probably better to just hold a wire with a hard thin end with your hands.
See also: Serial debugging
== How to enter flash mode ==
[Power] + [Vol-] to fastboot mode
== Installation ==
===Pre-built images===
Download the image and lk2nd for Generic MSM8953. Once downloaded, extract the files with unxz or any compatible archiver.
====Step 1. Flash rootfs:====
; - To SD-card:
:: The downloaded rootfs img is a sparse img. You need to convert it to a normal img before flashing it to an SD-card: 
$ simg2img <...>-qcom-msm8953.img nonsparse-converted.img
:: Then just write it using a tool for writing images.
; - To internal memory
:: 
$ fastboot flash userdata <...>-qcom-msm8953.img
====Step 2. Flash lk2nd:====
:: 
$ fastboot flash boot <...>-lk2nd.img
lk2nd is a second stage bootloader that is used for booting the generic image and for some device-specific hacks. It boots the kernel with initramfs from the "pmOS_boot" subpartition using extlinux.
If you see < waiting for any device >, try running as sudo and restart your device into fastboot mode again.
===Manual build===
====Step 1. Flash rootfs:====
; - To SD-card:
:: Find your SD-card: lsblk
:: Install (change /dev/sdX to your card) $ pmbootstrap install --sdcard /dev/sdX
; - To internal memory
:: $ pmbootstrap install
$ pmbootstrap flasher flash_rootfs
====Step 2. Flash lk2nd:====
$ pmbootstrap flasher flash_lk2nd
lk2nd is a second stage bootloader that is used for booting the generic image and for some device-specific hacks. It boots the kernel with initramfs from the "pmOS_boot" subpartition using extlinux, so you don't need to use flash_kernel
== Users owning this device ==
== Maintainer(s) ==
* User:Vipaol
== Contributors ==
* User:JIaxyga
* User:Vipaol
== See also ==
* 
* 
* 
* mainline kernel sources
* lk2nd sources
* Device Info HW database entry
* GSMArena page
* Android kernel sources
Category:Devices with known UART pinout