* [PATCH 0/2] regulator: axp20x: Fix bugs for AXP803/6
@ 2019-07-06 10:05 Jernej Skrabec
2019-07-06 10:05 ` [PATCH 1/2] regulator: axp20x: fix DCDCA and DCDCD for AXP806 Jernej Skrabec
2019-07-06 10:05 ` [PATCH 2/2] regulator: axp20x: fix DCDC6 for AXP803 Jernej Skrabec
0 siblings, 2 replies; 6+ messages in thread
From: Jernej Skrabec @ 2019-07-06 10:05 UTC (permalink / raw)
To: wens; +Cc: lgirdwood, broonie, linux-kernel
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(-)
--
2.22.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] regulator: axp20x: fix DCDCA and DCDCD for AXP806
2019-07-06 10:05 [PATCH 0/2] regulator: axp20x: Fix bugs for AXP803/6 Jernej Skrabec
@ 2019-07-06 10:05 ` Jernej Skrabec
2019-07-06 11:21 ` Mark Brown
2019-07-06 10:05 ` [PATCH 2/2] regulator: axp20x: fix DCDC6 for AXP803 Jernej Skrabec
1 sibling, 1 reply; 6+ messages in thread
From: Jernej Skrabec @ 2019-07-06 10:05 UTC (permalink / raw)
To: wens; +Cc: lgirdwood, broonie, linux-kernel
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")
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
drivers/regulator/axp20x-regulator.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 152053361862..c951568994a1 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -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),
};
--
2.22.0
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/2] regulator: axp20x: fix DCDCA and DCDCD for AXP806
2019-07-06 10:05 ` [PATCH 1/2] regulator: axp20x: fix DCDCA and DCDCD for AXP806 Jernej Skrabec
@ 2019-07-06 11:21 ` Mark Brown
2019-07-06 12:44 ` Jernej Škrabec
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2019-07-06 11:21 UTC (permalink / raw)
To: Jernej Skrabec; +Cc: wens, lgirdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 250 bytes --]
On Sat, Jul 06, 2019 at 12:05:44PM +0200, Jernej Skrabec wrote:
> 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?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] regulator: axp20x: fix DCDCA and DCDCD for AXP806
2019-07-06 11:21 ` Mark Brown
@ 2019-07-06 12:44 ` Jernej Škrabec
2019-07-08 15:31 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Jernej Škrabec @ 2019-07-06 12:44 UTC (permalink / raw)
To: Mark Brown; +Cc: wens, lgirdwood, linux-kernel
Dne sobota, 06. julij 2019 ob 13:21:44 CEST je Mark Brown napisal(a):
> On Sat, Jul 06, 2019 at 12:05:44PM +0200, Jernej Skrabec wrote:
> > 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] regulator: axp20x: fix DCDCA and DCDCD for AXP806
2019-07-06 12:44 ` Jernej Škrabec
@ 2019-07-08 15:31 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2019-07-08 15:31 UTC (permalink / raw)
To: Jernej Škrabec; +Cc: wens, lgirdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 958 bytes --]
On Sat, Jul 06, 2019 at 02:44:03PM +0200, Jernej Škrabec wrote:
> Dne sobota, 06. julij 2019 ob 13:21:44 CEST je Mark Brown napisal(a):
> > 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).
Can you please resend these with changelogs on the relevant
patches so they can be reviewed more sensibly?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] regulator: axp20x: fix DCDC6 for AXP803
2019-07-06 10:05 [PATCH 0/2] regulator: axp20x: Fix bugs for AXP803/6 Jernej Skrabec
2019-07-06 10:05 ` [PATCH 1/2] regulator: axp20x: fix DCDCA and DCDCD for AXP806 Jernej Skrabec
@ 2019-07-06 10:05 ` Jernej Skrabec
1 sibling, 0 replies; 6+ messages in thread
From: Jernej Skrabec @ 2019-07-06 10:05 UTC (permalink / raw)
To: wens; +Cc: lgirdwood, broonie, linux-kernel
Refactoring of axp20x driver introduced a bug in AXP803's DCDC6
regulator definition.
Fix it.
Fixes: db4a555f7c4cf ("regulator: axp20x: use defines for masks")
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
drivers/regulator/axp20x-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index c951568994a1..29b92ce521b7 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -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
--
2.22.0
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-07-08 15:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-06 10:05 [PATCH 0/2] regulator: axp20x: Fix bugs for AXP803/6 Jernej Skrabec
2019-07-06 10:05 ` [PATCH 1/2] regulator: axp20x: fix DCDCA and DCDCD for AXP806 Jernej Skrabec
2019-07-06 11:21 ` Mark Brown
2019-07-06 12:44 ` Jernej Škrabec
2019-07-08 15:31 ` Mark Brown
2019-07-06 10:05 ` [PATCH 2/2] regulator: axp20x: fix DCDC6 for AXP803 Jernej Skrabec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®