Skip to content

Commit

Permalink
regulator: max8997: Fix setting inappropriate value for ramp_delay va…
Browse files Browse the repository at this point in the history
…riable

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>
  • Loading branch information
Donggeun Kim authored and Liam Girdwood committed Jul 8, 2011
1 parent 9060950 commit 6ff325a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/regulator/max8997.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6ff325a

Please sign in to comment.