From ebdae4dd886d294bf099ac8384b165e44187a84e Mon Sep 17 00:00:00 2001 From: litong Date: Wed, 5 Feb 2020 19:29:13 +0800 Subject: [PATCH] Solve I2C error in the first suspend TP: Initializing the touch PM_MODE is PM_ACTIVE when registering the notification chain, to solve I2C error in the first suspend. Change-Id: I80e6a20484cba58dd1f8a25c0b0707d0b8a95eb7 Reviewed-on: https://gerrit.mot.com/1493127 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jialei Hao Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- .../touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c index 1d7d2b018350..f7c9fda13600 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c @@ -337,6 +337,13 @@ int ts_mmi_notifiers_register(struct ts_mmi_dev *touch_cdev) goto PS_NOTIF_REGISTER_FAILED; } + /* + Because the touch pm_mode default is TS_MMI_PM_DEEPSLEEP, when the first suspend occurs, + the interrupt will not be turned off, which results in I2C error. + Need to set the initial pm_mode of the touch to PM_ACTIVE. + */ + touch_cdev->pm_mode = TS_MMI_PM_ACTIVE; + touch_cdev->panel_nb.notifier_call = ts_mmi_panel_cb; ret = register_panel_notifier(&touch_cdev->panel_nb); if (ret)