MMI: Add DC psy notifier

The tree modules(p938x, smbcharger-mmi, qpnp-smb5) work
togegher to handle the logic of wireless charging.
In smbcharger-mmi, MMI_HB_VOLTER will hold dc suspend until
heartbeat work detect DC present,
In qpnp-smb5, dcin-plugin irq handle DC present status.
they are all triggered asynchronously in parallel,
and the DC present is always active after p938x VOUT_ON has been set
for a while.
And yet, at this point, smbcharger-mmi's heartbeat work has been
triggered by wireless psy change when p938x is VOUT_ON.
This leads to MMI_HB_VOLTER hold dc suspend in a minute to wait
heartbeat schedule again by itself

Change-Id: Idc8b62fa47975daeba3f0875d7715771fa8141a8
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1479568
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
xuwt2 2020-01-06 11:21:29 +08:00 • committed by Ryan Lattrel
commit 6b6a1d0b9c

View file

@ -3262,7 +3262,9 @@ static int mmi_psy_notifier_call(struct notifier_block *nb, unsigned long val,
if (psy &&
((strcmp(psy->desc->name, "usb") == 0) ||
(strcmp(psy->desc->name, "wireless") == 0))) {
(strcmp(psy->desc->name, "wireless") == 0) ||
(strcmp(psy->desc->name, "dc") == 0))) {
cancel_delayed_work(&chip->heartbeat_work);
schedule_delayed_work(&chip->heartbeat_work,
msecs_to_jiffies(0));