Skip to contentSkip to conversation

regulator: axp20x: Fix bugs for AXP803/6

PATCH Superseded Jernej Skrabec 2 participants 6 messages Jul 6, 2019 – Jul 8, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover regulator: axp20x: Fix bugs for AXP803/6

Driver refactoring caused few bugs and most of them are already fixed. However, some are still present, namely in AXP806 and AXP803 regulator definitions.

This short patch series fix them.

Please take a look.

Best regards,
Jernej

Jernej Skrabec (2):
regulator: axp20x: fix DCDCA and DCDCD for AXP806
regulator: axp20x: fix DCDC6 for AXP803

 drivers/regulator/axp20x-regulator.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.22.0
#1 lore raw

PATCH 1/2 regulator: axp20x: fix DCDCA and DCDCD for AXP806

Refactoring of the driver introduced few bugs in AXP806's DCDCA and DCDCD regulator definitions.

Fix them.

Fixes db4a555f7c4cf ("regulator: axp20x: use defines for masks")
---
 drivers/regulator/axp20x-regulator.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/axp20x-regulator.c +3 -3
index 152053361862..c951568994a1 100644
@@ -240,7 +240,7 @@
 #define AXP806_DCDCA_600mV_END		\
 	(AXP806_DCDCA_600mV_START + AXP806_DCDCA_600mV_STEPS)
 #define AXP806_DCDCA_1120mV_START	0x33
-#define AXP806_DCDCA_1120mV_STEPS	14
+#define AXP806_DCDCA_1120mV_STEPS	20
 #define AXP806_DCDCA_1120mV_END		\
 	(AXP806_DCDCA_1120mV_START + AXP806_DCDCA_1120mV_STEPS)
 #define AXP806_DCDCA_NUM_VOLTAGES	72
@@ -774,8 +774,8 @@ static const struct regulator_linear_range axp806_dcdcd_ranges[] = {
 			       AXP806_DCDCD_600mV_END,
 			       20000),
 	REGULATOR_LINEAR_RANGE(1600000,
-			       AXP806_DCDCD_600mV_START,
-			       AXP806_DCDCD_600mV_END,
+			       AXP806_DCDCD_1600mV_START,
+			       AXP806_DCDCD_1600mV_END,
 			       100000),
 };
 
Signature · 1 line
2.22.0
maintainer
#2 lore raw

Re: [PATCH 1/2] regulator: axp20x: fix DCDCA and DCDCD for AXP806

Quoted 2 lines · Jernej Skrabec

Refactoring of the driver introduced few bugs in AXP806's DCDCA and DCDCD regulator definitions.

This is not a great changelog - what are the bugs and how does this patch fix them?

#3 lore raw

Re: [PATCH 1/2] regulator: axp20x: fix DCDCA and DCDCD for AXP806

Dne sobota, 06. julij 2019 ob 13:21:44 CEST je Mark Brown napisal(a):

Quoted 6 lines · Jernej Skrabec
Quoted 2 lines

Refactoring of the driver introduced few bugs in AXP806's DCDCA and DCDCD regulator definitions.

This is not a great changelog - what are the bugs and how does this patch fix them?

In case of DCDCA, number of steps for second range should be 20 (0x14), but it was set to 14. So I guess patch author missed "0x". Currently, math doesn't work, because sum of both number of steps plus 2 must be equal to number of voltages macro.

Same error is present in AXP803 DCDC6 regulator.

In case of DCDCD, array of ranges (axp806_dcdcd_ranges) contains two ranges, which use same start and end macros. By checking datasheet or just checking macros at the top of the source file, it's obvious that "1" is missing in second range macro names (1600 instead of 600).

And I think I found another bug, AXP803_DCDC5_NUM_VOLTAGES should be 69 and not 68. However, this bug was present before refactoring, refactoring just carried it over.

Best regards,
Jernej

maintainer
#4 lore raw

Re: [PATCH 1/2] regulator: axp20x: fix DCDCA and DCDCD for AXP806

Quoted 10 lines · Jernej Škrabec

Dne sobota, 06. julij 2019 ob 13:21:44 CEST je Mark Brown napisal(a):

Quoted 2 lines

This is not a great changelog - what are the bugs and how does this patch fix them?

In case of DCDCA, number of steps for second range should be 20 (0x14), but it was set to 14. So I guess patch author missed "0x". Currently, math doesn't work, because sum of both number of steps plus 2 must be equal to number of voltages macro.

Quoted 6 lines

Same error is present in AXP803 DCDC6 regulator.

In case of DCDCD, array of ranges (axp806_dcdcd_ranges) contains two ranges, which use same start and end macros. By checking datasheet or just checking macros at the top of the source file, it's obvious that "1" is missing in second range macro names (1600 instead of 600).

Can you please resend these with changelogs on the relevant patches so they can be reviewed more sensibly?

#5 lore raw

PATCH 2/2 regulator: axp20x: fix DCDC6 for AXP803

In reply to Jernej Skrabec

Refactoring of axp20x driver introduced a bug in AXP803's DCDC6 regulator definition.

Fix it.

Fixes db4a555f7c4cf ("regulator: axp20x: use defines for masks")
---
 drivers/regulator/axp20x-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/axp20x-regulator.c +1 -1
index c951568994a1..29b92ce521b7 100644
@@ -181,7 +181,7 @@
 #define AXP803_DCDC6_600mV_END		\
 	(AXP803_DCDC6_600mV_START + AXP803_DCDC6_600mV_STEPS)
 #define AXP803_DCDC6_1120mV_START	0x33
-#define AXP803_DCDC6_1120mV_STEPS	14
+#define AXP803_DCDC6_1120mV_STEPS	20
 #define AXP803_DCDC6_1120mV_END		\
 	(AXP803_DCDC6_1120mV_START + AXP803_DCDC6_1120mV_STEPS)
 #define AXP803_DCDC6_NUM_VOLTAGES	72
Signature · 1 line
2.22.0