提交 1d0d6df0 编写于 作者: P Ping Cheng 提交者: Dmitry Torokhov

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: NJason Gerecke <killertofu@gmail.com>
Signed-off-by: NPing Cheng <pingc@wacom.com>
Reviewed-by: NChris Bagwell <chris@cnpbagwell.com>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 0b279da7
...@@ -304,7 +304,7 @@ static int wacom_parse_hid(struct usb_interface *intf, ...@@ -304,7 +304,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
struct usb_device *dev = interface_to_usbdev(intf); struct usb_device *dev = interface_to_usbdev(intf);
char limit = 0; char limit = 0;
/* result has to be defined as int for some devices */ /* result has to be defined as int for some devices */
int result = 0; int result = 0, touch_max = 0;
int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0; int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0;
unsigned char *report; unsigned char *report;
...@@ -351,7 +351,8 @@ static int wacom_parse_hid(struct usb_interface *intf, ...@@ -351,7 +351,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
if (usage == WCM_DESKTOP) { if (usage == WCM_DESKTOP) {
if (finger) { if (finger) {
features->device_type = BTN_TOOL_FINGER; features->device_type = BTN_TOOL_FINGER;
/* touch device at least supports one touch point */
touch_max = 1;
switch (features->type) { switch (features->type) {
case TABLETPC2FG: case TABLETPC2FG:
features->pktlen = WACOM_PKGLEN_TPC2FG; features->pktlen = WACOM_PKGLEN_TPC2FG;
...@@ -504,6 +505,8 @@ static int wacom_parse_hid(struct usb_interface *intf, ...@@ -504,6 +505,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
} }
out: out:
if (!features->touch_max && touch_max)
features->touch_max = touch_max;
result = 0; result = 0;
kfree(report); kfree(report);
return result; return result;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册