public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic
@ 2010-03-11  1:56 axel lin
  2010-03-11 11:04 ` Mark Brown
  2010-03-17 23:08 ` Liam Girdwood
  0 siblings, 2 replies; 5+ messages in thread
From: axel lin @ 2010-03-11  1:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Marek Szyprowski, Kyungmin Park, lrg

>From 99175ed0f281d54efdaf8eef548077a8f0b4924a Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@gmail.com>
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.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/lp3971.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c
index a28ae37..1ba61ab 100644
--- a/drivers/regulator/lp3971.c
+++ b/drivers/regulator/lp3971.c
@@ -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
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic
  2010-03-11  1:56 [PATCH] lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic axel lin
@ 2010-03-11 11:04 ` Mark Brown
  2010-03-11 11:18   ` Liam Girdwood
  2010-03-17 23:08 ` Liam Girdwood
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-03-11 11:04 UTC (permalink / raw)
  To: axel lin; +Cc: linux-kernel, Marek Szyprowski, Kyungmin Park, lrg

On Thu, Mar 11, 2010 at 09:56:34AM +0800, axel lin wrote:
> From 99175ed0f281d54efdaf8eef548077a8f0b4924a Mon Sep 17 00:00:00 2001
> From: Axel Lin <axel.lin@gmail.com>
> 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.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

with the same comment about ideally wanting someone who worked on the
driver previously to check stuff.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic
  2010-03-11 11:04 ` Mark Brown
@ 2010-03-11 11:18   ` Liam Girdwood
  2010-03-15  6:48     ` Marek Szyprowski
  0 siblings, 1 reply; 5+ messages in thread
From: Liam Girdwood @ 2010-03-11 11:18 UTC (permalink / raw)
  To: Marek Szyprowski, Kyungmin Park; +Cc: axel lin, linux-kernel, Mark Brown

On Thu, 2010-03-11 at 11:04 +0000, Mark Brown wrote:
> On Thu, Mar 11, 2010 at 09:56:34AM +0800, axel lin wrote:
> > From 99175ed0f281d54efdaf8eef548077a8f0b4924a Mon Sep 17 00:00:00 2001
> > From: Axel Lin <axel.lin@gmail.com>
> > 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.
> > 
> > Signed-off-by: Axel Lin <axel.lin@gmail.com>
> 
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> 
> 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

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic
  2010-03-11 11:18   ` Liam Girdwood
@ 2010-03-15  6:48     ` Marek Szyprowski
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Szyprowski @ 2010-03-15  6:48 UTC (permalink / raw)
  To: 'Liam Girdwood', 'Kyungmin Park'
  Cc: 'axel lin', 'linux-kernel', 'Mark Brown'

Hello,

On Thursday, March 11, 2010 12:18 PM Liam Girdwood wrote:

> On Thu, 2010-03-11 at 11:04 +0000, Mark Brown wrote:
> > On Thu, Mar 11, 2010 at 09:56:34AM +0800, axel lin wrote:
> > > From 99175ed0f281d54efdaf8eef548077a8f0b4924a Mon Sep 17 00:00:00 2001
> > > From: Axel Lin <axel.lin@gmail.com>
> > > 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.
> > >
> > > Signed-off-by: Axel Lin <axel.lin@gmail.com>
> >
> > Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> >
> > 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.

Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic
  2010-03-11  1:56 [PATCH] lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic axel lin
  2010-03-11 11:04 ` Mark Brown
@ 2010-03-17 23:08 ` Liam Girdwood
  1 sibling, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2010-03-17 23:08 UTC (permalink / raw)
  To: axel.lin; +Cc: linux-kernel, Mark Brown, Marek Szyprowski, Kyungmin Park

On Thu, 2010-03-11 at 09:56 +0800, axel lin wrote:
> >From 99175ed0f281d54efdaf8eef548077a8f0b4924a Mon Sep 17 00:00:00 2001
> From: Axel Lin <axel.lin@gmail.com>
> 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.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Both Applied with fixes for mailer mangled patches.

Thanks

Liam

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-17 23:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11  1:56 [PATCH] lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic axel lin
2010-03-11 11:04 ` Mark Brown
2010-03-11 11:18   ` Liam Girdwood
2010-03-15  6:48     ` Marek Szyprowski
2010-03-17 23:08 ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox