diff options
author | Shantanu Jain <shjain@codeaurora.org> | 2013-11-01 12:56:13 +0530 |
---|---|---|
committer | Abinaya P <abinayap@codeaurora.org> | 2016-09-22 16:38:00 +0530 |
commit | 3f4d270af7568ad52a07f7c5c1a912830358089c (patch) | |
tree | f4765bdfc28d3743b47496e60aaf47bc84e4c8f6 /drivers/input | |
parent | db3a2341f0cdd57322832fec8bc27840c984bdcd (diff) |
input: touchscreen: Replace kernel thread with a workqueue
Replace the firmware update kernel thread with a workqueue.
Now the firmware upgrade procedure can be called later in
future time without blocking the registration of the
touchscreen driver. Using a kernel thread is an overhead in
the current driver as it is a one shot thread.
Change-Id: I0d4731148351652092fe7feede0b44828939d98b
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/gt9xx/gt9xx.h | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/gt9xx/gt9xx_update.c | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/drivers/input/touchscreen/gt9xx/gt9xx.h b/drivers/input/touchscreen/gt9xx/gt9xx.h index 8f73199dc801..56e561ab3925 100644 --- a/drivers/input/touchscreen/gt9xx/gt9xx.h +++ b/drivers/input/touchscreen/gt9xx/gt9xx.h @@ -78,7 +78,7 @@ struct goodix_ts_data { struct hrtimer timer; struct workqueue_struct *goodix_wq; struct work_struct work; - char fw_name[GTP_FW_NAME_MAXSIZE]; + struct delayed_work goodix_update_work; s32 irq_is_disabled; s32 use_irq; u16 abs_x_max; diff --git a/drivers/input/touchscreen/gt9xx/gt9xx_update.c b/drivers/input/touchscreen/gt9xx/gt9xx_update.c index 9e15846c6363..c991bfd3ffdf 100644 --- a/drivers/input/touchscreen/gt9xx/gt9xx_update.c +++ b/drivers/input/touchscreen/gt9xx/gt9xx_update.c @@ -31,7 +31,6 @@ * 2. support firmware header array update. * By Meta, 2013/03/11 */ -#include <linux/kthread.h> #include "gt9xx.h" #if GTP_HEADER_FW_UPDATE @@ -1723,17 +1722,20 @@ file_fail: return FAIL; } +static void gup_update_work(struct work_struct *work) +{ + if (gup_update_proc(NULL) == FAIL) + pr_err("Goodix update work fail\n"); +} + #if GTP_AUTO_UPDATE u8 gup_init_update_proc(struct goodix_ts_data *ts) { - struct task_struct *thread = NULL; + dev_dbg(&ts->client->dev, "Ready to run update work\n"); - pr_info("Ready to run update thread.\n"); - thread = kthread_run(gup_update_proc, (void *)NULL, "guitar_update"); - if (IS_ERR(thread)) { - pr_err("Failed to create update thread.\n"); - return -EINVAL; - } + INIT_DELAYED_WORK(&ts->goodix_update_work, gup_update_work); + schedule_delayed_work(&ts->goodix_update_work, + msecs_to_jiffies(3000)); return 0; } |