Skip to contentSkip to conversation

power: mp5416: Fix LDO SVAL for MP5416 PMIC

PATCH In review Sidharth Prabukumar 3 participants 3 messages Sep 25, 2023 – Oct 10, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: mp5416: Fix LDO SVAL for MP5416 PMIC

The MP5416 PMIC's LDO set-value formula is incorrect. This patch fixes it by using the correct formula.

---
 include/power/mp5416.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/power/mp5416.h +1 -1
index dc096fed3f..4326baaa42 100644
@@ -32,7 +32,7 @@ enum {
 #define MP5416_VSET_SW3_GVAL(x) ((((x) & 0x7f) * 12500) + 600000)
 #define MP5416_VSET_SW4_GVAL(x) ((((x) & 0x7f) * 25000) + 800000)
 #define MP5416_VSET_LDO_GVAL(x) ((((x) & 0x7f) * 25000) + 800000)
-#define MP5416_VSET_LDO_SVAL(x) ((((x) & 0x7f) * 25000) + 800000)
+#define MP5416_VSET_LDO_SVAL(x) (((x) - 800000) / 25000)
 #define MP5416_VSET_SW1_SVAL(x) (((x) - 600000) / 12500)
 #define MP5416_VSET_SW2_SVAL(x) (((x) - 800000) / 25000)
 #define MP5416_VSET_SW3_SVAL(x) (((x) - 600000) / 12500)
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Sidharth Prabukumar

The MP5416 PMIC's LDO set-value formula is incorrect. This patch fixes it by using the correct formula.

Best Regards,
Jaehoon Chung

Quoted 17 lines
---
 include/power/mp5416.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/power/mp5416.h +1 -1
index dc096fed3f..4326baaa42 100644
@@ -32,7 +32,7 @@ enum {
 #define MP5416_VSET_SW3_GVAL(x) ((((x) & 0x7f) * 12500) + 600000)
 #define MP5416_VSET_SW4_GVAL(x) ((((x) & 0x7f) * 25000) + 800000)
 #define MP5416_VSET_LDO_GVAL(x) ((((x) & 0x7f) * 25000) + 800000)
-#define MP5416_VSET_LDO_SVAL(x) ((((x) & 0x7f) * 25000) + 800000)
+#define MP5416_VSET_LDO_SVAL(x) (((x) - 800000) / 25000)
 #define MP5416_VSET_SW1_SVAL(x) (((x) - 600000) / 12500)
 #define MP5416_VSET_SW2_SVAL(x) (((x) - 800000) / 25000)
 #define MP5416_VSET_SW3_SVAL(x) (((x) - 600000) / 12500)
#2 lore raw
In reply to Sidharth Prabukumar
Quoted 4 lines · Sidharth Prabukumar

The MP5416 PMIC's LDO set-value formula is incorrect. This patch fixes it by using the correct formula.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom