lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic
PATCH 1/1 lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic
Quoted 1 line
From
99175ed0f281d54efdaf8eef548077a8f0b4924aMon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Thu, 11 Mar 2010 09:50:07 +0800
Subject: [PATCH] lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic
Given x=0,1,2, current implementation of BUCK_VOL_CHANGE_SHIFT(x) returns 0,4,8. The correct return value should be 0,4,6.
This patch fix the logic.
--- drivers/regulator/lp3971.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/lp3971.c +0 -0
@@ -45,7 +45,7 @@ static int lp3971_set_bits(struct lp3971 *lp3971, u8
reg, u16 mask, u16 val);
LP3971_BUCK2 -> 4
LP3971_BUCK3 -> 6 */
-#define BUCK_VOL_CHANGE_SHIFT(x) (((1 << x) & ~0x01) << 1) +#define BUCK_VOL_CHANGE_SHIFT(x) (((!!x) << 2) | (x & ~0x01))
#define BUCK_VOL_CHANGE_FLAG_GO 0x01
#define BUCK_VOL_CHANGE_FLAG_TARGET 0x02
#define BUCK_VOL_CHANGE_FLAG_MASK 0x03
Signature · 1 line
1.5.4.3
Quoted 10 lines · axel lin
From
99175ed0f281d54efdaf8eef548077a8f0b4924aMon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Thu, 11 Mar 2010 09:50:07 +0800
Subject: [PATCH] lp3971: FixBUCK_VOL_CHANGE_SHIFTlogicGiven x=0,1,2, current implementation of
BUCK_VOL_CHANGE_SHIFT(x)returns 0,4,8. The correct return value should be 0,4,6.
This patch fix the logic.Signed-off-by Axel Lin <[email protected]>
with the same comment about ideally wanting someone who worked on the driver previously to check stuff.
Quoted 10 lines · Mark Brown
Quoted 9 lines · axel lin
From
99175ed0f281d54efdaf8eef548077a8f0b4924aMon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Thu, 11 Mar 2010 09:50:07 +0800
Subject: [PATCH] lp3971: FixBUCK_VOL_CHANGE_SHIFTlogicGiven x=0,1,2, current implementation of
BUCK_VOL_CHANGE_SHIFT(x)returns 0,4,8. The correct return value should be 0,4,6.
This patch fix the logic.
Quoted 6 lines
Quoted 1 line
Signed-off-by Axel Lin <[email protected]>Acked-by Mark Brown <[email protected]>with the same comment about ideally wanting someone who worked on the driver previously to check stuff.
Marek, Kyungmin, could someone please test/ack this before both are applied.
Thanks
Liam
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk
Marek Szyprowski
Acked-byHello,
Quoted 13 lines · Liam Girdwood
Quoted 12 lines · Mark Brown
Quoted 10 lines · axel lin
From
99175ed0f281d54efdaf8eef548077a8f0b4924aMon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Thu, 11 Mar 2010 09:50:07 +0800
Subject: [PATCH] lp3971: FixBUCK_VOL_CHANGE_SHIFTlogicGiven x=0,1,2, current implementation of
BUCK_VOL_CHANGE_SHIFT(x)returns 0,4,8. The correct return value should be 0,4,6.
This patch fix the logic.Signed-off-by Axel Lin <[email protected]>
Quoted 7 lines
Quoted 4 lines
Acked-by Mark Brown <[email protected]>with the same comment about ideally wanting someone who worked on the driver previously to check stuff.
Marek, Kyungmin, could someone please test/ack this before both are applied.
Axel was right, my bit arithmetic was definitely wrong. Again, thanks for spotting it and I'm really sorry You had lost some time debugging it.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
Quoted 10 lines · axel lin
Quoted 1 line
From
99175ed0f281d54efdaf8eef548077a8f0b4924aMon Sep 17 00:00:00 2001From: Axel Lin <[email protected]>
Date: Thu, 11 Mar 2010 09:50:07 +0800
Subject: [PATCH] lp3971: FixBUCK_VOL_CHANGE_SHIFTlogicGiven x=0,1,2, current implementation of
BUCK_VOL_CHANGE_SHIFT(x)returns 0,4,8. The correct return value should be 0,4,6.
This patch fix the logic.Signed-off-by Axel Lin <[email protected]>
Both Applied with fixes for mailer mangled patches.
Thanks
Liam
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk