[ROM][13][clover] LineageOS 20 for Xiaomi Mi Pad 4 [UNOFFICIAL]

Search This thread

kyasu

Senior Member
Sep 23, 2012
649
2,953
Tokyo
The new build still stop charging sometimes.
I think it's better to use the code from xiaomi's source code:

sec_access = (addr & 0x00FF) > 0xD0;
I created the boot.img with your suggested code. Please flash boot.img with fastboot and test this boot.img.
 

Attachments

  • boot-clover.img
    14.8 MB · Views: 48

dije_v

New member
Feb 5, 2023
1
0
very thanks to sir kyasu, this rom is very good.

i want root this device, can you all tell me what better i'll use for rooting this tablet? magisk or supersu or other?
 

twu2

Senior Member
Oct 25, 2009
177
278
Taipei
blog.teatime.com.tw
Could you provide a diff-file of the kernel source?
Diff:
--- a/drivers/power/supply/qcom/fg-util.c       2023-02-05 14:08:11.135868931 +0800
+++ b/drivers/power/supply/qcom/fg-util.c       2023-02-05 11:39:29.919075791 +0800
@@ -427,7 +427,7 @@
        sec_access = (addr & 0x00FF) > 0xD0;
 #endif
 #else
-       sec_access = (addr & 0x00FF) > 0xB8;
+       sec_access = (addr & 0x00FF) > 0xD0;
 #endif
        if (sec_access) {
                rc = regmap_write(chip->regmap, (addr & 0xFF00) | 0xD0, 0xA5);
 

ichigo_kurosaki

Senior Member
Feb 24, 2013
1,015
235
36
Butuan City
For decrypt support of A12/13 FBE (file based encryption), TWRP 3.7.0_12 (12.1 branch) is required. The official TWRP 3.6.2_9/3.7.0_9 is 9 branch that doesn't support A12/13 FBE. The kernel version doesn't matter.
For switching between my LOS 19 (no encryption) and my LOS 20 (A13 FBE), formatting data is required.
Hello,

I am currently on @sabar_op's LineageOS20. Suffice to say that I am currently on the 4.19 based TWRP 3.7.0_12 by @pix106. So I have couple of questions regarding your android 13 ROM. This was also suggested to me by someone who replied on my comment on another thread.

  1. is my current recovery OK for flashing this ROM?
  2. Does this ROM support USB audio? Because Sabar's LineageOS20 (and I think his pixelexperience30) doesn't.
I am not saying sabar'sabar's ROM is bad. I just wanted to use my USB DAC. Lol 😁
 

kyasu

Senior Member
Sep 23, 2012
649
2,953
Tokyo
Diff:
--- a/drivers/power/supply/qcom/fg-util.c       2023-02-05 14:08:11.135868931 +0800
+++ b/drivers/power/supply/qcom/fg-util.c       2023-02-05 11:39:29.919075791 +0800
@@ -427,7 +427,7 @@
        sec_access = (addr & 0x00FF) > 0xD0;
 #endif
 #else
-       sec_access = (addr & 0x00FF) > 0xB8;
+       sec_access = (addr & 0x00FF) > 0xD0;
 #endif
        if (sec_access) {
                rc = regmap_write(chip->regmap, (addr & 0xFF00) | 0xD0, 0xA5);
My diff is as follows and looks like same as yours:
Diff:
diff --git a/drivers/power/supply/qcom/fg-util.c b/drivers/power/supply/qcom/fg-util.c
index 1fd5880cd71e..2aa0dd0fa74f 100644
--- a/drivers/power/supply/qcom/fg-util.c
+++ b/drivers/power/supply/qcom/fg-util.c
@@ -426,8 +426,12 @@ int fg_write(struct fg_chip *chip, int addr, u8 *val, int len)
 #else
 	sec_access = (addr & 0x00FF) > 0xD0;
 #endif
+#else
+#if defined(CONFIG_MACH_XIAOMI_CLOVER)
+	sec_access = (addr & 0x00FF) > 0xD0;
 #else
 	sec_access = (addr & 0x00FF) > 0xB8;
+#endif
 #endif
 	if (sec_access) {
 		rc = regmap_write(chip->regmap, (addr & 0xFF00) | 0xD0, 0xA5);
I build the kernel again. Please test it again.
 

Attachments

  • boot-20220211.img
    14.8 MB · Views: 20

kyasu

Senior Member
Sep 23, 2012
649
2,953
Tokyo
Hello,

I am currently on @sabar_op's LineageOS20. Suffice to say that I am currently on the 4.19 based TWRP 3.7.0_12 by @pix106. So I have couple of questions regarding your android 13 ROM. This was also suggested to me by someone who replied on my comment on another thread.

  1. is my current recovery OK for flashing this ROM?
  2. Does this ROM support USB audio? Because Sabar's LineageOS20 (and I think his pixelexperience30) doesn't.
I am not saying sabar'sabar's ROM is bad. I just wanted to use my USB DAC. Lol 😁
  1. Please use twrp-3.7.0_12-0-clover-4.4.img in the first post.
  2. USB earphones seem to work. Please test it.
 
  • Love
Reactions: ichigo_kurosaki

bakasamaz

Senior Member
May 25, 2006
90
0
City of Angel
Does anyone here experience an issue with the taskbar? somehow after putting my sim card and receiving mobile signal, the taskbar is no longer showing up both in portrait or landscape. Also, Google map doesn't show toggle for dark mode. Would appreciate the help here. Thanks!
 

Filippo21

Member
Dec 10, 2016
25
4
Hi, I just installed the ROM updating from LineageOS19 using Lineage Recovery.
Everything seems to work well.
The At A Glance widget Is not available on the home page and I can't find it on available widgets list. Who knows how to add it?

Great ROM! Thank you very much to the developer!!! 👍🏻👏🏻
 

browoz

New member
Nov 12, 2011
4
0
Warsaw
This ROM looks really neat, but I am wondering is USB MIDI support enabled? The device seems to have no trouble running USB host mode with stuff like keyboards but it cannot talk to any MIDI device (tried a few).
@kyasu would you be able to enable midi support in the kernel?
 

twu2

Senior Member
Oct 25, 2009
177
278
Taipei
blog.teatime.com.tw
My diff is as follows and looks like same as yours:
Diff:
diff --git a/drivers/power/supply/qcom/fg-util.c b/drivers/power/supply/qcom/fg-util.c
index 1fd5880cd71e..2aa0dd0fa74f 100644
--- a/drivers/power/supply/qcom/fg-util.c
+++ b/drivers/power/supply/qcom/fg-util.c
@@ -426,8 +426,12 @@ int fg_write(struct fg_chip *chip, int addr, u8 *val, int len)
 #else
     sec_access = (addr & 0x00FF) > 0xD0;
 #endif
+#else
+#if defined(CONFIG_MACH_XIAOMI_CLOVER)
+    sec_access = (addr & 0x00FF) > 0xD0;
 #else
     sec_access = (addr & 0x00FF) > 0xB8;
+#endif
 #endif
     if (sec_access) {
         rc = regmap_write(chip->regmap, (addr & 0xFF00) | 0xD0, 0xA5);
I build the kernel again. Please test it again.
This one still has problem for charging.
I found the reason, there're 2 position need to change for 0xD0, the above patch just modify one.
We need to modify the code of fg_write() and fg_masked_write().
Diff:
--- a/drivers/power/supply/qcom/fg-util.c       2023-02-12 11:08:10.444628834 +0800
+++ b/drivers/power/supply/qcom/fg-util.c       2023-02-12 11:08:57.101379773 +0800
@@ -427,8 +427,12 @@
        sec_access = (addr & 0x00FF) > 0xD0;
 #endif
 #else
+#if defined(CONFIG_MACH_XIAOMI_CLOVER)
+       sec_access = (addr & 0x00FF) > 0xD0;
+#else
        sec_access = (addr & 0x00FF) > 0xB8;
 #endif
+#endif
        if (sec_access) {
                rc = regmap_write(chip->regmap, (addr & 0xFF00) | 0xD0, 0xA5);
                if (rc < 0) {
@@ -475,7 +479,11 @@
        sec_access = (addr & 0x00FF) > 0xD0;
 #endif
 #else
-       sec_access = (addr & 0x00FF) >= 0xBA;
+#if defined(CONFIG_MACH_XIAOMI_CLOVER)
+        sec_access = (addr & 0x00FF) > 0xD0;
+#else
+        sec_access = (addr & 0x00FF) > 0xB8;
+#endif
 #endif
        if (sec_access) {
                rc = regmap_write(chip->regmap, (addr & 0xFF00) | 0xD0, 0xA5);
 
  • Like
Reactions: kyasu

addidub

New member
Sep 25, 2011
1
0
Xiaomi Mi Pad 4
Xiaomi 12
@kyasu just passing through to say 'thank you' for all your works to keep Clover alive with your lineage os forks. I am using lineage OS on my Mi Pad 4 since 2019 and it has never let me down yet.
Today I installed your newest version and everything I tested until now is working like a charme. Unlike many other devices I owned, Clover is able to run GTA San Andreas app which is very nice 😁
 

Top Liked Posts