From ab22beed7e36ea8645e3942ab900edea99d36378 Mon Sep 17 00:00:00 2001 From: yanyh2 Date: Mon, 5 Aug 2019 14:58:03 +0800 Subject: [PATCH] power: set charge done for battery supply QG uses the battery supply charge done property for capacity learning, but qcom battery may not be in charge done state when mmi charger terminates the charging as battery is full charged. In that case, QG will not trigger the capacity learning when it completes a full charge cycle. As the FULL charge state is mantained by mmi charger, so set the charge done state once mmi charger complete charging. Change-Id: I574e6f3349949882bb38a759835cf85a67386fb5 Signed-off-by: yanyh2 Reviewed-on: https://gerrit.mot.com/1396976 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Ryan Lattrel Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c index 8c45dbce978c..ccbfbd285b81 100644 --- a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c +++ b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c @@ -3361,6 +3361,12 @@ static int batt_get_prop(struct power_supply *psy, else val->intval = chip->sm_param[BASE_BATT].batt_health; break; + case POWER_SUPPLY_PROP_CHARGE_DONE: + if (chip->last_reported_status == POWER_SUPPLY_STATUS_FULL) + val->intval = 1; + else + val->intval = 0; + break; case POWER_SUPPLY_PROP_CURRENT_MAX: val->intval = get_effective_result(chip->fcc_votable); break;