Skip to content

Commit

Permalink
regulator: max77686: Fix the delay time for set_voltage_time_sel
Browse files Browse the repository at this point in the history
rdev->desc->uV_step * abs(new_selector - old_selector) returns uV.
The unit of ramp_rate is mV/us.
Thus 1000 should be multiplied.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Reviewed-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jun 11, 2012
1 parent 98a175b commit 23ca6bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/regulator/max77686.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ static int max77686_set_dvs_voltage_time_sel(struct regulator_dev *rdev,

return DIV_ROUND_UP(rdev->desc->uV_step *
abs(new_selector - old_selector),
ramp_rate[max77686->ramp_delay]);
ramp_rate[max77686->ramp_delay] * 1000);
}

static int max77686_set_voltage_time_sel(struct regulator_dev *rdev,
unsigned int old_selector, unsigned int new_selector)
{
/* Unconditionally 100 mV/us */
return DIV_ROUND_UP(rdev->desc->uV_step *
abs(new_selector - old_selector), 100);
abs(new_selector - old_selector), 100 * 1000);
}

static struct regulator_ops max77686_ops = {
Expand Down

0 comments on commit 23ca6bf

Please sign in to comment.