Skip to contentSkip to conversation

regulator: max77686: Fix the delay time for set_voltage_time_sel

PATCH Applied Axel Lin 3 participants 3 messages Jun 8, 2012 – Jun 11, 2012

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: max77686: Fix the delay time for set_voltage_time_sel

rdev->desc->uV_step * abs(new_selector - old_selector) returns uV. The unit of ramp_rate is mV/us.
Thus 1000 should be multiplied.

---
 drivers/regulator/max77686.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/max77686.c +2 -2
index b76a038..10bf65a 100644
@@ -78,7 +78,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,
@@ -86,7 +86,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 = {
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 30 lines · Axel Lin

rdev->desc->uV_step * abs(new_selector - old_selector) returns uV. The unit of ramp_rate is mV/us.
Thus 1000 should be multiplied.

---
 drivers/regulator/max77686.c |    4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/max77686.c +0 -0
index b76a038..10bf65a 100644
@@ -78,7 +78,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,

drivers/regulator/max77686.c +0 -0
@@ -86,7 +86,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); }

Quoted 2 lines

 static struct regulator_ops max77686_ops = {
--

Thanks,
Yadwinder.

Applied
#2 lore raw
In reply to Axel Lin
Quoted 3 lines · Axel Lin

rdev->desc->uV_step * abs(new_selector - old_selector) returns uV. The unit of ramp_rate is mV/us.
Thus 1000 should be multiplied.

Applied, thanks.