[1/3] power: regulator: axp: Fix AXP318W ELDO voltage mask

Message ID 20261123011534.1692975-2-alastair@d-silva.org (mailing list archive)
State New
Headers
Series power: axp: Fix AXP318W bugs and extend SPL support |

Commit Message

Alastair D'Silva Nov. 23, 2026, 1:15 a.m. UTC
On AXP318W, ELDO1-ELDO6 span 500 mV to 1500 mV in 25 mV steps.
This 41-step range (selectors 0x00 to 0x28) requires a 6-bit mask (0x3f).

The current 5-bit mask (0x1f) breaks voltages above 1275 mV.
axp_regulator_get_value() masks out bit 5, reporting 1300-1500 mV as
500-700 mV.
axp_regulator_set_value() only clears bits [4:0], leaving bit 5 stuck
high when lowering a rail.

Update the ELDO1-ELDO6 voltage mask to 0x3f in axp318_regulators[].

Fixes: 71f07932756f ("power: regulator: add AXP318W support")
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
---
 drivers/power/regulator/axp_regulator.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Patch

diff --git a/drivers/power/regulator/axp_regulator.c b/drivers/power/regulator/axp_regulator.c
index 16d3a8f7f90..e425f3bf8b2 100644
--- a/drivers/power/regulator/axp_regulator.c
+++ b/drivers/power/regulator/axp_regulator.c
@@ -227,12 +227,12 @@  static const struct axp_regulator_plat axp318_regulators[] = {
 	{  "dldo4", 0x22, BIT(3), 0x37, 0x1f,  500, 3400, 100, NA },
 	{  "dldo5", 0x22, BIT(4), 0x38, 0x1f,  500, 3400, 100, NA },
 	{  "dldo6", 0x22, BIT(5), 0x39, 0x1f,  500, 3400, 100, NA },
-	{  "eldo1", 0x22, BIT(6), 0x3a, 0x1f,  500, 1500,  25, NA },
-	{  "eldo2", 0x22, BIT(7), 0x3b, 0x1f,  500, 1500,  25, NA },
-	{  "eldo3", 0x23, BIT(0), 0x3c, 0x1f,  500, 1500,  25, NA },
-	{  "eldo4", 0x23, BIT(1), 0x3d, 0x1f,  500, 1500,  25, NA },
-	{  "eldo5", 0x23, BIT(2), 0x3e, 0x1f,  500, 1500,  25, NA },
-	{  "eldo6", 0x23, BIT(3), 0x3f, 0x1f,  500, 1500,  25, NA },
+	{  "eldo1", 0x22, BIT(6), 0x3a, 0x3f,  500, 1500,  25, NA },
+	{  "eldo2", 0x22, BIT(7), 0x3b, 0x3f,  500, 1500,  25, NA },
+	{  "eldo3", 0x23, BIT(0), 0x3c, 0x3f,  500, 1500,  25, NA },
+	{  "eldo4", 0x23, BIT(1), 0x3d, 0x3f,  500, 1500,  25, NA },
+	{  "eldo5", 0x23, BIT(2), 0x3e, 0x3f,  500, 1500,  25, NA },
+	{  "eldo6", 0x23, BIT(3), 0x3f, 0x3f,  500, 1500,  25, NA },
 	{ "swout1", 0x11, BIT(3),   NA,   NA,   NA,   NA,  NA, NA },
 	{ "swout2", 0x11, BIT(4),   NA,   NA,   NA,   NA,  NA, NA },
 	{ }