Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 578df8ba authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

regulator: core: Return correct delay time in regulator_set_voltage_time_sel



rdev->desc->uV_step * abs(new_selector - old_selector) returns uV.
The unit of ramp_delay is mV/us.

Current code multiples 1000 at wrong place.

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 23ca6bf2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2299,7 +2299,7 @@ int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
	if (rdev->desc->ramp_delay && rdev->desc->uV_step)
		return DIV_ROUND_UP(rdev->desc->uV_step *
			abs(new_selector - old_selector),
			rdev->desc->ramp_delay) * 1000;
			rdev->desc->ramp_delay * 1000);
	return 0;
}