summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@marvell.com>2009-09-21 18:14:12 +0200
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-09-22 14:58:23 +0200
commit55c1d7c60d9b269551cd7cc31e6be8323e1d94ec (patch)
tree7a7bb0472c1ec89a50e5700ce942c43a00169616
parentregulator/driver: be more specific in nanodoc for is_enabled (diff)
downloadlinux-55c1d7c60d9b269551cd7cc31e6be8323e1d94ec.tar.xz
linux-55c1d7c60d9b269551cd7cc31e6be8323e1d94ec.zip
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>
-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 c9de73098470..aa224d936e0d 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;