From 384318ecd2eb4fdbcbe7c4df6e8bb55986bf52d4 Mon Sep 17 00:00:00 2001 From: Ping Cheng Date: Tue, 28 Apr 2009 07:49:54 -0700 Subject: 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: Ping Cheng Signed-off-by: Dmitry Torokhov --- drivers/input/tablet/wacom_sys.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'drivers/input/tablet/wacom_sys.c') diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 484496daa0f3..b8624f27abf9 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -289,6 +289,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi 5000); /* 5 secs */ } while (result < 0 && limit++ < 5); + /* No need to parse the Descriptor. It isn't an error though */ if (result < 0) goto out; @@ -368,9 +369,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi } } - result = 0; - out: + result = 0; kfree(report); return result; } @@ -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; + /* 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 */ if (wacom_wac->features->type == TABLETPC) { if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { -- cgit v1.2.3-59-g8ed1b