From ee308c6c73bc2e8890516b38608f8ef1900f5bf7 Mon Sep 17 00:00:00 2001 From: haojl2 Date: Tue, 28 Apr 2020 14:53:50 +0800 Subject: [PATCH] touchscreen_mmi: Only update refresh & charger when active When IC not resume, LCD refresh and charger mode no need set to IC. Just save the value and the value will restore in IC resume work. Change-Id: Icadcb7883c6347ae65c5ebaafac39d138cbac5e4 Signed-off-by: haojl2 Reviewed-on: https://gerrit.mot.com/1543990 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- .../touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c index dbd172a6ccc4..93936710efc1 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c @@ -271,7 +271,8 @@ static int ts_mmi_refresh_rate_cb(struct notifier_block *nb, if (!touch_cdev->refresh_rate || (touch_cdev->refresh_rate != (refresh_rate & 0xFF))) { touch_cdev->refresh_rate = refresh_rate & 0xFF; - do_calibration = true; + if (is_touch_active) + do_calibration = true; } if (do_calibration) { @@ -320,8 +321,10 @@ static int ts_mmi_charger_cb(struct notifier_block *self, if (touch_cdev->ps_is_present != present) { touch_cdev->ps_is_present = present; - kfifo_put(&touch_cdev->cmd_pipe, TS_MMI_DO_PS); - schedule_delayed_work(&touch_cdev->work, 0); + if (is_touch_active) { + kfifo_put(&touch_cdev->cmd_pipe, TS_MMI_DO_PS); + schedule_delayed_work(&touch_cdev->work, 0); + } } return 0;