Skip to contentSkip to conversation

regulator: palmas: Fix off-by-one for ramp_delay and register value mapping

PATCH RESEND Applied Axel Lin 3 participants 3 messages Apr 22, 2013

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH RESEND 1/1 regulator: palmas: Fix off-by-one for ramp_delay and register value mapping

Datasheet says:
Time Step (TSTEP) selection, when changing the output voltage, the new value is reached through successive voltage steps (if not bypassed). The equivalent programmable slew rate of the output voltage is:

TSTEP[1:0]: 00 Jump (no slope control)
TSTEP[1:0]: 01 10mV/us
TSTEP[1:0]: 10 5mV/us (default)
TSTEP[1:0]: 11 2.5mV/us

---
This resend updates the commit log.

 drivers/regulator/palmas-regulator.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/palmas-regulator.c +2 -2
index 8fed60c..e3e8373 100644
@@ -447,9 +447,9 @@ static int palmas_smps_set_ramp_delay(struct regulator_dev *rdev,
 
 	if (ramp_delay <= 0)
 		reg = 0;
-	else if (ramp_delay < 2500)
+	else if (ramp_delay <= 2500)
 		reg = 3;
-	else if (ramp_delay < 5000)
+	else if (ramp_delay <= 5000)
 		reg = 2;
 	else
 		reg = 1;
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Axel Lin

Datasheet says:
Time Step (TSTEP) selection, when changing the output voltage, the new value is reached through successive voltage steps (if not bypassed). The equivalent programmable slew rate of the output voltage is:

Quoted 7 lines

TSTEP[1:0]: 00 Jump (no slope control)
TSTEP[1:0]: 01 10mV/us
TSTEP[1:0]: 10 5mV/us (default)
TSTEP[1:0]: 11 2.5mV/us

---

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

Datasheet says:
Time Step (TSTEP) selection, when changing the output voltage, the new value is reached through successive voltage steps (if not bypassed). The equivalent programmable slew rate of the output voltage is:

Applied, thanks.