regulator: max77686: Fix the delay time for set_voltage_time_sel
authorAxel Lin <axel.lin@gmail.com>
Fri, 8 Jun 2012 09:21:44 +0000 (17:21 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 11 Jun 2012 04:09:14 +0000 (12:09 +0800)
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>
drivers/regulator/max77686.c

index b0c146df42d1774224f0229dbbdc37488e63183d..2dd4ac91d283e5c0de37491d7122647b2a9793c1 100644 (file)
@@ -77,7 +77,7 @@ 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,
@@ -85,7 +85,7 @@ static int max77686_set_voltage_time_sel(struct regulator_dev *rdev,
 {
        /* 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 = {
This page took 0.045034 seconds and 5 git commands to generate.