--- 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);