diff mbox series

[8/8,v3] Input: cyttsp - Flag the device properly

Message ID 20210408131153.3446138-9-linus.walleij@linaro.org (mailing list archive)
State Accepted
Commit dadf1fd8807e61b1b1744836c96f48eb9ad56f5b
Headers show
Series Update CYTTSP driver | expand

Commit Message

Linus Walleij April 8, 2021, 1:11 p.m. UTC
This device is certainly a very simple touchscreen so
we set INPUT_MT_DIRECT.

The sibling driver for CY8CTMA140 also sets
INPUT_MT_DROP_UNUSED and experimenting with this driver
it clearly does not hurt: the touchscreen is working just
fine so let's set it for this one as well.

Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v3:
- Collect Javier's Reviewed-by.
---
 drivers/input/touchscreen/cyttsp_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Dmitry Torokhov April 10, 2021, 7:41 a.m. UTC | #1
Hi Linus,

On Thu, Apr 08, 2021 at 03:11:53PM +0200, Linus Walleij wrote:
> This device is certainly a very simple touchscreen so
> we set INPUT_MT_DIRECT.
> 
> The sibling driver for CY8CTMA140 also sets
> INPUT_MT_DROP_UNUSED and experimenting with this driver
> it clearly does not hurt: the touchscreen is working just
> fine so let's set it for this one as well.

This is not a good justification, and INPUT_MT_DROP_UNUSED is
essentially a noop if the driver does not use input_mt_sync_frame().

I dropped INPUT_MT_DROP_UNUSED from the patch and applied, but I would
appreciate a followup patch switching the driver to INPUT_MT_DROP_UNUSED
and adding input_mt_sync_frame() to cyttsp_report_tchdata() and removing
manual release of inactive slots from there (the "used" bitmap).

Thanks.
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c
index ac412bcb15d8..fb71cd0d2070 100644
--- a/drivers/input/touchscreen/cyttsp_core.c
+++ b/drivers/input/touchscreen/cyttsp_core.c
@@ -672,7 +672,8 @@  struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
 
 	touchscreen_parse_properties(input_dev, true, NULL);
 
-	error = input_mt_init_slots(input_dev, CY_MAX_ID, 0);
+	error = input_mt_init_slots(input_dev, CY_MAX_ID,
+				    INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
 	if (error) {
 		dev_err(dev, "Unable to init MT slots.\n");
 		return ERR_PTR(error);