mmi_parallel_charger: "battery" psy update PROP_STATUS

Under the parallel charging framework, the battery status should be
determined by all charging IC status, and not only from pmic charging

Change-Id: Idc85e8b96c1ff854f42f321e8e7b7a4c5ec55f6c
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1435998
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893580
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
This commit is contained in:
xuwt2 2019-10-12 16:18:35 +08:00 • committed by Wei Xu
commit 3ecaecfa2d

View file

@ -465,8 +465,17 @@ static int batt_get_property(struct power_supply *psy,
mmi_chrg_err(chip, "Get Unknown prop %d rc = %d\n", psp, rc);
rc = 0;
val->intval = -EINVAL;
} else
} else {
val->intval = prop.intval;
if (psp == POWER_SUPPLY_PROP_STATUS &&
prop.intval == POWER_SUPPLY_STATUS_NOT_CHARGING) {
rc = power_supply_get_property(chip->extrn_psy,
psp, &prop);
if (!rc && prop.intval == POWER_SUPPLY_STATUS_CHARGING)
val->intval = prop.intval;
}
}
break;
}
return rc;