Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <killertofu@gmail.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Ping Cheng and committed by
Dmitry Torokhov
1d0d6df0 0b279da7

+5 -2
+5 -2
drivers/input/tablet/wacom_sys.c
··· 304 304 struct usb_device *dev = interface_to_usbdev(intf); 305 305 char limit = 0; 306 306 /* result has to be defined as int for some devices */ 307 - int result = 0; 307 + int result = 0, touch_max = 0; 308 308 int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0; 309 309 unsigned char *report; 310 310 ··· 351 351 if (usage == WCM_DESKTOP) { 352 352 if (finger) { 353 353 features->device_type = BTN_TOOL_FINGER; 354 - 354 + /* touch device at least supports one touch point */ 355 + touch_max = 1; 355 356 switch (features->type) { 356 357 case TABLETPC2FG: 357 358 features->pktlen = WACOM_PKGLEN_TPC2FG; ··· 505 504 } 506 505 507 506 out: 507 + if (!features->touch_max && touch_max) 508 + features->touch_max = touch_max; 508 509 result = 0; 509 510 kfree(report); 510 511 return result;