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 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1213271
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
haojl2 2018-07-20 16:31:09 +08:00 • committed by Jialei Hao
commit d8c0aed4a5

View file

@ -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);