synaptics_tcm: resume TP in workqueue

Change-Id: I90ca3808a01dab77d8bf78561df92b3243583611
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1208807
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
haojl2 2018-07-12 18:37:55 +08:00 • committed by Jialei Hao
commit 5a93d307cd
2 changed files with 26 additions and 2 deletions

View file

@ -3000,6 +3000,28 @@ static int syna_tcm_early_suspend(struct device *dev)
return 0;
}
static void syna_tcm_queued_resume(struct work_struct *w)
{
struct syna_tcm_hcd *tcm_hcd =
container_of(w, struct syna_tcm_hcd, resume_work);
syna_tcm_resume(&(tcm_hcd->pdev->dev));
}
static inline int syna_tcm_display_off(struct device *dev)
{
struct syna_tcm_hcd *tcm_hcd = dev_get_drvdata(dev);
cancel_work_sync(&tcm_hcd->resume_work);
return syna_tcm_suspend(dev);
}
static inline int syna_tcm_display_on(struct device *dev)
{
struct syna_tcm_hcd *tcm_hcd = dev_get_drvdata(dev);
pr_debug("queue resume\n");
queue_work(system_wq, &tcm_hcd->resume_work);
return 0;
}
static int syna_tcm_fb_notifier_cb(struct notifier_block *nb,
unsigned long action, void *data)
{
@ -3018,10 +3040,10 @@ static int syna_tcm_fb_notifier_cb(struct notifier_block *nb,
retval = syna_tcm_early_suspend(&tcm_hcd->pdev->dev);
else if (action == FB_EVENT_BLANK) {
if (*transition == FB_BLANK_POWERDOWN) {
retval = syna_tcm_suspend(&tcm_hcd->pdev->dev);
retval = syna_tcm_display_off(&tcm_hcd->pdev->dev);
tcm_hcd->fb_ready = 0;
} else if (*transition == FB_BLANK_UNBLANK) {
retval = syna_tcm_resume(&tcm_hcd->pdev->dev);
retval = syna_tcm_display_on(&tcm_hcd->pdev->dev);
tcm_hcd->fb_ready++;
}
}
@ -3197,6 +3219,7 @@ static int syna_tcm_probe(struct platform_device *pdev)
}
}
INIT_WORK(&tcm_hcd->resume_work, syna_tcm_queued_resume);
#ifdef CONFIG_FB
tcm_hcd->fb_notifier.notifier_call = syna_tcm_fb_notifier_cb;
retval = fb_register_client(&tcm_hcd->fb_notifier);

View file

@ -413,6 +413,7 @@ struct syna_tcm_hcd {
struct mutex identify_mutex;
struct delayed_work polling_work;
struct workqueue_struct *polling_workqueue;
struct work_struct resume_work;
struct task_struct *notifier_thread;
#ifdef CONFIG_FB
struct notifier_block fb_notifier;