If both touch events and release are part of the same report,
userspace will not consider it as a touch-down & touch-up but as
a non-action. That can happen on resume when 'buffered' events are
dequeued in a row.
Make sure that release always causes previous events to be synced
before being reported.
Signed-off-by: Loic Poulain <redacted>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 807f449..e05ec30 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -990,6 +990,13 @@ static void mxt_proc_t100_message(struct mxt_data *data, u8 *message)
input_report_abs(input_dev, ABS_MT_DISTANCE, distance);
input_report_abs(input_dev, ABS_MT_ORIENTATION, orientation);
} else {
+ /*
+ * Always sync input before reporting release, to be sure
+ * previous event(s) are taking into account by user side.
+ */
+ if (data->update_input)
+ mxt_input_sync(data);
+
dev_dbg(dev, "[%u] release\n", id);
/* close out slot */--
2.7.4