64 lines
2.0 KiB
Diff
64 lines
2.0 KiB
Diff
From: Chris Bagwell <chris@cnpbagwell.com>
|
|
Date: Mon, 7 Nov 2011 19:52:42 -0800
|
|
Subject: Input: wacom - ignore unwanted bamboo packets
|
|
|
|
commit 5a6c865d9861efdd066db1b5da491ebc2ff5926d upstream.
|
|
|
|
Bamboo's Pen and Touch packets always start with a value
|
|
of 0x02 in first byte. In 3rd gen Bamboo's, the hw is now
|
|
periodically sending some additional packets with unrelated data
|
|
and uses a value other than 0x02 to inform driver this.
|
|
|
|
Ignore those packets now.
|
|
|
|
This was reported by users as bad behavior in Gimp. The
|
|
invalid packets being processed made the stylus report
|
|
out of proximity for the 1 packet and this triggered some
|
|
secondary bug which caused Gimp to stop drawing until
|
|
user really took pen out of proximity of tablet.
|
|
|
|
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
|
|
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
|
|
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
|
|
---
|
|
drivers/input/tablet/wacom_wac.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
|
|
index c456ab04efcf..551f3a3156dc 100644
|
|
--- a/drivers/input/tablet/wacom_wac.c
|
|
+++ b/drivers/input/tablet/wacom_wac.c
|
|
@@ -799,6 +799,9 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
|
|
unsigned char *data = wacom->data;
|
|
int i;
|
|
|
|
+ if (data[0] != 0x02)
|
|
+ return 0;
|
|
+
|
|
for (i = 0; i < 2; i++) {
|
|
int offset = (data[1] & 0x80) ? (8 * i) : (9 * i);
|
|
bool touch = data[offset + 3] & 0x80;
|
|
@@ -876,6 +879,9 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom)
|
|
int count = data[1] & 0x03;
|
|
int i;
|
|
|
|
+ if (data[0] != 0x02)
|
|
+ return 0;
|
|
+
|
|
/* data has up to 7 fixed sized 8-byte messages starting at data[2] */
|
|
for (i = 0; i < count; i++) {
|
|
int offset = (8 * i) + 2;
|
|
@@ -901,6 +907,9 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
|
|
unsigned char *data = wacom->data;
|
|
int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
|
|
|
|
+ if (data[0] != 0x02)
|
|
+ return 0;
|
|
+
|
|
prox = (data[1] & 0x20) == 0x20;
|
|
|
|
/*
|
|
--
|
|
1.7.10.1
|
|
|