From 45d8d4f213690e2b5195e1a0a82e2e3eca49e637 Mon Sep 17 00:00:00 2001 From: Kenny Kessler Date: Thu, 29 Nov 2018 09:50:48 -0600 Subject: [PATCH] power: qpnp-smbcharger-mmi: Allow Wake on Charger The previous commit stopped outright setting of the wake alarm. Without that alarm, because no wake source is held with charger present, it could be possible to sleep while charging for a period that exceeds 60-70 secs. To fix this ensure that the alarm is set if charger is present. Change-Id: I50cd409694cb51452c5ca902f64a5b62b94475ca Signed-off-by: Kenny Kessler Reviewed-on: https://gerrit.mot.com/1275889 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Cesar Augusto Marcelino dos Santos Reviewed-by: Kenneth Kessler Submit-Approved: Jira Key --- drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c index b09545fe28f5..98d863690a65 100755 --- a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c +++ b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c @@ -2289,7 +2289,7 @@ static void mmi_heartbeat_work(struct work_struct *work) sch_hb: schedule_delayed_work(&chip->heartbeat_work, msecs_to_jiffies(hb_resch_time)); - if (suspend_wakeups) + if (suspend_wakeups || chg_stat.charger_present) alarm_start_relative(&chip->heartbeat_alarm, ns_to_ktime(SMBCHG_HEARTBEAT_INTRVAL_NS));