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

Commit 57f829c1 authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

regulator: spm-regulator: Fix the usage of the 'uV' variable



The commit 639277b6 ("regulator: spm-regulator: Add additional
settling delay for  FTS2.5 SMPS") incorrectly changed the usage
of 'uV' variable. The local 'uV' variable holds the correct voltage
level to be scaled up/down. Use it instead of vreg->uV.

CRs-Fixed: 1036738
Change-Id: I52540237a4db79c149409c6017ffc750b5abddd2
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 42b112dc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -295,14 +295,14 @@ static int spm_regulator_write_voltage(struct spm_vreg *vreg, int uV)

	if (uV > vreg->last_set_uV) {
		/* Wait for voltage stepping to complete. */
		slew_delay = DIV_ROUND_UP(vreg->uV - vreg->last_set_uV,
		slew_delay = DIV_ROUND_UP(uV - vreg->last_set_uV,
					vreg->step_rate);
		if (vreg->regulator_type == QPNP_TYPE_FTS2p5)
			slew_delay += FTS2P5_SETTLING_DELAY_US;
		udelay(slew_delay);
	} else if (vreg->regulator_type == QPNP_TYPE_FTS2p5) {
		/* add the ramp-down delay */
		slew_delay = DIV_ROUND_UP(vreg->last_set_uV - vreg->uV,
		slew_delay = DIV_ROUND_UP(vreg->last_set_uV - uV,
				vreg->step_rate) + FTS2P5_SETTLING_DELAY_US;
		udelay(slew_delay);
	}