regulator: axp20x: Fix bugs for AXP803/6
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
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.
--- drivers/regulator/axp20x-regulator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/axp20x-regulator.c +3 -3
@@ -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
Mark Brown
maintainerRe: [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?
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
Mark Brown
maintainerRe: [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?
PATCH 2/2 regulator: axp20x: fix DCDC6 for AXP803
In reply to Jernej SkrabecRefactoring of axp20x driver introduced a bug in AXP803's DCDC6 regulator definition.
Fix it.
--- drivers/regulator/axp20x-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/axp20x-regulator.c +1 -1
@@ -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