* [PATCH] regulator: Fix set and get current limit for wm831x_buckv
@ 2012-03-15 7:53 Axel Lin
2012-03-26 17:31 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-03-15 7:53 UTC (permalink / raw)
To: linux-kernel; +Cc: Liam Girdwood, Mark Brown
WM831X_DC1_HC_THR_MASK is 0x0070.
We need to do proper shift for setting and getting current limit.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/wm831x-dcdc.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c
index 4904a40..3044001 100644
--- a/drivers/regulator/wm831x-dcdc.c
+++ b/drivers/regulator/wm831x-dcdc.c
@@ -386,7 +386,8 @@ static int wm831x_buckv_set_current_limit(struct regulator_dev *rdev,
if (i == ARRAY_SIZE(wm831x_dcdc_ilim))
return -EINVAL;
- return wm831x_set_bits(wm831x, reg, WM831X_DC1_HC_THR_MASK, i);
+ return wm831x_set_bits(wm831x, reg, WM831X_DC1_HC_THR_MASK,
+ i << WM831X_DC1_HC_THR_SHIFT);
}
static int wm831x_buckv_get_current_limit(struct regulator_dev *rdev)
@@ -400,7 +401,8 @@ static int wm831x_buckv_get_current_limit(struct regulator_dev *rdev)
if (val < 0)
return val;
- return wm831x_dcdc_ilim[val & WM831X_DC1_HC_THR_MASK];
+ val = (val & WM831X_DC1_HC_THR_MASK) >> WM831X_DC1_HC_THR_SHIFT;
+ return wm831x_dcdc_ilim[val];
}
static struct regulator_ops wm831x_buckv_ops = {
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] regulator: Fix set and get current limit for wm831x_buckv
2012-03-15 7:53 [PATCH] regulator: Fix set and get current limit for wm831x_buckv Axel Lin
@ 2012-03-26 17:31 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-03-26 17:31 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 180 bytes --]
On Thu, Mar 15, 2012 at 03:53:05PM +0800, Axel Lin wrote:
> WM831X_DC1_HC_THR_MASK is 0x0070.
> We need to do proper shift for setting and getting current limit.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-26 17:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-15 7:53 [PATCH] regulator: Fix set and get current limit for wm831x_buckv Axel Lin
2012-03-26 17:31 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox