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

Commit f831210d authored by Fenglin Wu's avatar Fenglin Wu
Browse files

power: qpnp-smbcharger: Correct ibatt calculation for ESR pulse



Battey current is negative most of the time when charging, use the
absolute value for calculating the fast charge current need to be set
during ESR pulse. And also correct the value in units of uA to mA.

CRs-Fixed: 1012390
Change-Id: I97767b1f7fb9adbd90fb73c913b4c00002c2c7cc
Signed-off-by: default avatarFenglin Wu <fenglinw@codeaurora.org>
parent b2b64139
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1966,6 +1966,7 @@ static int smbchg_sw_esr_pulse_en(struct smbchg_chip *chip, bool en)
		return 0;
	}

	fg_current_now = abs(fg_current_now) / 1000;
	icl_ma = max(chip->iterm_ma + ESR_PULSE_CURRENT_DELTA_MA,
				fg_current_now - ESR_PULSE_CURRENT_DELTA_MA);
	rc = vote(chip->fcc_votable, ESR_PULSE_FCC_VOTER, en, icl_ma);