summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@marvell.com>2009-09-21 12:14:12 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-09-22 13:58:23 +0100
commit55c1d7c60d9b269551cd7cc31e6be8323e1d94ec (patch)
tree7a7bb0472c1ec89a50e5700ce942c43a00169616 /drivers/regulator
parentd87b969d15a084503870da598c97278fb4877753 (diff)
regulator: fix voltage range in da9034 ldo12
Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/da903x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/da903x.c b/drivers/regulator/da903x.c
index c9de7309847..aa224d936e0 100644
--- a/drivers/regulator/da903x.c
+++ b/drivers/regulator/da903x.c
@@ -301,7 +301,7 @@ static int da9034_set_ldo12_voltage(struct regulator_dev *rdev,
}
val = (min_uV - info->min_uV + info->step_uV - 1) / info->step_uV;
- val = (val > 7 && val < 20) ? 8 : val - 12;
+ val = (val >= 20) ? val - 12 : ((val > 7) ? 8 : val);
val <<= info->vol_shift;
mask = ((1 << info->vol_nbits) - 1) << info->vol_shift;