Re: [RFT PATCH] regulator: s2mpa01: Use correct register for buck[36] ramp delay

From: Krzysztof Kozlowski
Date: Wed May 07 2014 - 07:10:40 EST


Hi Sachin,


I'm looking at SM-N7505 JB Open source code and it seems that I was
wrong - the ramp delay for buck1 is set in wrong register, not buck3.

I don't have the datasheet for S2MPA01 so could you confirm the
registers for ramp delay of buck1, buck3 and buck6?


Best regards,
Krzysztof


On Åro, 2014-05-07 at 11:52 +0200, Krzysztof Kozlowski wrote:
> Buck1 and buck6 share the field (offset 4) in ramp delay register
> (S2MPA01_REG_RAMP1). The buck3 uses its own field in S2MPA01_REG_RAMP2
> register, also at offset 4.
>
> The driver interchanged the registers for ramp delay of buck3 and buck6.
> This lead to updating ramp delay for wrong buck (buck3 instead of buck6
> and vice versa).
>
> Cc: <stable@xxxxxxxxxxxxxxx>
> Fixes: f18792714608 ("regulator: Add support for S2MPA01 regulator")
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@xxxxxxxxxxx>
> ---
> drivers/regulator/s2mpa01.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/regulator/s2mpa01.c b/drivers/regulator/s2mpa01.c
> index f19a30f0fb42..67a5ab335dae 100644
> --- a/drivers/regulator/s2mpa01.c
> +++ b/drivers/regulator/s2mpa01.c
> @@ -137,17 +137,16 @@ static int s2mpa01_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
> enable_shift = S2MPA01_BUCK3_RAMP_EN_SHIFT;
> if (!ramp_delay) {
> ramp_enable = 0;
> break;
> }
>
> s2mpa01->ramp_delay3 = ramp_delay;
> ramp_shift = S2MPA01_BUCK3_RAMP_SHIFT;
> - ramp_reg = S2MPA01_REG_RAMP1;
> break;
> case S2MPA01_BUCK4:
> enable_shift = S2MPA01_BUCK4_RAMP_EN_SHIFT;
> if (!ramp_delay) {
> ramp_enable = 0;
> break;
> }
>
> @@ -165,16 +164,17 @@ static int s2mpa01_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
> break;
> case S2MPA01_BUCK6:
> if (ramp_delay > s2mpa01->ramp_delay16)
> s2mpa01->ramp_delay16 = ramp_delay;
> else
> ramp_delay = s2mpa01->ramp_delay16;
>
> ramp_shift = S2MPA01_BUCK16_RAMP_SHIFT;
> + ramp_reg = S2MPA01_REG_RAMP1;
> break;
> case S2MPA01_BUCK7:
> s2mpa01->ramp_delay7 = ramp_delay;
> ramp_shift = S2MPA01_BUCK7_RAMP_SHIFT;
> break;
> case S2MPA01_BUCK8:
> case S2MPA01_BUCK9:
> case S2MPA01_BUCK10:

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