30d6f80
Bugzilla: 1046238
30d6f80
Upstream-status: Queued for 3.14
30d6f80
30d6f80
From 1d0d6df02750b4a6f466768cbfbf860e24f4c8d4 Mon Sep 17 00:00:00 2001
30d6f80
From: Ping Cheng <pinglinux@gmail.com>
30d6f80
Date: Mon, 25 Nov 2013 18:43:45 -0800
30d6f80
Subject: [PATCH] Input: wacom - make sure touch_max is set for touch devices
30d6f80
30d6f80
Old single touch Tablet PCs do not have touch_max set at
30d6f80
wacom_features. Since touch device at lease supports one
30d6f80
finger, assign touch_max to 1 when touch usage is defined
30d6f80
in its HID Descriptor and touch_max is not pre-defined.
30d6f80
30d6f80
Tested-by: Jason Gerecke <killertofu@gmail.com>
30d6f80
Signed-off-by: Ping Cheng <pingc@wacom.com>
30d6f80
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
30d6f80
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
30d6f80
---
30d6f80
 drivers/input/tablet/wacom_sys.c | 7 +++++--
30d6f80
 1 file changed, 5 insertions(+), 2 deletions(-)
30d6f80
30d6f80
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
30d6f80
index 8a90da1..3d71b60 100644
30d6f80
--- a/drivers/input/tablet/wacom_sys.c
30d6f80
+++ b/drivers/input/tablet/wacom_sys.c
30d6f80
@@ -304,7 +304,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
30d6f80
 	struct usb_device *dev = interface_to_usbdev(intf);
30d6f80
 	char limit = 0;
30d6f80
 	/* result has to be defined as int for some devices */
30d6f80
-	int result = 0;
30d6f80
+	int result = 0, touch_max = 0;
30d6f80
 	int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0;
30d6f80
 	unsigned char *report;
30d6f80
 
30d6f80
@@ -351,7 +351,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
30d6f80
 				if (usage == WCM_DESKTOP) {
30d6f80
 					if (finger) {
30d6f80
 						features->device_type = BTN_TOOL_FINGER;
30d6f80
-
30d6f80
+						/* touch device at least supports one touch point */
30d6f80
+						touch_max = 1;
30d6f80
 						switch (features->type) {
30d6f80
 						case TABLETPC2FG:
30d6f80
 							features->pktlen = WACOM_PKGLEN_TPC2FG;
30d6f80
@@ -504,6 +505,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
30d6f80
 	}
30d6f80
 
30d6f80
  out:
30d6f80
+	if (!features->touch_max && touch_max)
30d6f80
+		features->touch_max = touch_max;
30d6f80
 	result = 0;
30d6f80
 	kfree(report);
30d6f80
 	return result;
30d6f80
-- 
30d6f80
1.8.4.2
30d6f80