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 <kenny.kessler@motorola.com>
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 <cmsantos@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Kenny Kessler 2018-11-29 09:50:48 -06:00 • committed by Kenneth Kessler
commit 45d8d4f213

View file

@ -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));