aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Bagwell <chris@cnpbagwell.com>2011-10-27 01:26:59 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-10-27 01:35:59 -0400
commit428f85884bb4a88737e5fa76535ede06a33fe162 (patch)
tree76ba008b2e1e5aedb4020dec9e76fa5c9b88d17c
parentfc72bf758f943fbc5c0d9dd14575b91996513c77 (diff)
Input: wacom - add some comments to wacom_parse_hid
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/tablet/wacom_sys.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 620f0c30a7d0..f35ed7cb10a9 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -165,7 +165,37 @@ static void wacom_close(struct input_dev *dev)
165 usb_autopm_put_interface(wacom->intf); 165 usb_autopm_put_interface(wacom->intf);
166} 166}
167 167
168static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc, 168/*
169 * Interface Descriptor of wacom devices can be incomplete and
170 * inconsistent so wacom_features table is used to store stylus
171 * device's packet lengths, various maximum values, and tablet
172 * resolution based on product ID's.
173 *
174 * For devices that contain 2 interfaces, wacom_features table is
175 * inaccurate for the touch interface. Since the Interface Descriptor
176 * for touch interfaces has pretty complete data, this function exists
177 * to query tablet for this missing information instead of hard coding in
178 * an additional table.
179 *
180 * A typical Interface Descriptor for a stylus will contain a
181 * boot mouse application collection that is not of interest and this
182 * function will ignore it.
183 *
184 * It also contains a digitizer application collection that also is not
185 * of interest since any information it contains would be duplicate
186 * of what is in wacom_features. Usually it defines a report of an array
187 * of bytes that could be used as max length of the stylus packet returned.
188 * If it happens to define a Digitizer-Stylus Physical Collection then
189 * the X and Y logical values contain valid data but it is ignored.
190 *
191 * A typical Interface Descriptor for a touch interface will contain a
192 * Digitizer-Finger Physical Collection which will define both logical
193 * X/Y maximum as well as the physical size of tablet. Since touch
194 * interfaces haven't supported pressure or distance, this is enough
195 * information to override invalid values in the wacom_features table.
196 */
197static int wacom_parse_hid(struct usb_interface *intf,
198 struct hid_descriptor *hid_desc,
169 struct wacom_features *features) 199 struct wacom_features *features)
170{ 200{
171 struct usb_device *dev = interface_to_usbdev(intf); 201 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
306 i++; 336 i++;
307 break; 337 break;
308 338
339 /*
340 * Requiring Stylus Usage will ignore boot mouse
341 * X/Y values and some cases of invalid Digitizer X/Y
342 * values commonly reported.
343 */
309 case HID_USAGE_STYLUS: 344 case HID_USAGE_STYLUS:
310 pen = 1; 345 pen = 1;
311 i++; 346 i++;