Trigger battery current read on demand

Schedule the heartbeat work to update the battery properties
if read current_now.

Change-Id: I47cdd15911219ce8af268a23acefd4980c081b45
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2316770
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Yonghua Yan 2022-06-29 11:48:35 +08:00
commit fc575f57fc

View file

@ -2564,6 +2564,12 @@ static int mmi_get_prop(struct power_supply *psy,
struct mmi_charger_chip *chip = power_supply_get_drvdata(psy);
int rc = 0;
if (psp == POWER_SUPPLY_PROP_CURRENT_NOW) {
cancel_delayed_work(&chip->heartbeat_work);
schedule_delayed_work(&chip->heartbeat_work,
msecs_to_jiffies(0));
}
switch (psp) {
case POWER_SUPPLY_PROP_STATUS:
val->intval = chip->combo_status;