From c5fa7ae640ffd264f709e5eff62b28acddb4c028 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Tue, 17 Sep 2019 16:11:52 +0100 Subject: [PATCH 1/4] Fix poll rate on touchscreen Was running at 25Hz, rather than he expected 60. Only been doing it for the last 5 years.... Replace msleep_interruptible with usleep_range as the msleep call is not accurate for times < 20ms. Signed-off-by: James Hughes --- drivers/input/touchscreen/rpi-ft5406.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/rpi-ft5406.c b/drivers/input/touchscreen/rpi-ft5406.c index 4115b466621166..57148d5f6e658a 100644 --- a/drivers/input/touchscreen/rpi-ft5406.c +++ b/drivers/input/touchscreen/rpi-ft5406.c @@ -78,12 +78,12 @@ static int ft5406_thread(void *arg) while (!kthread_should_stop()) { /* 60fps polling */ - msleep_interruptible(17); + usleep_range(16600,16700); + memcpy_fromio(®s, ts->ts_base, sizeof(struct ft5406_regs)); iowrite8(99, ts->ts_base + offsetof(struct ft5406_regs, num_points)); - /* * Do not output if theres no new information (num_points is 99) * or we have no touch points and don't need to release any From 5b53e601249645f7a5ae987553482254408b77a9 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Sep 2019 16:19:35 +0100 Subject: [PATCH 2/4] Restore deleted blank line --- drivers/input/touchscreen/rpi-ft5406.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/touchscreen/rpi-ft5406.c b/drivers/input/touchscreen/rpi-ft5406.c index 57148d5f6e658a..8efeb0412370e5 100644 --- a/drivers/input/touchscreen/rpi-ft5406.c +++ b/drivers/input/touchscreen/rpi-ft5406.c @@ -84,6 +84,7 @@ static int ft5406_thread(void *arg) iowrite8(99, ts->ts_base + offsetof(struct ft5406_regs, num_points)); + /* * Do not output if theres no new information (num_points is 99) * or we have no touch points and don't need to release any From 5aa60c5ed5648a2c23635b040c3421713c04a758 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Sep 2019 16:20:18 +0100 Subject: [PATCH 3/4] Deleted added blank line --- drivers/input/touchscreen/rpi-ft5406.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/rpi-ft5406.c b/drivers/input/touchscreen/rpi-ft5406.c index 8efeb0412370e5..ea65fe5e71c6f1 100644 --- a/drivers/input/touchscreen/rpi-ft5406.c +++ b/drivers/input/touchscreen/rpi-ft5406.c @@ -79,7 +79,6 @@ static int ft5406_thread(void *arg) while (!kthread_should_stop()) { /* 60fps polling */ usleep_range(16600,16700); - memcpy_fromio(®s, ts->ts_base, sizeof(struct ft5406_regs)); iowrite8(99, ts->ts_base + From 1b091f67c61c3ca7351dcea67f11af6faf3e2b6e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Sep 2019 16:20:58 +0100 Subject: [PATCH 4/4] Space required after a comma --- drivers/input/touchscreen/rpi-ft5406.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/rpi-ft5406.c b/drivers/input/touchscreen/rpi-ft5406.c index ea65fe5e71c6f1..719ab0154a9639 100644 --- a/drivers/input/touchscreen/rpi-ft5406.c +++ b/drivers/input/touchscreen/rpi-ft5406.c @@ -78,7 +78,7 @@ static int ft5406_thread(void *arg) while (!kthread_should_stop()) { /* 60fps polling */ - usleep_range(16600,16700); + usleep_range(16600, 16700); memcpy_fromio(®s, ts->ts_base, sizeof(struct ft5406_regs)); iowrite8(99, ts->ts_base +