Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292045
b: refs/heads/master
c: e9a15c8
h: refs/heads/master
i:
  292043: 04ee622
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 11, 2012
1 parent 0ba5d6e commit f1e82a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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: 1c37f8a838fa8b1e98a984893bd4f1a8a9849421
refs/heads/master: e9a15c8cad2a23e86a8e6457a3ab0ab3bda50d35
6 changes: 3 additions & 3 deletions trunk/drivers/regulator/wm8400-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ static int wm8400_ldo_set_voltage(struct regulator_dev *dev,

if (min_uV < 1700000) {
/* Steps of 50mV from 900mV; */
val = (min_uV - 850001) / 50000;
val = DIV_ROUND_UP(min_uV - 900000, 50000);

if ((val * 50000) + 900000 > max_uV)
return -EINVAL;
BUG_ON((val * 50000) + 900000 < min_uV);
} else {
/* Steps of 100mV from 1700mV */
val = ((min_uV - 1600001) / 100000);
val = DIV_ROUND_UP(min_uV - 1700000, 100000);

if ((val * 100000) + 1700000 > max_uV)
return -EINVAL;
Expand Down Expand Up @@ -168,7 +168,7 @@ static int wm8400_dcdc_set_voltage(struct regulator_dev *dev,
if (min_uV < 850000)
return -EINVAL;

val = (min_uV - 825001) / 25000;
val = DIV_ROUND_UP(min_uV - 850000, 25000);

if (850000 + (25000 * val) > max_uV)
return -EINVAL;
Expand Down

0 comments on commit f1e82a8

Please sign in to comment.