diff mbox series

[7/8,v3] Input: cyttsp - Set abs params for ABS_MT_TOUCH_MAJOR

Message ID 20210408131153.3446138-8-linus.walleij@linaro.org
State Accepted
Commit ddfe7e1ce3d5ce5ae0b25d107ba9d26fe8a4923b
Headers show
Series Update CYTTSP driver | expand

Commit Message

Linus Walleij April 8, 2021, 1:11 p.m. UTC
The driver is certainly reporting pressure in
cyttsp_report_tchdata() with
input_report_abs(input, ABS_MT_TOUCH_MAJOR, tch->z);
so we should also advertise this capability.

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, 3 insertions(+)

-- 
2.29.2

Comments

Dmitry Torokhov April 10, 2021, 7:34 a.m. UTC | #1
On Thu, Apr 08, 2021 at 03:11:52PM +0200, Linus Walleij wrote:
> The driver is certainly reporting pressure in

> cyttsp_report_tchdata() with

> input_report_abs(input, ABS_MT_TOUCH_MAJOR, tch->z);

> so we should also advertise this capability.

> 

> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org>

> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


Applied, thank you.

-- 
Dmitry
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c
index 8ae9f00e5e31..ac412bcb15d8 100644
--- a/drivers/input/touchscreen/cyttsp_core.c
+++ b/drivers/input/touchscreen/cyttsp_core.c
@@ -667,6 +667,9 @@  struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
 
 	input_set_capability(input_dev, EV_ABS, ABS_MT_POSITION_X);
 	input_set_capability(input_dev, EV_ABS, ABS_MT_POSITION_Y);
+	/* One byte for width 0..255 so this is the limit */
+	input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
+
 	touchscreen_parse_properties(input_dev, true, NULL);
 
 	error = input_mt_init_slots(input_dev, CY_MAX_ID, 0);