Skip to content

Commit 71dd2fe

Browse files
AxelLinbroonie
authored andcommitted
regulator: axp20x: Fix axp20x_set_ramp_delay
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]>
1 parent f40ddaa commit 71dd2fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/regulator/axp20x-regulator.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,13 @@ static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp)
413413
int i;
414414

415415
for (i = 0; i < rate_count; i++) {
416-
if (ramp <= slew_rates[i])
417-
cfg = AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE(i);
418-
else
416+
if (ramp > slew_rates[i])
419417
break;
418+
419+
if (id == AXP20X_DCDC2)
420+
cfg = AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_RATE(i);
421+
else
422+
cfg = AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE(i);
420423
}
421424

422425
if (cfg == 0xff) {

0 commit comments

Comments
 (0)