Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323339
b: refs/heads/master
c: 422294d
h: refs/heads/master
i:
  323337: c5c95b5
  323335: a1b787c
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Aug 28, 2012
1 parent a07ea93 commit 5edc431
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb44cdeacd693ca964deab9d9f698920bb73529d
refs/heads/master: 422294deee5fd818527d68951a370a2119876e06
11 changes: 5 additions & 6 deletions trunk/drivers/regulator/wm831x-dcdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,15 @@ static int wm831x_buckv_set_current_limit(struct regulator_dev *rdev,
u16 reg = dcdc->base + WM831X_DCDC_CONTROL_2;
int i;

for (i = 0; i < ARRAY_SIZE(wm831x_dcdc_ilim); i++) {
for (i = ARRAY_SIZE(wm831x_dcdc_ilim) - 1; i >= 0; i--) {
if ((min_uA <= wm831x_dcdc_ilim[i]) &&
(wm831x_dcdc_ilim[i] <= max_uA))
break;
return wm831x_set_bits(wm831x, reg,
WM831X_DC1_HC_THR_MASK,
i << WM831X_DC1_HC_THR_SHIFT);
}
if (i == ARRAY_SIZE(wm831x_dcdc_ilim))
return -EINVAL;

return wm831x_set_bits(wm831x, reg, WM831X_DC1_HC_THR_MASK,
i << WM831X_DC1_HC_THR_SHIFT);
return -EINVAL;
}

static int wm831x_buckv_get_current_limit(struct regulator_dev *rdev)
Expand Down

0 comments on commit 5edc431

Please sign in to comment.