send charge rate uevent when power supply changes

Send charge rate uevent if power supply changes in case the
charge rate change uevent is missing by BatteryServices before
it starts up.

Change-Id: I4343454c54e30df1cbbc512d473b9061b10cbd84
Signed-off-by: yanyh2 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1964225
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:
yanyh2 2021-05-28 21:21:41 +08:00 • committed by Yonghua Yan
commit 6bdd0e5bb6

View file

@ -2032,6 +2032,12 @@ static int mmi_psy_notifier_call(struct notifier_block *nb, unsigned long val,
msecs_to_jiffies(0));
}
if (chip->batt_psy && chip->batt_uenvp[0]) {
kobject_uevent_env(&chip->batt_psy->dev.kobj,
KOBJ_CHANGE,
chip->batt_uenvp);
}
return NOTIFY_OK;
}