summaryrefslogtreecommitdiff
path: root/usr/src/dkms_source_tree/wacom_sys.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@bitmath.org>2010-09-06 09:59:01 +0200
committerHenrik Rydberg <rydberg@bitmath.org>2010-09-06 09:59:01 +0200
commita9606c01f7edfc21a3fce1f10152fbf266e74d4f (patch)
treec036a72be47944e9bcffbf2ae7b40d102fe577c1 /usr/src/dkms_source_tree/wacom_sys.c
parent9c70cefed5bc44284a2cd63fc5e3b4ab3d90d0bf (diff)
Align with 2.6.37
This patch aligns wacom support with kernel 2.6.37. The tablet buttons have been remapped and the code has been prepared for adding the rest of the Bamboo family. Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
Diffstat (limited to 'usr/src/dkms_source_tree/wacom_sys.c')
-rw-r--r--usr/src/dkms_source_tree/wacom_sys.c57
1 files changed, 41 insertions, 16 deletions
diff --git a/usr/src/dkms_source_tree/wacom_sys.c b/usr/src/dkms_source_tree/wacom_sys.c
index 42ba369..fc6fd53 100644
--- a/usr/src/dkms_source_tree/wacom_sys.c
+++ b/usr/src/dkms_source_tree/wacom_sys.c
@@ -195,17 +195,30 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
195 features->pktlen = WACOM_PKGLEN_TPC2FG; 195 features->pktlen = WACOM_PKGLEN_TPC2FG;
196 features->device_type = BTN_TOOL_TRIPLETAP; 196 features->device_type = BTN_TOOL_TRIPLETAP;
197 } 197 }
198 features->x_max = 198 if (features->type == BAMBOO_PT) {
199 get_unaligned_le16(&report[i + 3]); 199 /* need to reset back */
200 features->x_phy = 200 features->pktlen = WACOM_PKGLEN_BBTOUCH;
201 get_unaligned_le16(&report[i + 6]); 201 features->device_type = BTN_TOOL_TRIPLETAP;
202 features->unit = report[i + 9]; 202 features->x_phy =
203 features->unitExpo = report[i + 11]; 203 get_unaligned_le16(&report[i + 5]);
204 i += 12; 204 features->x_max =
205 get_unaligned_le16(&report[i + 8]);
206 i += 15;
207 } else {
208 features->x_max =
209 get_unaligned_le16(&report[i + 3]);
210 features->x_phy =
211 get_unaligned_le16(&report[i + 6]);
212 features->unit = report[i + 9];
213 features->unitExpo = report[i + 11];
214 i += 12;
215 }
205 } else if (pen) { 216 } else if (pen) {
206 /* penabled only accepts exact bytes of data */ 217 /* penabled only accepts exact bytes of data */
207 if (features->type == TABLETPC2FG) 218 if (features->type == TABLETPC2FG)
208 features->pktlen = WACOM_PKGLEN_GRAPHIRE; 219 features->pktlen = WACOM_PKGLEN_GRAPHIRE;
220 if (features->type == BAMBOO_PT)
221 features->pktlen = WACOM_PKGLEN_BBFUN;
209 features->device_type = BTN_TOOL_PEN; 222 features->device_type = BTN_TOOL_PEN;
210 features->x_max = 223 features->x_max =
211 get_unaligned_le16(&report[i + 3]); 224 get_unaligned_le16(&report[i + 3]);
@@ -234,6 +247,15 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
234 features->y_phy = 247 features->y_phy =
235 get_unaligned_le16(&report[i + 6]); 248 get_unaligned_le16(&report[i + 6]);
236 i += 7; 249 i += 7;
250 } else if (features->type == BAMBOO_PT) {
251 /* need to reset back */
252 features->pktlen = WACOM_PKGLEN_BBTOUCH;
253 features->device_type = BTN_TOOL_TRIPLETAP;
254 features->y_phy =
255 get_unaligned_le16(&report[i + 3]);
256 features->y_max =
257 get_unaligned_le16(&report[i + 6]);
258 i += 12;
237 } else { 259 } else {
238 features->y_max = 260 features->y_max =
239 features->x_max; 261 features->x_max;
@@ -245,6 +267,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
245 /* penabled only accepts exact bytes of data */ 267 /* penabled only accepts exact bytes of data */
246 if (features->type == TABLETPC2FG) 268 if (features->type == TABLETPC2FG)
247 features->pktlen = WACOM_PKGLEN_GRAPHIRE; 269 features->pktlen = WACOM_PKGLEN_GRAPHIRE;
270 if (features->type == BAMBOO_PT)
271 features->pktlen = WACOM_PKGLEN_BBFUN;
248 features->device_type = BTN_TOOL_PEN; 272 features->device_type = BTN_TOOL_PEN;
249 features->y_max = 273 features->y_max =
250 get_unaligned_le16(&report[i + 3]); 274 get_unaligned_le16(&report[i + 3]);
@@ -333,11 +357,16 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
333 struct usb_host_interface *interface = intf->cur_altsetting; 357 struct usb_host_interface *interface = intf->cur_altsetting;
334 struct hid_descriptor *hid_desc; 358 struct hid_descriptor *hid_desc;
335 359
336 /* default device to penabled */ 360 /* default features */
337 features->device_type = BTN_TOOL_PEN; 361 features->device_type = BTN_TOOL_PEN;
362 features->x_fuzz = 4;
363 features->y_fuzz = 4;
364 features->pressure_fuzz = 0;
365 features->distance_fuzz = 0;
338 366
339 /* only Tablet PCs need to retrieve the info */ 367 /* only Tablet PCs need to retrieve the info */
340 if ((features->type != TABLETPC) && (features->type != TABLETPC2FG)) 368 if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) &&
369 (features->type != BAMBOO_PT))
341 goto out; 370 goto out;
342 371
343 if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { 372 if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
@@ -352,12 +381,6 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
352 if (error) 381 if (error)
353 goto out; 382 goto out;
354 383
355 /* touch device found but size is not defined. use default */
356 if (features->device_type == BTN_TOOL_DOUBLETAP && !features->x_max) {
357 features->x_max = 1023;
358 features->y_max = 1023;
359 }
360
361 out: 384 out:
362 return error; 385 return error;
363} 386}
@@ -493,9 +516,11 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
493 if (error) 516 if (error)
494 goto fail2; 517 goto fail2;
495 518
519 wacom_setup_device_quirks(features);
520
496 strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); 521 strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
497 522
498 if (features->type == TABLETPC || features->type == TABLETPC2FG) { 523 if (features->quirks & WACOM_QUIRK_MULTI_INPUT) {
499 /* Append the device type to the name */ 524 /* Append the device type to the name */
500 strlcat(wacom_wac->name, 525 strlcat(wacom_wac->name,
501 features->device_type == BTN_TOOL_PEN ? 526 features->device_type == BTN_TOOL_PEN ?