diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-12-17 01:04:14 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-12-17 01:04:14 -0500 |
commit | 022573c275500e1a50889949f679d04b5446edf6 (patch) | |
tree | 766ab0e13fc38275466f8544d1bbf4982833cbff /drivers/input/tablet | |
parent | 516d798f656614f59553b1ff3592c2c36102b684 (diff) | |
parent | a455e2985f57e2a71566bb8850094af38b2c932d (diff) |
Merge branch 'next' into for-linus
Prepare first set of updates for 3.8 merge window.
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 58 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 29 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.h | 2 |
3 files changed, 68 insertions, 21 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 858ad446de91..f92d34f45a1c 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -386,23 +386,40 @@ static int wacom_parse_hid(struct usb_interface *intf, | |||
386 | if (usage == WCM_DESKTOP) { | 386 | if (usage == WCM_DESKTOP) { |
387 | if (finger) { | 387 | if (finger) { |
388 | features->device_type = BTN_TOOL_FINGER; | 388 | features->device_type = BTN_TOOL_FINGER; |
389 | if (features->type == TABLETPC2FG) { | 389 | |
390 | /* need to reset back */ | 390 | switch (features->type) { |
391 | case TABLETPC2FG: | ||
391 | features->pktlen = WACOM_PKGLEN_TPC2FG; | 392 | features->pktlen = WACOM_PKGLEN_TPC2FG; |
392 | } | 393 | break; |
393 | 394 | ||
394 | if (features->type == MTSCREEN || features->type == WACOM_24HDT) | 395 | case MTSCREEN: |
396 | case WACOM_24HDT: | ||
395 | features->pktlen = WACOM_PKGLEN_MTOUCH; | 397 | features->pktlen = WACOM_PKGLEN_MTOUCH; |
398 | break; | ||
396 | 399 | ||
397 | if (features->type == BAMBOO_PT) { | 400 | case MTTPC: |
398 | /* need to reset back */ | 401 | features->pktlen = WACOM_PKGLEN_MTTPC; |
402 | break; | ||
403 | |||
404 | case BAMBOO_PT: | ||
399 | features->pktlen = WACOM_PKGLEN_BBTOUCH; | 405 | features->pktlen = WACOM_PKGLEN_BBTOUCH; |
406 | break; | ||
407 | |||
408 | default: | ||
409 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; | ||
410 | break; | ||
411 | } | ||
412 | |||
413 | switch (features->type) { | ||
414 | case BAMBOO_PT: | ||
400 | features->x_phy = | 415 | features->x_phy = |
401 | get_unaligned_le16(&report[i + 5]); | 416 | get_unaligned_le16(&report[i + 5]); |
402 | features->x_max = | 417 | features->x_max = |
403 | get_unaligned_le16(&report[i + 8]); | 418 | get_unaligned_le16(&report[i + 8]); |
404 | i += 15; | 419 | i += 15; |
405 | } else if (features->type == WACOM_24HDT) { | 420 | break; |
421 | |||
422 | case WACOM_24HDT: | ||
406 | features->x_max = | 423 | features->x_max = |
407 | get_unaligned_le16(&report[i + 3]); | 424 | get_unaligned_le16(&report[i + 3]); |
408 | features->x_phy = | 425 | features->x_phy = |
@@ -410,7 +427,9 @@ static int wacom_parse_hid(struct usb_interface *intf, | |||
410 | features->unit = report[i - 1]; | 427 | features->unit = report[i - 1]; |
411 | features->unitExpo = report[i - 3]; | 428 | features->unitExpo = report[i - 3]; |
412 | i += 12; | 429 | i += 12; |
413 | } else { | 430 | break; |
431 | |||
432 | default: | ||
414 | features->x_max = | 433 | features->x_max = |
415 | get_unaligned_le16(&report[i + 3]); | 434 | get_unaligned_le16(&report[i + 3]); |
416 | features->x_phy = | 435 | features->x_phy = |
@@ -418,10 +437,11 @@ static int wacom_parse_hid(struct usb_interface *intf, | |||
418 | features->unit = report[i + 9]; | 437 | features->unit = report[i + 9]; |
419 | features->unitExpo = report[i + 11]; | 438 | features->unitExpo = report[i + 11]; |
420 | i += 12; | 439 | i += 12; |
440 | break; | ||
421 | } | 441 | } |
422 | } else if (pen) { | 442 | } else if (pen) { |
423 | /* penabled only accepts exact bytes of data */ | 443 | /* penabled only accepts exact bytes of data */ |
424 | if (features->type == TABLETPC2FG) | 444 | if (features->type >= TABLETPC) |
425 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; | 445 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; |
426 | features->device_type = BTN_TOOL_PEN; | 446 | features->device_type = BTN_TOOL_PEN; |
427 | features->x_max = | 447 | features->x_max = |
@@ -434,32 +454,40 @@ static int wacom_parse_hid(struct usb_interface *intf, | |||
434 | case HID_USAGE_Y: | 454 | case HID_USAGE_Y: |
435 | if (usage == WCM_DESKTOP) { | 455 | if (usage == WCM_DESKTOP) { |
436 | if (finger) { | 456 | if (finger) { |
437 | int type = features->type; | 457 | switch (features->type) { |
438 | 458 | case TABLETPC2FG: | |
439 | if (type == TABLETPC2FG || type == MTSCREEN) { | 459 | case MTSCREEN: |
460 | case MTTPC: | ||
440 | features->y_max = | 461 | features->y_max = |
441 | get_unaligned_le16(&report[i + 3]); | 462 | get_unaligned_le16(&report[i + 3]); |
442 | features->y_phy = | 463 | features->y_phy = |
443 | get_unaligned_le16(&report[i + 6]); | 464 | get_unaligned_le16(&report[i + 6]); |
444 | i += 7; | 465 | i += 7; |
445 | } else if (type == WACOM_24HDT) { | 466 | break; |
467 | |||
468 | case WACOM_24HDT: | ||
446 | features->y_max = | 469 | features->y_max = |
447 | get_unaligned_le16(&report[i + 3]); | 470 | get_unaligned_le16(&report[i + 3]); |
448 | features->y_phy = | 471 | features->y_phy = |
449 | get_unaligned_le16(&report[i - 2]); | 472 | get_unaligned_le16(&report[i - 2]); |
450 | i += 7; | 473 | i += 7; |
451 | } else if (type == BAMBOO_PT) { | 474 | break; |
475 | |||
476 | case BAMBOO_PT: | ||
452 | features->y_phy = | 477 | features->y_phy = |
453 | get_unaligned_le16(&report[i + 3]); | 478 | get_unaligned_le16(&report[i + 3]); |
454 | features->y_max = | 479 | features->y_max = |
455 | get_unaligned_le16(&report[i + 6]); | 480 | get_unaligned_le16(&report[i + 6]); |
456 | i += 12; | 481 | i += 12; |
457 | } else { | 482 | break; |
483 | |||
484 | default: | ||
458 | features->y_max = | 485 | features->y_max = |
459 | features->x_max; | 486 | features->x_max; |
460 | features->y_phy = | 487 | features->y_phy = |
461 | get_unaligned_le16(&report[i + 3]); | 488 | get_unaligned_le16(&report[i + 3]); |
462 | i += 4; | 489 | i += 4; |
490 | break; | ||
463 | } | 491 | } |
464 | } else if (pen) { | 492 | } else if (pen) { |
465 | features->y_max = | 493 | features->y_max = |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index c2bfe9242cc5..264138f3217e 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -467,9 +467,7 @@ static void wacom_intuos_general(struct wacom_wac *wacom) | |||
467 | /* general pen packet */ | 467 | /* general pen packet */ |
468 | if ((data[1] & 0xb8) == 0xa0) { | 468 | if ((data[1] & 0xb8) == 0xa0) { |
469 | t = (data[6] << 2) | ((data[7] >> 6) & 3); | 469 | t = (data[6] << 2) | ((data[7] >> 6) & 3); |
470 | if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || | 470 | if (features->type >= INTUOS4S && features->type <= WACOM_24HD) { |
471 | (features->type >= INTUOS5S && features->type <= INTUOS5L) || | ||
472 | (features->type >= WACOM_21UX2 && features->type <= WACOM_24HD)) { | ||
473 | t = (t << 1) | (data[1] & 1); | 471 | t = (t << 1) | (data[1] & 1); |
474 | } | 472 | } |
475 | input_report_abs(input, ABS_PRESSURE, t); | 473 | input_report_abs(input, ABS_PRESSURE, t); |
@@ -877,6 +875,11 @@ static int wacom_mt_touch(struct wacom_wac *wacom) | |||
877 | int i; | 875 | int i; |
878 | int current_num_contacts = data[2]; | 876 | int current_num_contacts = data[2]; |
879 | int contacts_to_send = 0; | 877 | int contacts_to_send = 0; |
878 | int x_offset = 0; | ||
879 | |||
880 | /* MTTPC does not support Height and Width */ | ||
881 | if (wacom->features.type == MTTPC) | ||
882 | x_offset = -4; | ||
880 | 883 | ||
881 | /* | 884 | /* |
882 | * First packet resets the counter since only the first | 885 | * First packet resets the counter since only the first |
@@ -889,7 +892,7 @@ static int wacom_mt_touch(struct wacom_wac *wacom) | |||
889 | contacts_to_send = min(5, wacom->num_contacts_left); | 892 | contacts_to_send = min(5, wacom->num_contacts_left); |
890 | 893 | ||
891 | for (i = 0; i < contacts_to_send; i++) { | 894 | for (i = 0; i < contacts_to_send; i++) { |
892 | int offset = (WACOM_BYTES_PER_MT_PACKET * i) + 3; | 895 | int offset = (WACOM_BYTES_PER_MT_PACKET + x_offset) * i + 3; |
893 | bool touch = data[offset] & 0x1; | 896 | bool touch = data[offset] & 0x1; |
894 | int id = le16_to_cpup((__le16 *)&data[offset + 1]); | 897 | int id = le16_to_cpup((__le16 *)&data[offset + 1]); |
895 | int slot = find_slot_from_contactid(wacom, id); | 898 | int slot = find_slot_from_contactid(wacom, id); |
@@ -900,8 +903,8 @@ static int wacom_mt_touch(struct wacom_wac *wacom) | |||
900 | input_mt_slot(input, slot); | 903 | input_mt_slot(input, slot); |
901 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); | 904 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); |
902 | if (touch) { | 905 | if (touch) { |
903 | int x = le16_to_cpup((__le16 *)&data[offset + 7]); | 906 | int x = le16_to_cpup((__le16 *)&data[offset + x_offset + 7]); |
904 | int y = le16_to_cpup((__le16 *)&data[offset + 9]); | 907 | int y = le16_to_cpup((__le16 *)&data[offset + x_offset + 9]); |
905 | input_report_abs(input, ABS_MT_POSITION_X, x); | 908 | input_report_abs(input, ABS_MT_POSITION_X, x); |
906 | input_report_abs(input, ABS_MT_POSITION_Y, y); | 909 | input_report_abs(input, ABS_MT_POSITION_Y, y); |
907 | } | 910 | } |
@@ -1336,6 +1339,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) | |||
1336 | case TABLETPCE: | 1339 | case TABLETPCE: |
1337 | case TABLETPC2FG: | 1340 | case TABLETPC2FG: |
1338 | case MTSCREEN: | 1341 | case MTSCREEN: |
1342 | case MTTPC: | ||
1339 | sync = wacom_tpc_irq(wacom_wac, len); | 1343 | sync = wacom_tpc_irq(wacom_wac, len); |
1340 | break; | 1344 | break; |
1341 | 1345 | ||
@@ -1657,6 +1661,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1657 | /* fall through */ | 1661 | /* fall through */ |
1658 | 1662 | ||
1659 | case MTSCREEN: | 1663 | case MTSCREEN: |
1664 | case MTTPC: | ||
1660 | if (features->device_type == BTN_TOOL_FINGER) { | 1665 | if (features->device_type == BTN_TOOL_FINGER) { |
1661 | wacom_wac->slots = kmalloc(features->touch_max * | 1666 | wacom_wac->slots = kmalloc(features->touch_max * |
1662 | sizeof(int), | 1667 | sizeof(int), |
@@ -2018,6 +2023,15 @@ static const struct wacom_features wacom_features_0xED = | |||
2018 | static const struct wacom_features wacom_features_0xEF = | 2023 | static const struct wacom_features wacom_features_0xEF = |
2019 | { "Wacom ISDv4 EF", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, | 2024 | { "Wacom ISDv4 EF", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, |
2020 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 2025 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
2026 | static const struct wacom_features wacom_features_0x100 = | ||
2027 | { "Wacom ISDv4 100", WACOM_PKGLEN_MTTPC, 26202, 16325, 255, | ||
2028 | 0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | ||
2029 | static const struct wacom_features wacom_features_0x101 = | ||
2030 | { "Wacom ISDv4 101", WACOM_PKGLEN_MTTPC, 26202, 16325, 255, | ||
2031 | 0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | ||
2032 | static const struct wacom_features wacom_features_0x4001 = | ||
2033 | { "Wacom ISDv4 4001", WACOM_PKGLEN_MTTPC, 26202, 16325, 255, | ||
2034 | 0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | ||
2021 | static const struct wacom_features wacom_features_0x47 = | 2035 | static const struct wacom_features wacom_features_0x47 = |
2022 | { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, | 2036 | { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, |
2023 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 2037 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
@@ -2195,6 +2209,9 @@ const struct usb_device_id wacom_ids[] = { | |||
2195 | { USB_DEVICE_WACOM(0xEC) }, | 2209 | { USB_DEVICE_WACOM(0xEC) }, |
2196 | { USB_DEVICE_WACOM(0xED) }, | 2210 | { USB_DEVICE_WACOM(0xED) }, |
2197 | { USB_DEVICE_WACOM(0xEF) }, | 2211 | { USB_DEVICE_WACOM(0xEF) }, |
2212 | { USB_DEVICE_WACOM(0x100) }, | ||
2213 | { USB_DEVICE_WACOM(0x101) }, | ||
2214 | { USB_DEVICE_WACOM(0x4001) }, | ||
2198 | { USB_DEVICE_WACOM(0x47) }, | 2215 | { USB_DEVICE_WACOM(0x47) }, |
2199 | { USB_DEVICE_WACOM(0xF4) }, | 2216 | { USB_DEVICE_WACOM(0xF4) }, |
2200 | { USB_DEVICE_WACOM(0xF8) }, | 2217 | { USB_DEVICE_WACOM(0xF8) }, |
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 345f1e76975e..9396d7769f86 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #define WACOM_PKGLEN_BBPEN 10 | 26 | #define WACOM_PKGLEN_BBPEN 10 |
27 | #define WACOM_PKGLEN_WIRELESS 32 | 27 | #define WACOM_PKGLEN_WIRELESS 32 |
28 | #define WACOM_PKGLEN_MTOUCH 62 | 28 | #define WACOM_PKGLEN_MTOUCH 62 |
29 | #define WACOM_PKGLEN_MTTPC 40 | ||
29 | 30 | ||
30 | /* wacom data size per MT contact */ | 31 | /* wacom data size per MT contact */ |
31 | #define WACOM_BYTES_PER_MT_PACKET 11 | 32 | #define WACOM_BYTES_PER_MT_PACKET 11 |
@@ -88,6 +89,7 @@ enum { | |||
88 | TABLETPCE, | 89 | TABLETPCE, |
89 | TABLETPC2FG, | 90 | TABLETPC2FG, |
90 | MTSCREEN, | 91 | MTSCREEN, |
92 | MTTPC, | ||
91 | MAX_TYPE | 93 | MAX_TYPE |
92 | }; | 94 | }; |
93 | 95 | ||