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

Commit f3b7dfb7 authored by David Collins's avatar David Collins
Browse files

msm: rpm-regulator-smd: limit current to RPM defined maximum



Modify the rpm_vreg_get_optimum_mode() function so that it
restricts the maximum current that can be sent for the 'ma' KVP
to the limit defined by the RPM.

Change-Id: I744e656c75a5e78a81df9c283a8f14a977c4c6ee
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent 155357d0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -879,7 +879,7 @@ static unsigned int rpm_vreg_get_optimum_mode(struct regulator_dev *rdev,
		load_mA = params[RPM_REGULATOR_PARAM_CURRENT].max;

	rpm_vreg_lock(reg->rpm_vreg);
	RPM_VREG_SET_PARAM(reg, CURRENT, MICRO_TO_MILLI(load_uA));
	RPM_VREG_SET_PARAM(reg, CURRENT, load_mA);
	rpm_vreg_unlock(reg->rpm_vreg);

	return (load_uA >= reg->rpm_vreg->hpm_min_load)