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

Commit a428f06b authored by Zhenhua Huang's avatar Zhenhua Huang
Browse files

power: qpnp-linear-charger: update chg_done flag timely



Chg_done flag should be updated timely after battery capacity
drops below 100%, or else if charging not enabled, will show
battery FULL even if capacity less than 100%.

CRs-Fixed: 650740
Change-Id: I85b9125ece5cf56bcc534898ddcb30304ae2fe64
Signed-off-by: default avatarZhenhua Huang <zhenhuah@codeaurora.org>
parent 04f8a4e5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -875,6 +875,12 @@ static int get_prop_capacity(struct qpnp_lbc_chip *chip)
		battery_status = get_prop_batt_status(chip);
		charger_in = qpnp_lbc_is_usb_chg_plugged_in(chip);

		/* reset chg_done flag if capacity not 100% */
		if (ret.intval < 100 && chip->chg_done) {
			chip->chg_done = false;
			power_supply_changed(&chip->batt_psy);
		}

		if (battery_status != POWER_SUPPLY_STATUS_CHARGING
				&& charger_in
				&& !chip->cfg_charging_disabled