c533308
From 580549ef6b3e3fb3b958de490ca99f43a089a2cf Mon Sep 17 00:00:00 2001
c533308
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
c533308
Date: Fri, 25 Mar 2016 15:26:55 +0100
c533308
Subject: [PATCH] HID: wacom: fix Bamboo ONE oops
c533308
c533308
Looks like recent changes in the Wacom driver made the Bamboo ONE crashes.
c533308
The tablet behaves as if it was a regular Bamboo device with pen, touch
c533308
and pad, but there is no physical pad connected to it.
c533308
The weird part is that the pad is still sending events and given that
c533308
there is no input node connected to it, we get  anull pointer exception.
c533308
c533308
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1317116
c533308
c533308
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
c533308
Acked-by: Ping Cheng <pingc@wacom.com>
c533308
Cc: stable@vger.kernel.org
c533308
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
c533308
---
c533308
 drivers/hid/wacom_wac.c | 11 +++++++++++
c533308
 1 file changed, 11 insertions(+)
c533308
c533308
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
c533308
index bd198bbd4df0..02c4efea241c 100644
c533308
--- a/drivers/hid/wacom_wac.c
c533308
+++ b/drivers/hid/wacom_wac.c
c533308
@@ -2426,6 +2426,17 @@ void wacom_setup_device_quirks(struct wacom *wacom)
c533308
 	}
c533308
 
c533308
 	/*
c533308
+	 * Hack for the Bamboo One:
c533308
+	 * the device presents a PAD/Touch interface as most Bamboos and even
c533308
+	 * sends ghosts PAD data on it. However, later, we must disable this
c533308
+	 * ghost interface, and we can not detect it unless we set it here
c533308
+	 * to WACOM_DEVICETYPE_PAD or WACOM_DEVICETYPE_TOUCH.
c533308
+	 */
c533308
+	if (features->type == BAMBOO_PEN &&
c533308
+	    features->pktlen == WACOM_PKGLEN_BBTOUCH3)
c533308
+		features->device_type |= WACOM_DEVICETYPE_PAD;
c533308
+
c533308
+	/*
c533308
 	 * Raw Wacom-mode pen and touch events both come from interface
c533308
 	 * 0, whose HID descriptor has an application usage of 0xFF0D
c533308
 	 * (i.e., WACOM_VENDORDEFINED_PEN). We route pen packets back
c533308
-- 
c533308
2.5.5
c533308