From 9a45e2bc1a13c6a48ecdac086c0d61c98ced83ab Mon Sep 17 00:00:00 2001 From: Chris Bagwell Date: Wed, 26 Oct 2011 22:26:59 -0700 Subject: [PATCH] --- yaml --- r: 282361 b: refs/heads/master c: 428f85884bb4a88737e5fa76535ede06a33fe162 h: refs/heads/master i: 282359: b2ac07745b04bd838fc2efb2a9007126bb884bd9 v: v3 --- [refs] | 2 +- trunk/drivers/input/tablet/wacom_sys.c | 37 +++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 2ab4e0fe9d1f..bd3097d117c7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fc72bf758f943fbc5c0d9dd14575b91996513c77 +refs/heads/master: 428f85884bb4a88737e5fa76535ede06a33fe162 diff --git a/trunk/drivers/input/tablet/wacom_sys.c b/trunk/drivers/input/tablet/wacom_sys.c index 620f0c30a7d0..f35ed7cb10a9 100644 --- a/trunk/drivers/input/tablet/wacom_sys.c +++ b/trunk/drivers/input/tablet/wacom_sys.c @@ -165,7 +165,37 @@ static void wacom_close(struct input_dev *dev) usb_autopm_put_interface(wacom->intf); } -static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc, +/* + * Interface Descriptor of wacom devices can be incomplete and + * inconsistent so wacom_features table is used to store stylus + * device's packet lengths, various maximum values, and tablet + * resolution based on product ID's. + * + * For devices that contain 2 interfaces, wacom_features table is + * inaccurate for the touch interface. Since the Interface Descriptor + * for touch interfaces has pretty complete data, this function exists + * to query tablet for this missing information instead of hard coding in + * an additional table. + * + * A typical Interface Descriptor for a stylus will contain a + * boot mouse application collection that is not of interest and this + * function will ignore it. + * + * It also contains a digitizer application collection that also is not + * of interest since any information it contains would be duplicate + * of what is in wacom_features. Usually it defines a report of an array + * of bytes that could be used as max length of the stylus packet returned. + * If it happens to define a Digitizer-Stylus Physical Collection then + * the X and Y logical values contain valid data but it is ignored. + * + * A typical Interface Descriptor for a touch interface will contain a + * Digitizer-Finger Physical Collection which will define both logical + * X/Y maximum as well as the physical size of tablet. Since touch + * interfaces haven't supported pressure or distance, this is enough + * information to override invalid values in the wacom_features table. + */ +static int wacom_parse_hid(struct usb_interface *intf, + struct hid_descriptor *hid_desc, struct wacom_features *features) { struct usb_device *dev = interface_to_usbdev(intf); @@ -306,6 +336,11 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi i++; break; + /* + * Requiring Stylus Usage will ignore boot mouse + * X/Y values and some cases of invalid Digitizer X/Y + * values commonly reported. + */ case HID_USAGE_STYLUS: pen = 1; i++;