projects/linux·commit 6ff325a2

regulator: max8997: Fix setting inappropriate value for ramp_delay variable

6ff325a2 · Donggeun Kim <[email protected]> · 2011-07-07 16:51:56 +09:00

The ramp_delay variable can be set lower than the desired value.
This patch fixes it.

Signed-off-by: Donggeun Kim <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
Signed-off-by: KyungMin Park <[email protected]>
Acked-by: Mark Brown <[email protected]>
Signed-off-by: Liam Girdwood <[email protected]>
Commit
6ff325a2d85481cbe31dfbb74b4fd2d94c115300
Parents
90609503

Changes

1 files changed · +2 −1

FileStatusAddDelContent
drivers/regulator/max8997.cmodified+2−1View file

drivers/regulator/max8997.c

View file
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index f8940c6..ad6628c 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;