From bc2d1b90b2121402ec61d9e2f875f8585ebcc73a Mon Sep 17 00:00:00 2001 From: litong Date: Fri, 27 Mar 2020 16:43:04 +0800 Subject: [PATCH] Solve the problem of charge mode setting when power off 1. Initialize the value of the charge-mode and refresh-rate when the touchscreen resume. Change-Id: If09a10c6fad241e47b98aea8a5dd75aae78ede11 Reviewed-on: https://gerrit.mot.com/1522920 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c index f7c9fda13600..51889c177112 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c @@ -208,8 +208,12 @@ static void ts_mmi_queued_resume(struct ts_mmi_dev *touch_cdev) TRY_TO_CALL(post_resume); - touch_cdev->pm_mode = TS_MMI_PM_ACTIVE; + if (touch_cdev->pdata.usb_detection) + TRY_TO_CALL(charger_mode, (int)touch_cdev->ps_is_present); + if (touch_cdev->pdata.update_refresh_rate) + TRY_TO_CALL(refresh_rate, (int)touch_cdev->refresh_rate); + touch_cdev->pm_mode = TS_MMI_PM_ACTIVE; dev_info(DEV_MMI, "%s: done\n", __func__); }