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

Commit 9d4224e1 authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

power: qpnp-qg: Update the condition to hold-SOC



Hold the SOC to 1 as long as system_soc is lesser
than 0.5% and VBAT is above cutoff. This is to avoid
pre-mature reporting of 0%.

Change-Id: I4b26edc1ac6c114b486ca4ad3e1703b296760947
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 2031377a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ int qg_adjust_sys_soc(struct qpnp_qg *chip)

	chip->sys_soc = CAP(QG_MIN_SOC, QG_MAX_SOC, chip->sys_soc);

	if (chip->sys_soc == QG_MIN_SOC) {
	if (chip->sys_soc <= 50) { /* 0.5% */
		/* Hold SOC to 1% of VBAT has not dropped below cutoff */
		rc = qg_get_battery_voltage(chip, &vbat_uv);
		if (!rc && vbat_uv >= (vcutoff_uv + VBAT_LOW_HYST_UV))