summarylogtreecommitdiffstats
path: root/touchscreen_multitouch_fixes2.patch
blob: 6aa189cd81f91ed194c5048bc9c90a9ede3789c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From a84d692a5e0f894d7e9c81208197423d023f50d9 Mon Sep 17 00:00:00 2001
From: Daniel Martin <consume.noise@gmail.com>
Date: Fri, 2 Oct 2015 10:05:29 +0200
Subject: [PATCH 1/4] HID: multitouch: Ignore invalid reports

Drop reports with invalid values.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
---
 drivers/hid/hid-multitouch.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 7c81125..1cc1108 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -559,6 +559,10 @@ static void mt_complete_slot(struct mt_device *td, struct input_dev *input)
 	    td->num_received >= td->num_expected)
 		return;
 
+	if (td->curdata.x == 0xffff && td->curdata.x == td->curdata.y &&
+	    td->curdata.w == 0xffff && td->curdata.w == td->curdata.h)
+		goto inc_num_received;
+
 	if (td->curvalid || (td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID)) {
 		int slotnum = mt_compute_slot(td, input);
 		struct mt_slot *s = &td->curdata;
@@ -597,6 +601,7 @@ static void mt_complete_slot(struct mt_device *td, struct input_dev *input)
 		}
 	}
 
+inc_num_received:
 	td->num_received++;
 }
 
-- 
2.1.4