diff options
| author | Ping Cheng <pinglinux@gmail.com> | 2013-11-25 21:43:45 -0500 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-11-25 22:03:37 -0500 |
| commit | 1d0d6df02750b4a6f466768cbfbf860e24f4c8d4 (patch) | |
| tree | 5212ea26707c1914ed64bcc1311d5f863b8e3bbd /drivers/input | |
| parent | 0b279da7af779fa515b70c0f4127001cab22ea86 (diff) | |
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>
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/tablet/wacom_sys.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 8a90da11365f..3d71b608330e 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
| @@ -304,7 +304,7 @@ static int wacom_parse_hid(struct usb_interface *intf, | |||
| 304 | struct usb_device *dev = interface_to_usbdev(intf); | 304 | struct usb_device *dev = interface_to_usbdev(intf); |
| 305 | char limit = 0; | 305 | char limit = 0; |
| 306 | /* result has to be defined as int for some devices */ | 306 | /* result has to be defined as int for some devices */ |
| 307 | int result = 0; | 307 | int result = 0, touch_max = 0; |
| 308 | int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0; | 308 | int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0; |
| 309 | unsigned char *report; | 309 | unsigned char *report; |
| 310 | 310 | ||
| @@ -351,7 +351,8 @@ static int wacom_parse_hid(struct usb_interface *intf, | |||
| 351 | if (usage == WCM_DESKTOP) { | 351 | if (usage == WCM_DESKTOP) { |
| 352 | if (finger) { | 352 | if (finger) { |
| 353 | features->device_type = BTN_TOOL_FINGER; | 353 | features->device_type = BTN_TOOL_FINGER; |
| 354 | 354 | /* touch device at least supports one touch point */ | |
| 355 | touch_max = 1; | ||
| 355 | switch (features->type) { | 356 | switch (features->type) { |
| 356 | case TABLETPC2FG: | 357 | case TABLETPC2FG: |
| 357 | features->pktlen = WACOM_PKGLEN_TPC2FG; | 358 | features->pktlen = WACOM_PKGLEN_TPC2FG; |
| @@ -504,6 +505,8 @@ static int wacom_parse_hid(struct usb_interface *intf, | |||
| 504 | } | 505 | } |
| 505 | 506 | ||
| 506 | out: | 507 | out: |
| 508 | if (!features->touch_max && touch_max) | ||
| 509 | features->touch_max = touch_max; | ||
| 507 | result = 0; | 510 | result = 0; |
| 508 | kfree(report); | 511 | kfree(report); |
| 509 | return result; | 512 | return result; |
