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

Commit db1d853d authored by Fenglin Wu's avatar Fenglin Wu Committed by Vamshi Krishna B V
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>
Signed-off-by: default avatarVamshi Krishna B V <vbv@codeaurora.org>
parent 82861b19
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1904,6 +1904,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);