From d8c0aed4a558ee0d955c790351aa1766eb2d93e2 Mon Sep 17 00:00:00 2001 From: haojl2 Date: Fri, 20 Jul 2018 16:31:09 +0800 Subject: [PATCH] synaptics_tcm: cancel resume work when early suspend called. If early suspend is called, no need to do resume work if resume still not finish. Change-Id: If0798a1c023bc8a0990a47779346050ac6138cdc Signed-off-by: haojl2 Reviewed-on: https://gerrit.mot.com/1213271 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- .../touchscreen/synaptics_tcm_mmi/synaptics_tcm_core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/synaptics_tcm_mmi/synaptics_tcm_core.c b/drivers/input/touchscreen/synaptics_tcm_mmi/synaptics_tcm_core.c index 37b4e2ff9282..22913c7820fd 100644 --- a/drivers/input/touchscreen/synaptics_tcm_mmi/synaptics_tcm_core.c +++ b/drivers/input/touchscreen/synaptics_tcm_mmi/synaptics_tcm_core.c @@ -3219,6 +3219,13 @@ static inline int syna_tcm_display_off(struct device *dev) return syna_tcm_suspend(dev); } +static inline int syna_tcm_display_early_off(struct device *dev) +{ + struct syna_tcm_hcd *tcm_hcd = dev_get_drvdata(dev); + cancel_work_sync(&tcm_hcd->resume_work); + return syna_tcm_early_suspend(dev); +} + static inline int syna_tcm_display_on(struct device *dev) { struct syna_tcm_hcd *tcm_hcd = dev_get_drvdata(dev); @@ -3242,7 +3249,7 @@ static int syna_tcm_fb_notifier_cb(struct notifier_block *nb, transition = evdata->data; if (action == FB_EARLY_EVENT_BLANK && *transition == FB_BLANK_POWERDOWN) - retval = syna_tcm_early_suspend(&tcm_hcd->pdev->dev); + retval = syna_tcm_display_early_off(&tcm_hcd->pdev->dev); else if (action == FB_EVENT_BLANK) { if (*transition == FB_BLANK_POWERDOWN) { retval = syna_tcm_display_off(&tcm_hcd->pdev->dev);