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

Commit 9e024112 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

power: qpnp-fg-gen3: Clear charge_full flag during discharging



When SOC is held @ 100% after charge termination, charge_full
flag is cleared only when the monotonic SOC drops below recharge
SOC threshold. This can cause the flag to be held for a long time
when the charger is removed. Fix this by clearing charge_full
flag when charging status had changed from FULL.

Change-Id: I35b52ddc45f314347f0e4d8433d5fb550663267c
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent d1b4c843
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1779,7 +1779,8 @@ static int fg_charge_full_update(struct fg_chip *chip)
			fg_dbg(chip, FG_STATUS, "Terminated charging @ SOC%d\n",
				msoc);
		}
	} else if (msoc_raw <= recharge_soc && chip->charge_full) {
	} else if ((msoc_raw <= recharge_soc || !chip->charge_done)
			&& chip->charge_full) {
		if (chip->dt.linearize_soc) {
			chip->delta_soc = FULL_CAPACITY - msoc;