charging: avoid i2c error when system resume and suspend

delete schedule charge monitor work for avoid i2c error
when system resume and suspend

Change-Id: Ic71b8a094b34d6f68b2fffb2ab14a17c730589e6
Signed-off-by: mahj8 <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2163682
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
mahj8 2022-01-06 19:01:42 +08:00 • committed by Haijian Ma
commit ba840ade41

View file

@ -1673,6 +1673,8 @@ static void sgm4154x_vbus_remove(struct sgm4154x_device * sgm)
g_qc3p_detected = false;
qc3p_update_policy(sgm);
#endif
cancel_delayed_work_sync(&sgm->charge_monitor_work);
sgm->pulse_cnt = 0;
sgm->typec_apsd_rerun_done = false;
sgm->chg_dev->noti.apsd_done = false;
@ -1734,6 +1736,8 @@ static void sgm4154x_vbus_plugin(struct sgm4154x_device * sgm)
#endif
schedule_delayed_work(&sgm->charge_monitor_work, 0);
//notify charging policy to update charger type
sgm->chg_dev->noti.apsd_done = true;
sgm->typec_apsd_rerun_done = false;
@ -2273,8 +2277,6 @@ static int sgm4154x_suspend_notifier(struct notifier_block *nb,
case PM_SUSPEND_PREPARE:
pr_err("sgm4154x PM_SUSPEND \n");
cancel_delayed_work_sync(&sgm->charge_monitor_work);
sgm->sgm4154x_suspend_flag = 1;
return NOTIFY_OK;
@ -2282,8 +2284,6 @@ static int sgm4154x_suspend_notifier(struct notifier_block *nb,
case PM_POST_SUSPEND:
pr_err("sgm4154x PM_RESUME \n");
schedule_delayed_work(&sgm->charge_monitor_work, msecs_to_jiffies(500));
sgm->sgm4154x_suspend_flag = 0;
return NOTIFY_OK;