aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm831x-dcdc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/wm831x-dcdc.c')
-rw-r--r--drivers/regulator/wm831x-dcdc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c
index 4904a40b0d46..3044001f3cf6 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,
386 if (i == ARRAY_SIZE(wm831x_dcdc_ilim)) 386 if (i == ARRAY_SIZE(wm831x_dcdc_ilim))
387 return -EINVAL; 387 return -EINVAL;
388 388
389 return wm831x_set_bits(wm831x, reg, WM831X_DC1_HC_THR_MASK, i); 389 return wm831x_set_bits(wm831x, reg, WM831X_DC1_HC_THR_MASK,
390 i << WM831X_DC1_HC_THR_SHIFT);
390} 391}
391 392
392static int wm831x_buckv_get_current_limit(struct regulator_dev *rdev) 393static 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)
400 if (val < 0) 401 if (val < 0)
401 return val; 402 return val;
402 403
403 return wm831x_dcdc_ilim[val & WM831X_DC1_HC_THR_MASK]; 404 val = (val & WM831X_DC1_HC_THR_MASK) >> WM831X_DC1_HC_THR_SHIFT;
405 return wm831x_dcdc_ilim[val];
404} 406}
405 407
406static struct regulator_ops wm831x_buckv_ops = { 408static struct regulator_ops wm831x_buckv_ops = {