Skip to content

Commit

Permalink
regulator: axp20x: Fix axp20x_set_ramp_delay
Browse files Browse the repository at this point in the history
Current code set incorrect bits when set ramp_delay for AXP20X_DCDC2,
fix it.

Fixes: d29f54d ("regulator: axp20x: add support for set_ramp_delay for AXP209")
Signed-off-by: Axel Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
AxelLin authored and broonie committed Dec 25, 2019
1 parent f40ddaa commit 71dd2fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/regulator/axp20x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,13 @@ static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp)
int i;

for (i = 0; i < rate_count; i++) {
if (ramp <= slew_rates[i])
cfg = AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE(i);
else
if (ramp > slew_rates[i])
break;

if (id == AXP20X_DCDC2)
cfg = AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_RATE(i);
else
cfg = AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE(i);
}

if (cfg == 0xff) {
Expand Down

0 comments on commit 71dd2fe

Please sign in to comment.