summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDonggeun Kim <dg77.kim@samsung.com>2011-07-07 16:51:56 +0900
committerLiam Girdwood <lrg@slimlogic.co.uk>2011-07-08 19:14:58 +0100
commit6ff325a2d85481cbe31dfbb74b4fd2d94c115300 (patch)
tree73cc33527b32147a874d6912843be44070434e54 /drivers
parent90609503b71b6ec4aaf325c88de98da28740bc1d (diff)
downloadblackbird-op-linux-6ff325a2d85481cbe31dfbb74b4fd2d94c115300.tar.gz
blackbird-op-linux-6ff325a2d85481cbe31dfbb74b4fd2d94c115300.zip
regulator: max8997: Fix setting inappropriate value for ramp_delay variable
The ramp_delay variable can be set lower than the desired value. This patch fixes it. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: KyungMin Park <kyungmin.park@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/max8997.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index f8940c603cf0..ad6628ca94f4 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -544,7 +544,8 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
rid == MAX8997_BUCK4 || rid == MAX8997_BUCK5) {
/* If the voltage is increasing */
if (org < i)
- udelay(desc->step * (i - org) / max8997->ramp_delay);
+ udelay(DIV_ROUND_UP(desc->step * (i - org),
+ max8997->ramp_delay));
}
return ret;
OpenPOWER on IntegriCloud