sgm4154x_charger_lite:get charge counter from flip fg

get charge counter value from flip fg and assign this value
to batt_chg_counter of battery info struct.

Change-Id: I4356f928217dc2806fc722d2e8d9e7ff1da755d6
Reviewed-on: https://gerrit.mot.com/2300250
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Gong Shicheng 2022-06-14 17:18:01 +08:00 • committed by Shicheng Gong
commit e70961e21b

View file

@ -2033,6 +2033,9 @@ static int sgm4154x_charger_get_batt_info(void *data, struct mmi_battery_info *b
rc = power_supply_get_property(chg->fg_psy, POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, &val);
if (!rc)
chg->batt_info.batt_design_uah = val.intval;
rc = power_supply_get_property(chg->fg_psy, POWER_SUPPLY_PROP_CHARGE_COUNTER, &val);
if (!rc)
chg->batt_info.batt_chg_counter = val.intval;
if (chg->chg_cfg.full_charged)
chg->batt_info.batt_status = POWER_SUPPLY_STATUS_FULL;