diff options
| author | zhaoyuan <yzhao@codeaurora.org> | 2016-03-24 10:36:00 +0800 |
|---|---|---|
| committer | Abinaya P <abinayap@codeaurora.org> | 2016-08-24 16:50:27 +0530 |
| commit | b378a2f8ba08d3c529ccb7ed4b64d2b686543735 (patch) | |
| tree | a97910625c9506f8ffaa6a054425c7795f7547eb /drivers/input/touchscreen | |
| parent | a0732e6085b0b0f62444edf5b4d0e076de130d6b (diff) | |
input: synaptics: defer touch resume to workqueue for v2.6 driver
During device resume, the touch resume function is called after
display resume. Touch resume function will take about >200ms.
Defer the touch resume function to a workqueue to reduce the total
device resume time. An optional DT property is added to enable this
on targets that need this feature.
This change has been merged. Now, touch driver was updated to V2.6,
so, merge this change to V2.6 driver.
Change-Id: Ica477f35bd4fda59eb49c9b4f5e88b460366c761
Signed-off-by: zhaoyuan <yzhao@codeaurora.org>
Diffstat (limited to 'drivers/input/touchscreen')
3 files changed, 47 insertions, 12 deletions
diff --git a/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_core.c b/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_core.c index f3e939c3686a..6e078002d087 100644 --- a/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_core.c +++ b/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_core.c @@ -122,6 +122,7 @@ static int synaptics_rmi4_reset_device(struct synaptics_rmi4_data *rmi4_data, bool rebuild); #ifdef CONFIG_FB +static void synaptics_rmi4_fb_notify_resume_work(struct work_struct *work); static int synaptics_rmi4_fb_notifier_cb(struct notifier_block *self, unsigned long event, void *data); #endif @@ -4012,6 +4013,8 @@ static int synaptics_rmi4_probe(struct platform_device *pdev) } #ifdef CONFIG_FB + INIT_WORK(&rmi4_data->fb_notify_work, + synaptics_rmi4_fb_notify_resume_work); rmi4_data->fb_notifier.notifier_call = synaptics_rmi4_fb_notifier_cb; retval = fb_register_client(&rmi4_data->fb_notifier); if (retval < 0) { @@ -4328,6 +4331,14 @@ static void synaptics_rmi4_wakeup_gesture(struct synaptics_rmi4_data *rmi4_data, } #ifdef CONFIG_FB +static void synaptics_rmi4_fb_notify_resume_work(struct work_struct *work) +{ + struct synaptics_rmi4_data *rmi4_data = + container_of(work, struct synaptics_rmi4_data, fb_notify_work); + synaptics_rmi4_resume(&(rmi4_data->input_dev->dev)); + rmi4_data->fb_ready = true; +} + static int synaptics_rmi4_fb_notifier_cb(struct notifier_block *self, unsigned long event, void *data) { @@ -4338,16 +4349,36 @@ static int synaptics_rmi4_fb_notifier_cb(struct notifier_block *self, fb_notifier); if (evdata && evdata->data && rmi4_data) { - if (event == FB_EARLY_EVENT_BLANK) { - synaptics_secure_touch_stop(rmi4_data, false); - } else if (event == FB_EVENT_BLANK) { - transition = evdata->data; - if (*transition == FB_BLANK_POWERDOWN) { - synaptics_rmi4_suspend(&rmi4_data->pdev->dev); - rmi4_data->fb_ready = false; - } else if (*transition == FB_BLANK_UNBLANK) { - synaptics_rmi4_resume(&rmi4_data->pdev->dev); - rmi4_data->fb_ready = true; + if (rmi4_data->hw_if->board_data->resume_in_workqueue) { + if (event == FB_EARLY_EVENT_BLANK) { + synaptics_secure_touch_stop(rmi4_data, false); + } else if (event == FB_EVENT_BLANK) { + transition = evdata->data; + if (*transition == FB_BLANK_POWERDOWN) { + flush_work( + &(rmi4_data->fb_notify_work)); + synaptics_rmi4_suspend( + &rmi4_data->pdev->dev); + rmi4_data->fb_ready = false; + } else if (*transition == FB_BLANK_UNBLANK) { + schedule_work( + &(rmi4_data->fb_notify_work)); + } + } + } else { + if (event == FB_EARLY_EVENT_BLANK) { + synaptics_secure_touch_stop(rmi4_data, false); + } else if (event == FB_EVENT_BLANK) { + transition = evdata->data; + if (*transition == FB_BLANK_POWERDOWN) { + synaptics_rmi4_suspend( + &rmi4_data->pdev->dev); + rmi4_data->fb_ready = false; + } else if (*transition == FB_BLANK_UNBLANK) { + synaptics_rmi4_resume( + &rmi4_data->pdev->dev); + rmi4_data->fb_ready = true; + } } } } diff --git a/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_core.h b/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_core.h index 25decbdf41d0..b860a553b334 100644 --- a/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_core.h +++ b/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_core.h @@ -5,7 +5,7 @@ * * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com> * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com> - * + * Copyright (C) 2016 The Linux Foundation. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -331,6 +331,7 @@ struct synaptics_rmi4_data { struct delayed_work rb_work; struct workqueue_struct *rb_workqueue; #ifdef CONFIG_FB + struct work_struct fb_notify_work; struct notifier_block fb_notifier; struct work_struct reset_work; struct workqueue_struct *reset_workqueue; diff --git a/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_i2c.c b/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_i2c.c index fbf90f4ae62b..f9230bfe8ea4 100644 --- a/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_i2c.c +++ b/drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_i2c.c @@ -5,7 +5,7 @@ * * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com> * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com> - * + * Copyright (C) 2016, The Linux Foundation. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -78,6 +78,9 @@ static int parse_dt(struct device *dev, struct synaptics_dsx_board_data *bdata) else bdata->irq_on_state = value; + bdata->resume_in_workqueue = of_property_read_bool(np, + "synaptics,resume-in-workqueue"); + retval = of_property_read_string(np, "synaptics,pwr-reg-name", &name); if (retval < 0) bdata->pwr_reg_name = NULL; |
