2013-04-22 10:22:58

by Axel Lin

[permalink] [raw]
Subject: [PATCH RESEND] 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

Signed-off-by: Axel Lin <[email protected]>
---
This resend updates the commit log.

drivers/regulator/palmas-regulator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 8fed60c..e3e8373 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -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;
--
1.7.10.4



2013-04-22 12:28:13

by Laxman Dewangan

[permalink] [raw]
Subject: Re: [PATCH RESEND] regulator: palmas: Fix off-by-one for ramp_delay and register value mapping

On Monday 22 April 2013 03:52 PM, Axel Lin wrote:
> 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
>
> Signed-off-by: Axel Lin <[email protected]>
> ---

Acked-by: Laxman Dewangan <[email protected]>

2013-04-22 12:34:38

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH RESEND] regulator: palmas: Fix off-by-one for ramp_delay and register value mapping

On Mon, Apr 22, 2013 at 06:22:49PM +0800, Axel Lin wrote:
> 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.


Attachments:
(No filename) (304.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments