Commit 384318ec authored by Ping Cheng's avatar Ping Cheng Committed by Dmitry Torokhov

Input: wacom - fix TabletPC touch bug

This patch fixed a bug that was introduced in kernel 2.6.28 for
TabletPC touch data. The wacom_parse_hid routine in wacom_sys.c
should always return 0 even when usb_control_msg got an error.
Signed-off-by: default avatarPing Cheng <pingc@wacom.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 6b9ff696
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* Copyright (c) 2000 Daniel Egger <egger@suse.de> * Copyright (c) 2000 Daniel Egger <egger@suse.de>
* Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com> * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
* Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be> * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
* Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com> * Copyright (c) 2002-2009 Ping Cheng <pingc@wacom.com>
* *
* ChangeLog: * ChangeLog:
* v0.1 (vp) - Initial release * v0.1 (vp) - Initial release
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
* v1.47 (pc) - Added support for Bamboo * v1.47 (pc) - Added support for Bamboo
* v1.48 (pc) - Added support for Bamboo1, BambooFun, and Cintiq 12WX * v1.48 (pc) - Added support for Bamboo1, BambooFun, and Cintiq 12WX
* v1.49 (pc) - Added support for USB Tablet PC (0x90, 0x93, and 0x9A) * v1.49 (pc) - Added support for USB Tablet PC (0x90, 0x93, and 0x9A)
* v1.50 (pc) - Fixed a TabletPC touch bug in 2.6.28
*/ */
/* /*
...@@ -87,7 +88,7 @@ ...@@ -87,7 +88,7 @@
/* /*
* Version Information * Version Information
*/ */
#define DRIVER_VERSION "v1.49" #define DRIVER_VERSION "v1.50"
#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
#define DRIVER_LICENSE "GPL" #define DRIVER_LICENSE "GPL"
......
...@@ -289,6 +289,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi ...@@ -289,6 +289,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
5000); /* 5 secs */ 5000); /* 5 secs */
} while (result < 0 && limit++ < 5); } while (result < 0 && limit++ < 5);
/* No need to parse the Descriptor. It isn't an error though */
if (result < 0) if (result < 0)
goto out; goto out;
...@@ -368,9 +369,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi ...@@ -368,9 +369,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
} }
} }
result = 0;
out: out:
result = 0;
kfree(report); kfree(report);
return result; return result;
} }
...@@ -425,6 +425,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -425,6 +425,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
endpoint = &intf->cur_altsetting->endpoint[0].desc; endpoint = &intf->cur_altsetting->endpoint[0].desc;
/* Initialize touch_x_max and touch_y_max in case it is not defined */
if (wacom_wac->features->type == TABLETPC) {
features->touch_x_max = 1023;
features->touch_y_max = 1023;
} else {
features->touch_x_max = 0;
features->touch_y_max = 0;
}
/* TabletPC need to retrieve the physical and logical maximum from report descriptor */ /* TabletPC need to retrieve the physical and logical maximum from report descriptor */
if (wacom_wac->features->type == TABLETPC) { if (wacom_wac->features->type == TABLETPC) {
if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment