Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12df7345 authored by Shantanu Jain's avatar Shantanu Jain Committed by Sudhakar Manapati
Browse files

input: touchscreen: Replace Kernel thread with a workqueue



Replace the Firmware update Kernel thread with a workqueue
instead in gt9xx_update.c Goodix driver. 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, hence replaced it with a workqueue.

This patch is propagated from msm-3.18 kernel.
(commit: 80993e0befa9066acad41e189c80bbfb80d3cfb4
input: touchscreen: Replace Kernel thread with a workqueue)

Change-Id: I0d4731148351652092fe7feede0b44828939d98b
Signed-off-by: default avatarShantanu Jain <shjain@codeaurora.org>
parent 2cc6e51e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ struct goodix_ts_data {
	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;
+10 −8
Original line number Diff line number Diff line
@@ -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
@@ -1719,17 +1718,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.");

	pr_info("Ready to run update thread.");
	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;
}