regulator: s2mpa01: Don't check enable_shift before setting enable ramp rate
PATCH 1/2 regulator: s2mpa01: Don't check enable_shift before setting enable ramp rate
Current code misses updating the register when enable_shift is 0. e.g. S2MPA01_BUCK4_RAMP_EN_SHIFT is 0.
--- drivers/regulator/s2mpa01.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/regulator/s2mpa01.c +5 -7
@@ -192,13 +192,11 @@ static int s2mpa01_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)if (!ramp_enable) goto ramp_disable; -if (enable_shift) { - ret =regmap_update_bits (rdev->regmap,S2MPA01_REG_RAMP1 , -1 << enable_shift,1 << enable_shift); -if (ret) { -dev_err (&rdev->dev,"failed to enable ramp rate\n" ); -return ret; - } + ret =regmap_update_bits (rdev->regmap,S2MPA01_REG_RAMP1 , +1 << enable_shift,1 << enable_shift); +if (ret) { +dev_err (&rdev->dev,"failed to enable ramp rate\n" ); +return ret; } ramp_val =get_ramp_delay (ramp_delay);
Signature · 1 line
1.8.3.2
PATCH 2/2 regulator: s2mps11: Don't check enable_shift before setting enable ramp rate
Current code misses updating the register when enable_shift is 0. e.g. S2MPS11_BUCK9_RAMP_SHIFT and S2MPS11_BUCK6_RAMP_EN_SHIFT are 0.
--- drivers/regulator/s2mps11.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/regulator/s2mps11.c +5 -7
@@ -202,13 +202,11 @@ static int s2mps11_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)if (!ramp_enable) goto ramp_disable; -if (enable_shift) { - ret =regmap_update_bits (rdev->regmap,S2MPS11_REG_RAMP , -1 << enable_shift,1 << enable_shift); -if (ret) { -dev_err (&rdev->dev,"failed to enable ramp rate\n" ); -return ret; - } + ret =regmap_update_bits (rdev->regmap,S2MPS11_REG_RAMP , +1 << enable_shift,1 << enable_shift); +if (ret) { +dev_err (&rdev->dev,"failed to enable ramp rate\n" ); +return ret; } ramp_val =get_ramp_delay (ramp_delay);
Signature · 1 line
1.8.3.2
Re: [PATCH 2/2] regulator: s2mps11: Don't check enable_shift before setting enable ramp rate
Quoted 7 lines · Axel Lin
Current code misses updating the register when
enable_shiftis 0. e.g.S2MPS11_BUCK9_RAMP_SHIFTandS2MPS11_BUCK6_RAMP_EN_SHIFTare 0.Signed-off-by Axel Lin <[email protected]>--- drivers/regulator/s2mps11.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
Looks good.
Best regards,
Krzysztof
Quoted 23 lines
drivers/regulator/s2mps11.c +5
-7@@ -202,13 +202,11 @@ static int s2mps11_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)if (!ramp_enable) goto ramp_disable; -if (enable_shift) { - ret =regmap_update_bits (rdev->regmap,S2MPS11_REG_RAMP , -1 << enable_shift,1 << enable_shift); -if (ret) { -dev_err (&rdev->dev,"failed to enable ramp rate\n" ); -return ret; - } + ret =regmap_update_bits (rdev->regmap,S2MPS11_REG_RAMP , +1 << enable_shift,1 << enable_shift); +if (ret) { +dev_err (&rdev->dev,"failed to enable ramp rate\n" ); +return ret; } ramp_val =get_ramp_delay (ramp_delay);
Re: [PATCH 2/2] regulator: s2mps11: Don't check enable_shift before setting enable ramp rate
In reply to Axel LinQuoted 2 lines · Axel Lin
Current code misses updating the register when
enable_shiftis 0. e.g.S2MPS11_BUCK9_RAMP_SHIFTandS2MPS11_BUCK6_RAMP_EN_SHIFTare 0.
Applied, thanks.
2014-03-21 16:15 GMT+08:00 Axel Lin <[email protected]>:
Quoted 2 lines
Current code misses updating the register when
enable_shiftis 0. e.g.S2MPA01_BUCK4_RAMP_EN_SHIFTis 0.
Hi Sachin and Krzysztof,
I think these 2 patches are bug fix.
Any comment on this patch serial?
Regards,
Axel
Hi Axel,
Quoted 4 lines · Axel Lin
Current code misses updating the register when
enable_shiftis 0. e.g.S2MPA01_BUCK4_RAMP_EN_SHIFTis 0.Signed-off-by Axel Lin <[email protected]>
Signature · 2 lines
With warm regards, Sachin
Quoted 2 lines · Axel Lin
Current code misses updating the register when
enable_shiftis 0. e.g.S2MPA01_BUCK4_RAMP_EN_SHIFTis 0.
Applied, thanks.