Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292046
b: refs/heads/master
c: ae76e83
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 11, 2012
1 parent f1e82a8 commit ed5bfdf
Show file tree
Hide file tree
Showing 2 changed files with 7 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: e9a15c8cad2a23e86a8e6457a3ab0ab3bda50d35
refs/heads/master: ae76e8307ff2812a57692a54322c6898a949ae76
12 changes: 6 additions & 6 deletions trunk/drivers/regulator/da903x.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static int da903x_set_ldo_voltage(struct regulator_dev *rdev,
return -EINVAL;
}

val = (min_uV - info->min_uV + info->step_uV - 1) / info->step_uV;
val = DIV_ROUND_UP(min_uV - info->min_uV, info->step_uV);
*selector = val;
val <<= info->vol_shift;
mask = ((1 << info->vol_nbits) - 1) << info->vol_shift;
Expand Down Expand Up @@ -202,7 +202,7 @@ static int da9030_set_ldo1_15_voltage(struct regulator_dev *rdev,
return -EINVAL;
}

val = (min_uV - info->min_uV + info->step_uV - 1) / info->step_uV;
val = DIV_ROUND_UP(min_uV - info->min_uV, info->step_uV);
*selector = val;
val <<= info->vol_shift;
mask = ((1 << info->vol_nbits) - 1) << info->vol_shift;
Expand Down Expand Up @@ -233,10 +233,10 @@ static int da9030_set_ldo14_voltage(struct regulator_dev *rdev,

thresh = (info->max_uV + info->min_uV) / 2;
if (min_uV < thresh) {
val = (thresh - min_uV + info->step_uV - 1) / info->step_uV;
val = DIV_ROUND_UP(thresh - min_uV, info->step_uV);
val |= 0x4;
} else {
val = (min_uV - thresh + info->step_uV - 1) / info->step_uV;
val = DIV_ROUND_UP(min_uV - thresh, info->step_uV);
}

*selector = val;
Expand Down Expand Up @@ -281,7 +281,7 @@ static int da9034_set_dvc_voltage(struct regulator_dev *rdev,
return -EINVAL;
}

val = (min_uV - info->min_uV + info->step_uV - 1) / info->step_uV;
val = DIV_ROUND_UP(min_uV - info->min_uV, info->step_uV);
*selector = val;
val <<= info->vol_shift;
mask = ((1 << info->vol_nbits) - 1) << info->vol_shift;
Expand All @@ -307,7 +307,7 @@ static int da9034_set_ldo12_voltage(struct regulator_dev *rdev,
return -EINVAL;
}

val = (min_uV - info->min_uV + info->step_uV - 1) / info->step_uV;
val = DIV_ROUND_UP(min_uV - info->min_uV, info->step_uV);
val = (val >= 20) ? val - 12 : ((val > 7) ? 8 : val);
*selector = val;
val <<= info->vol_shift;
Expand Down

0 comments on commit ed5bfdf

Please sign in to comment.