Skip to contentSkip to conversation

regulator: core: Return correct delay time in regulator_set_voltage_time_sel

PATCH Applied Axel Lin 3 participants 3 messages Jun 11, 2012 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: core: Return correct delay time in regulator_set_voltage_time_sel

rdev->desc->uV_step * abs(new_selector - old_selector) returns uV. The unit of ramp_delay is mV/us.

Current code multiples 1000 at wrong place.

---
 drivers/regulator/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/core.c +1 -1
index f4c056a..63507a5 100644
@@ -2308,7 +2308,7 @@ int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
 	if (rdev->desc->ramp_delay && rdev->desc->uV_step)
 		return DIV_ROUND_UP(rdev->desc->uV_step *
 			abs(new_selector - old_selector),
-			rdev->desc->ramp_delay) * 1000;
+			rdev->desc->ramp_delay * 1000);
 	return 0;
 }
 
Signature · 1 line
1.7.9.5
Applied
#1 lore raw
Quoted 2 lines · Axel Lin

rdev->desc->uV_step * abs(new_selector - old_selector) returns uV. The unit of ramp_delay is mV/us.

Applied, thanks.

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

rdev->desc->uV_step * abs(new_selector - old_selector) returns uV. The unit of ramp_delay is mV/us.

Current code multiples 1000 at wrong place.

I am moving ramp_delay to constraints, so i have to modify this line again. It will be corrected their.

Thanks,
Yadwinder.

Quoted 30 lines

---
 drivers/regulator/core.c |    2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/core.c +0 -0
index f4c056a..63507a5 100644
@@ -2308,7 +2308,7 @@ int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
        if (rdev->desc->ramp_delay && rdev->desc->uV_step)

               return DIV_ROUND_UP(rdev->desc->uV_step * abs(new_selector - old_selector),
-                       rdev->desc->ramp_delay) * 1000;
+                       rdev->desc->ramp_delay * 1000); return 0;
 }

--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/