Skip to content

Commit 1d0d6df

Browse files
Pinglinuxdtor
authored andcommitted
Input: wacom - make sure touch_max is set for touch devices
Old single touch Tablet PCs do not have touch_max set at wacom_features. Since touch device at lease supports one finger, assign touch_max to 1 when touch usage is defined in its HID Descriptor and touch_max is not pre-defined. Tested-by: Jason Gerecke <[email protected]> Signed-off-by: Ping Cheng <[email protected]> Reviewed-by: Chris Bagwell <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 0b279da commit 1d0d6df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/input/tablet/wacom_sys.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
304304
struct usb_device *dev = interface_to_usbdev(intf);
305305
char limit = 0;
306306
/* result has to be defined as int for some devices */
307-
int result = 0;
307+
int result = 0, touch_max = 0;
308308
int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0;
309309
unsigned char *report;
310310

@@ -351,7 +351,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
351351
if (usage == WCM_DESKTOP) {
352352
if (finger) {
353353
features->device_type = BTN_TOOL_FINGER;
354-
354+
/* touch device at least supports one touch point */
355+
touch_max = 1;
355356
switch (features->type) {
356357
case TABLETPC2FG:
357358
features->pktlen = WACOM_PKGLEN_TPC2FG;
@@ -504,6 +505,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
504505
}
505506

506507
out:
508+
if (!features->touch_max && touch_max)
509+
features->touch_max = touch_max;
507510
result = 0;
508511
kfree(report);
509512
return result;

0 commit comments

Comments
 (0)