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 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1396976
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
yanyh2 2019-08-05 14:58:03 +08:00 • committed by Yonghua Yan
commit ab22beed7e

View file

@ -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;