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

Commit 371c451d authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

power: qpnp-fg-gen3: Adjust recharge SOC after early termination



Currently, recharge SOC is adjusted based on the SOC at which
charge termination occurs. However, it gets reset back to the
original threshold only if input is removed. This does not work
well if charging resumes again once the battery is out of JEITA
as the recharge SOC threshold stays configured at a lower value.
Fix it by adjusting recharge SOC to the original threshold once
charging begins.

CRs-Fixed: 2163058
Change-Id: I07c714d32ba0005d3b0ff61142928eda58f049d0
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent de111ce2
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2093,8 +2093,12 @@ static int fg_adjust_recharge_soc(struct fg_chip *chip)
				return 0;
			}
		} else {
			/* Charging, do nothing */
			if (!chip->recharge_soc_adjusted)
				return 0;

			/* Restore the default value */
			new_recharge_soc = recharge_soc;
			chip->recharge_soc_adjusted = false;
		}
	} else {
		/* Restore the default value */