Input: atmel_mxt_ts - don't report zero pressure from T9
authorNick Dyer <nick.dyer@itdev.co.uk>
Fri, 27 Jul 2018 18:49:10 +0000 (11:49 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 27 Jul 2018 18:59:33 +0000 (11:59 -0700)
If T9.CTRL DISAMP is set, then pressure is reported as zero. This means
some app layers (eg tslib) will ignore the contact.

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/atmel_mxt_ts.c

index 77387f896262cb0d246ea7d6e314141528a76fe8..e32667d82d0f374735eb38178a2a14a8768675b1 100644 (file)
@@ -843,6 +843,10 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message)
                        mxt_input_sync(data);
                }
 
+               /* if active, pressure must be non-zero */
+               if (!amplitude)
+                       amplitude = MXT_PRESSURE_DEFAULT;
+
                /* Touch active */
                input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, 1);
                input_report_abs(input_dev, ABS_MT_POSITION_X, x);