aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/wacom_wac.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 21:29:38 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 21:29:38 -0500
commit870fd0f5df4e131467612cc46db46fc3b69fd706 (patch)
treeb7747c644003da42ec9d4265fa4a9cc6b9fb7297 /drivers/hid/wacom_wac.c
parent06cc01a0dea523b5c9acfd1ed276648c54012912 (diff)
parent988b7fb0bfc215476c3a0a623b442cd0e29ce4c0 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina: "Updates for HID code - improveements of Logitech HID++ procotol implementation, from Benjamin Tissoires - support for composite RMI devices, from Andrew Duggan - new driver for BETOP controller, from Huang Bo - fixup for conflicting mapping in HID core between PC-101/103/104 and PC-102/105 keyboards from David Herrmann - new hardware support and fixes in Wacom driver, from Ping Cheng - assorted small fixes and device ID additions all over the place" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (33 commits) HID: wacom: add support for Cintiq 27QHD and 27QHD touch HID: wacom: consolidate input capability settings for pen and touch HID: wacom: make sure touch arbitration is applied consistently HID: pidff: Fix initialisation forMicrosoft Sidewinder FF Pro 2 HID: hyperv: match wait_for_completion_timeout return type HID: wacom: Report ABS_MISC event for Cintiq Companion Hybrid HID: Use Kbuild idiom in Makefiles HID: do not bind to Microchip Pick16F1454 HID: hid-lg4ff: use DEVICE_ATTR_RW macro HID: hid-lg4ff: fix sysfs attribute permission HID: wacom: peport In Range event according to the spec HID: wacom: process invalid Cintiq and Intuos data in wacom_intuos_inout() HID: rmi: Add support for the touchpad in the Razer Blade 14 laptop HID: rmi: Support touchpads with external buttons HID: rmi: Use hid_report_len to compute the size of reports HID: logitech-hidpp: store the name of the device in struct hidpp HID: microsoft: add support for Japanese Surface Type Cover 3 HID: fixup the conflicting keyboard mappings quirk HID: apple: fix battery support for the 2009 ANSI wireless keyboard HID: fix Kconfig text ...
Diffstat (limited to 'drivers/hid/wacom_wac.c')
-rw-r--r--drivers/hid/wacom_wac.c239
1 files changed, 127 insertions, 112 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index ac7447c7b82e..1a6507999a65 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -15,7 +15,6 @@
15#include "wacom_wac.h" 15#include "wacom_wac.h"
16#include "wacom.h" 16#include "wacom.h"
17#include <linux/input/mt.h> 17#include <linux/input/mt.h>
18#include <linux/hid.h>
19 18
20/* resolution for penabled devices */ 19/* resolution for penabled devices */
21#define WACOM_PL_RES 20 20#define WACOM_PL_RES 20
@@ -444,9 +443,6 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
444 443
445 /* Enter report */ 444 /* Enter report */
446 if ((data[1] & 0xfc) == 0xc0) { 445 if ((data[1] & 0xfc) == 0xc0) {
447 if (features->quirks & WACOM_QUIRK_MULTI_INPUT)
448 wacom->shared->stylus_in_proximity = true;
449
450 /* serial number of the tool */ 446 /* serial number of the tool */
451 wacom->serial[idx] = ((data[3] & 0x0f) << 28) + 447 wacom->serial[idx] = ((data[3] & 0x0f) << 28) +
452 (data[4] << 20) + (data[5] << 12) + 448 (data[4] << 20) + (data[5] << 12) +
@@ -535,24 +531,46 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
535 return 1; 531 return 1;
536 } 532 }
537 533
534 /*
535 * don't report events for invalid data
536 */
538 /* older I4 styli don't work with new Cintiqs */ 537 /* older I4 styli don't work with new Cintiqs */
539 if (!((wacom->id[idx] >> 20) & 0x01) && 538 if ((!((wacom->id[idx] >> 20) & 0x01) &&
540 (features->type == WACOM_21UX2)) 539 (features->type == WACOM_21UX2)) ||
540 /* Only large Intuos support Lense Cursor */
541 (wacom->tool[idx] == BTN_TOOL_LENS &&
542 (features->type == INTUOS3 ||
543 features->type == INTUOS3S ||
544 features->type == INTUOS4 ||
545 features->type == INTUOS4S ||
546 features->type == INTUOS5 ||
547 features->type == INTUOS5S ||
548 features->type == INTUOSPM ||
549 features->type == INTUOSPS)) ||
550 /* Cintiq doesn't send data when RDY bit isn't set */
551 (features->type == CINTIQ && !(data[1] & 0x40)))
541 return 1; 552 return 1;
542 553
543 /* Range Report */ 554 if (features->quirks & WACOM_QUIRK_MULTI_INPUT)
544 if ((data[1] & 0xfe) == 0x20) { 555 wacom->shared->stylus_in_proximity = true;
556
557 /* in Range while exiting */
558 if (((data[1] & 0xfe) == 0x20) && wacom->reporting_data) {
545 input_report_key(input, BTN_TOUCH, 0); 559 input_report_key(input, BTN_TOUCH, 0);
546 input_report_abs(input, ABS_PRESSURE, 0); 560 input_report_abs(input, ABS_PRESSURE, 0);
547 input_report_abs(input, ABS_DISTANCE, wacom->features.distance_max); 561 input_report_abs(input, ABS_DISTANCE, wacom->features.distance_max);
548 if (features->quirks & WACOM_QUIRK_MULTI_INPUT) 562 return 2;
549 wacom->shared->stylus_in_proximity = true;
550 } 563 }
551 564
552 /* Exit report */ 565 /* Exit report */
553 if ((data[1] & 0xfe) == 0x80) { 566 if ((data[1] & 0xfe) == 0x80) {
554 if (features->quirks & WACOM_QUIRK_MULTI_INPUT) 567 if (features->quirks & WACOM_QUIRK_MULTI_INPUT)
555 wacom->shared->stylus_in_proximity = false; 568 wacom->shared->stylus_in_proximity = false;
569 wacom->reporting_data = false;
570
571 /* don't report exit if we don't know the ID */
572 if (!wacom->id[idx])
573 return 1;
556 574
557 /* 575 /*
558 * Reset all states otherwise we lose the initial states 576 * Reset all states otherwise we lose the initial states
@@ -586,6 +604,11 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
586 wacom->id[idx] = 0; 604 wacom->id[idx] = 0;
587 return 2; 605 return 2;
588 } 606 }
607
608 /* don't report other events if we don't know the ID */
609 if (!wacom->id[idx])
610 return 1;
611
589 return 0; 612 return 0;
590} 613}
591 614
@@ -633,6 +656,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
633 data[0] != WACOM_REPORT_INTUOSREAD && 656 data[0] != WACOM_REPORT_INTUOSREAD &&
634 data[0] != WACOM_REPORT_INTUOSWRITE && 657 data[0] != WACOM_REPORT_INTUOSWRITE &&
635 data[0] != WACOM_REPORT_INTUOSPAD && 658 data[0] != WACOM_REPORT_INTUOSPAD &&
659 data[0] != WACOM_REPORT_CINTIQ &&
660 data[0] != WACOM_REPORT_CINTIQPAD &&
636 data[0] != WACOM_REPORT_INTUOS5PAD) { 661 data[0] != WACOM_REPORT_INTUOS5PAD) {
637 dev_dbg(input->dev.parent, 662 dev_dbg(input->dev.parent,
638 "%s: received unknown report #%d\n", __func__, data[0]); 663 "%s: received unknown report #%d\n", __func__, data[0]);
@@ -644,7 +669,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
644 idx = data[1] & 0x01; 669 idx = data[1] & 0x01;
645 670
646 /* pad packets. Works as a second tool and is always in prox */ 671 /* pad packets. Works as a second tool and is always in prox */
647 if (data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD) { 672 if (data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD ||
673 data[0] == WACOM_REPORT_CINTIQPAD) {
648 input = wacom->pad_input; 674 input = wacom->pad_input;
649 if (features->type >= INTUOS4S && features->type <= INTUOS4L) { 675 if (features->type >= INTUOS4S && features->type <= INTUOS4L) {
650 input_report_key(input, BTN_0, (data[2] & 0x01)); 676 input_report_key(input, BTN_0, (data[2] & 0x01));
@@ -744,6 +770,14 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
744 } else { 770 } else {
745 input_report_abs(input, ABS_MISC, 0); 771 input_report_abs(input, ABS_MISC, 0);
746 } 772 }
773 } else if (features->type == WACOM_27QHD) {
774 input_report_key(input, KEY_PROG1, data[2] & 0x01);
775 input_report_key(input, KEY_PROG2, data[2] & 0x02);
776 input_report_key(input, KEY_PROG3, data[2] & 0x04);
777
778 input_report_abs(input, ABS_X, be16_to_cpup((__be16 *)&data[4]));
779 input_report_abs(input, ABS_Y, be16_to_cpup((__be16 *)&data[6]));
780 input_report_abs(input, ABS_Z, be16_to_cpup((__be16 *)&data[8]));
747 } else if (features->type == CINTIQ_HYBRID) { 781 } else if (features->type == CINTIQ_HYBRID) {
748 /* 782 /*
749 * Do not send hardware buttons under Android. They 783 * Do not send hardware buttons under Android. They
@@ -760,6 +794,12 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
760 input_report_key(input, BTN_7, (data[4] & 0x40)); /* Left */ 794 input_report_key(input, BTN_7, (data[4] & 0x40)); /* Left */
761 input_report_key(input, BTN_8, (data[4] & 0x80)); /* Down */ 795 input_report_key(input, BTN_8, (data[4] & 0x80)); /* Down */
762 input_report_key(input, BTN_0, (data[3] & 0x01)); /* Center */ 796 input_report_key(input, BTN_0, (data[3] & 0x01)); /* Center */
797
798 if (data[4] | (data[3] & 0x01)) {
799 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
800 } else {
801 input_report_abs(input, ABS_MISC, 0);
802 }
763 } else if (features->type >= INTUOS5S && features->type <= INTUOSPL) { 803 } else if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
764 int i; 804 int i;
765 805
@@ -843,28 +883,6 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
843 if (result) 883 if (result)
844 return result - 1; 884 return result - 1;
845 885
846 /* don't proceed if we don't know the ID */
847 if (!wacom->id[idx])
848 return 0;
849
850 /* Only large Intuos support Lense Cursor */
851 if (wacom->tool[idx] == BTN_TOOL_LENS &&
852 (features->type == INTUOS3 ||
853 features->type == INTUOS3S ||
854 features->type == INTUOS4 ||
855 features->type == INTUOS4S ||
856 features->type == INTUOS5 ||
857 features->type == INTUOS5S ||
858 features->type == INTUOSPM ||
859 features->type == INTUOSPS)) {
860
861 return 0;
862 }
863
864 /* Cintiq doesn't send data when RDY bit isn't set */
865 if (features->type == CINTIQ && !(data[1] & 0x40))
866 return 0;
867
868 if (features->type >= INTUOS3S) { 886 if (features->type >= INTUOS3S) {
869 input_report_abs(input, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); 887 input_report_abs(input, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1));
870 input_report_abs(input, ABS_Y, (data[4] << 9) | (data[5] << 1) | (data[9] & 1)); 888 input_report_abs(input, ABS_Y, (data[4] << 9) | (data[5] << 1) | (data[9] & 1));
@@ -951,6 +969,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
951 input_report_abs(input, ABS_MISC, wacom->id[idx]); /* report tool id */ 969 input_report_abs(input, ABS_MISC, wacom->id[idx]); /* report tool id */
952 input_report_key(input, wacom->tool[idx], 1); 970 input_report_key(input, wacom->tool[idx], 1);
953 input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]); 971 input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
972 wacom->reporting_data = true;
954 return 1; 973 return 1;
955} 974}
956 975
@@ -1019,8 +1038,20 @@ static int wacom_24hdt_irq(struct wacom_wac *wacom)
1019 struct input_dev *input = wacom->input; 1038 struct input_dev *input = wacom->input;
1020 unsigned char *data = wacom->data; 1039 unsigned char *data = wacom->data;
1021 int i; 1040 int i;
1022 int current_num_contacts = data[61]; 1041 int current_num_contacts = 0;
1023 int contacts_to_send = 0; 1042 int contacts_to_send = 0;
1043 int num_contacts_left = 4; /* maximum contacts per packet */
1044 int byte_per_packet = WACOM_BYTES_PER_24HDT_PACKET;
1045 int y_offset = 2;
1046
1047 if (wacom->features.type == WACOM_27QHDT) {
1048 current_num_contacts = data[63];
1049 num_contacts_left = 10;
1050 byte_per_packet = WACOM_BYTES_PER_QHDTHID_PACKET;
1051 y_offset = 0;
1052 } else {
1053 current_num_contacts = data[61];
1054 }
1024 1055
1025 /* 1056 /*
1026 * First packet resets the counter since only the first 1057 * First packet resets the counter since only the first
@@ -1029,12 +1060,11 @@ static int wacom_24hdt_irq(struct wacom_wac *wacom)
1029 if (current_num_contacts) 1060 if (current_num_contacts)
1030 wacom->num_contacts_left = current_num_contacts; 1061 wacom->num_contacts_left = current_num_contacts;
1031 1062
1032 /* There are at most 4 contacts per packet */ 1063 contacts_to_send = min(num_contacts_left, wacom->num_contacts_left);
1033 contacts_to_send = min(4, wacom->num_contacts_left);
1034 1064
1035 for (i = 0; i < contacts_to_send; i++) { 1065 for (i = 0; i < contacts_to_send; i++) {
1036 int offset = (WACOM_BYTES_PER_24HDT_PACKET * i) + 1; 1066 int offset = (byte_per_packet * i) + 1;
1037 bool touch = data[offset] & 0x1 && !wacom->shared->stylus_in_proximity; 1067 bool touch = (data[offset] & 0x1) && !wacom->shared->stylus_in_proximity;
1038 int slot = input_mt_get_slot_by_key(input, data[offset + 1]); 1068 int slot = input_mt_get_slot_by_key(input, data[offset + 1]);
1039 1069
1040 if (slot < 0) 1070 if (slot < 0)
@@ -1044,18 +1074,23 @@ static int wacom_24hdt_irq(struct wacom_wac *wacom)
1044 1074
1045 if (touch) { 1075 if (touch) {
1046 int t_x = get_unaligned_le16(&data[offset + 2]); 1076 int t_x = get_unaligned_le16(&data[offset + 2]);
1047 int c_x = get_unaligned_le16(&data[offset + 4]); 1077 int t_y = get_unaligned_le16(&data[offset + 4 + y_offset]);
1048 int t_y = get_unaligned_le16(&data[offset + 6]);
1049 int c_y = get_unaligned_le16(&data[offset + 8]);
1050 int w = get_unaligned_le16(&data[offset + 10]);
1051 int h = get_unaligned_le16(&data[offset + 12]);
1052 1078
1053 input_report_abs(input, ABS_MT_POSITION_X, t_x); 1079 input_report_abs(input, ABS_MT_POSITION_X, t_x);
1054 input_report_abs(input, ABS_MT_POSITION_Y, t_y); 1080 input_report_abs(input, ABS_MT_POSITION_Y, t_y);
1055 input_report_abs(input, ABS_MT_TOUCH_MAJOR, min(w,h)); 1081
1056 input_report_abs(input, ABS_MT_WIDTH_MAJOR, min(w, h) + int_dist(t_x, t_y, c_x, c_y)); 1082 if (wacom->features.type != WACOM_27QHDT) {
1057 input_report_abs(input, ABS_MT_WIDTH_MINOR, min(w, h)); 1083 int c_x = get_unaligned_le16(&data[offset + 4]);
1058 input_report_abs(input, ABS_MT_ORIENTATION, w > h); 1084 int c_y = get_unaligned_le16(&data[offset + 8]);
1085 int w = get_unaligned_le16(&data[offset + 10]);
1086 int h = get_unaligned_le16(&data[offset + 12]);
1087
1088 input_report_abs(input, ABS_MT_TOUCH_MAJOR, min(w,h));
1089 input_report_abs(input, ABS_MT_WIDTH_MAJOR,
1090 min(w, h) + int_dist(t_x, t_y, c_x, c_y));
1091 input_report_abs(input, ABS_MT_WIDTH_MINOR, min(w, h));
1092 input_report_abs(input, ABS_MT_ORIENTATION, w > h);
1093 }
1059 } 1094 }
1060 } 1095 }
1061 input_mt_report_pointer_emulation(input, true); 1096 input_mt_report_pointer_emulation(input, true);
@@ -1064,6 +1099,7 @@ static int wacom_24hdt_irq(struct wacom_wac *wacom)
1064 if (wacom->num_contacts_left <= 0) 1099 if (wacom->num_contacts_left <= 0)
1065 wacom->num_contacts_left = 0; 1100 wacom->num_contacts_left = 0;
1066 1101
1102 wacom->shared->touch_down = (wacom->num_contacts_left > 0);
1067 return 1; 1103 return 1;
1068} 1104}
1069 1105
@@ -1092,7 +1128,7 @@ static int wacom_mt_touch(struct wacom_wac *wacom)
1092 1128
1093 for (i = 0; i < contacts_to_send; i++) { 1129 for (i = 0; i < contacts_to_send; i++) {
1094 int offset = (WACOM_BYTES_PER_MT_PACKET + x_offset) * i + 3; 1130 int offset = (WACOM_BYTES_PER_MT_PACKET + x_offset) * i + 3;
1095 bool touch = data[offset] & 0x1; 1131 bool touch = (data[offset] & 0x1) && !wacom->shared->stylus_in_proximity;
1096 int id = get_unaligned_le16(&data[offset + 1]); 1132 int id = get_unaligned_le16(&data[offset + 1]);
1097 int slot = input_mt_get_slot_by_key(input, id); 1133 int slot = input_mt_get_slot_by_key(input, id);
1098 1134
@@ -1114,6 +1150,7 @@ static int wacom_mt_touch(struct wacom_wac *wacom)
1114 if (wacom->num_contacts_left < 0) 1150 if (wacom->num_contacts_left < 0)
1115 wacom->num_contacts_left = 0; 1151 wacom->num_contacts_left = 0;
1116 1152
1153 wacom->shared->touch_down = (wacom->num_contacts_left > 0);
1117 return 1; 1154 return 1;
1118} 1155}
1119 1156
@@ -1514,13 +1551,6 @@ static void wacom_wac_finger_report(struct hid_device *hdev,
1514 wacom_wac->shared->touch_down = wacom_wac_finger_count_touches(hdev); 1551 wacom_wac->shared->touch_down = wacom_wac_finger_count_touches(hdev);
1515} 1552}
1516 1553
1517#define WACOM_PEN_FIELD(f) (((f)->logical == HID_DG_STYLUS) || \
1518 ((f)->physical == HID_DG_STYLUS) || \
1519 ((f)->application == HID_DG_PEN))
1520#define WACOM_FINGER_FIELD(f) (((f)->logical == HID_DG_FINGER) || \
1521 ((f)->physical == HID_DG_FINGER) || \
1522 ((f)->application == HID_DG_TOUCHSCREEN))
1523
1524void wacom_wac_usage_mapping(struct hid_device *hdev, 1554void wacom_wac_usage_mapping(struct hid_device *hdev,
1525 struct hid_field *field, struct hid_usage *usage) 1555 struct hid_field *field, struct hid_usage *usage)
1526{ 1556{
@@ -1891,6 +1921,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1891 case WACOM_21UX2: 1921 case WACOM_21UX2:
1892 case WACOM_22HD: 1922 case WACOM_22HD:
1893 case WACOM_24HD: 1923 case WACOM_24HD:
1924 case WACOM_27QHD:
1894 case DTK: 1925 case DTK:
1895 case CINTIQ_HYBRID: 1926 case CINTIQ_HYBRID:
1896 sync = wacom_intuos_irq(wacom_wac); 1927 sync = wacom_intuos_irq(wacom_wac);
@@ -1901,6 +1932,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1901 break; 1932 break;
1902 1933
1903 case WACOM_24HDT: 1934 case WACOM_24HDT:
1935 case WACOM_27QHDT:
1904 sync = wacom_24hdt_irq(wacom_wac); 1936 sync = wacom_24hdt_irq(wacom_wac);
1905 break; 1937 break;
1906 1938
@@ -2086,32 +2118,17 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2086 wacom_abs_set_axis(input_dev, wacom_wac); 2118 wacom_abs_set_axis(input_dev, wacom_wac);
2087 2119
2088 switch (features->type) { 2120 switch (features->type) {
2089 case WACOM_MO:
2090 case WACOM_G4:
2091 /* fall through */
2092
2093 case GRAPHIRE:
2094 input_set_capability(input_dev, EV_REL, REL_WHEEL);
2095
2096 __set_bit(BTN_LEFT, input_dev->keybit);
2097 __set_bit(BTN_RIGHT, input_dev->keybit);
2098 __set_bit(BTN_MIDDLE, input_dev->keybit);
2099
2100 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
2101 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
2102 __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
2103 __set_bit(BTN_STYLUS, input_dev->keybit);
2104 __set_bit(BTN_STYLUS2, input_dev->keybit);
2105
2106 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
2107 break;
2108
2109 case GRAPHIRE_BT: 2121 case GRAPHIRE_BT:
2110 __clear_bit(ABS_MISC, input_dev->absbit); 2122 __clear_bit(ABS_MISC, input_dev->absbit);
2123
2124 case WACOM_MO:
2125 case WACOM_G4:
2111 input_set_abs_params(input_dev, ABS_DISTANCE, 0, 2126 input_set_abs_params(input_dev, ABS_DISTANCE, 0,
2112 features->distance_max, 2127 features->distance_max,
2113 0, 0); 2128 0, 0);
2129 /* fall through */
2114 2130
2131 case GRAPHIRE:
2115 input_set_capability(input_dev, EV_REL, REL_WHEEL); 2132 input_set_capability(input_dev, EV_REL, REL_WHEEL);
2116 2133
2117 __set_bit(BTN_LEFT, input_dev->keybit); 2134 __set_bit(BTN_LEFT, input_dev->keybit);
@@ -2127,31 +2144,15 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2127 __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 2144 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
2128 break; 2145 break;
2129 2146
2147 case WACOM_27QHD:
2130 case WACOM_24HD: 2148 case WACOM_24HD:
2131 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
2132 input_abs_set_res(input_dev, ABS_Z, 287);
2133 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
2134 /* fall through */
2135
2136 case DTK: 2149 case DTK:
2137 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
2138
2139 wacom_setup_cintiq(wacom_wac);
2140 break;
2141
2142 case WACOM_22HD: 2150 case WACOM_22HD:
2143 case WACOM_21UX2: 2151 case WACOM_21UX2:
2144 case WACOM_BEE: 2152 case WACOM_BEE:
2145 case CINTIQ: 2153 case CINTIQ:
2146 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
2147 input_abs_set_res(input_dev, ABS_Z, 287);
2148
2149 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
2150
2151 wacom_setup_cintiq(wacom_wac);
2152 break;
2153
2154 case WACOM_13HD: 2154 case WACOM_13HD:
2155 case CINTIQ_HYBRID:
2155 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 2156 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
2156 input_abs_set_res(input_dev, ABS_Z, 287); 2157 input_abs_set_res(input_dev, ABS_Z, 287);
2157 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); 2158 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
@@ -2161,6 +2162,10 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2161 case INTUOS3: 2162 case INTUOS3:
2162 case INTUOS3L: 2163 case INTUOS3L:
2163 case INTUOS3S: 2164 case INTUOS3S:
2165 case INTUOS4:
2166 case INTUOS4WL:
2167 case INTUOS4L:
2168 case INTUOS4S:
2164 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 2169 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
2165 input_abs_set_res(input_dev, ABS_Z, 287); 2170 input_abs_set_res(input_dev, ABS_Z, 287);
2166 /* fall through */ 2171 /* fall through */
@@ -2199,17 +2204,6 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2199 } 2204 }
2200 break; 2205 break;
2201 2206
2202 case INTUOS4:
2203 case INTUOS4WL:
2204 case INTUOS4L:
2205 case INTUOS4S:
2206 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
2207 input_abs_set_res(input_dev, ABS_Z, 287);
2208 wacom_setup_intuos(wacom_wac);
2209
2210 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
2211 break;
2212
2213 case WACOM_24HDT: 2207 case WACOM_24HDT:
2214 if (features->device_type == BTN_TOOL_FINGER) { 2208 if (features->device_type == BTN_TOOL_FINGER) {
2215 input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, features->x_max, 0, 0); 2209 input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, features->x_max, 0, 0);
@@ -2219,6 +2213,7 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2219 } 2213 }
2220 /* fall through */ 2214 /* fall through */
2221 2215
2216 case WACOM_27QHDT:
2222 case MTSCREEN: 2217 case MTSCREEN:
2223 case MTTPC: 2218 case MTTPC:
2224 case MTTPC_B: 2219 case MTTPC_B:
@@ -2305,14 +2300,6 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2305 0, 0); 2300 0, 0);
2306 } 2301 }
2307 break; 2302 break;
2308
2309 case CINTIQ_HYBRID:
2310 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
2311 input_abs_set_res(input_dev, ABS_Z, 287);
2312 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
2313
2314 wacom_setup_cintiq(wacom_wac);
2315 break;
2316 } 2303 }
2317 return 0; 2304 return 0;
2318} 2305}
@@ -2374,6 +2361,19 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
2374 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0); 2361 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
2375 break; 2362 break;
2376 2363
2364 case WACOM_27QHD:
2365 __set_bit(KEY_PROG1, input_dev->keybit);
2366 __set_bit(KEY_PROG2, input_dev->keybit);
2367 __set_bit(KEY_PROG3, input_dev->keybit);
2368 input_set_abs_params(input_dev, ABS_X, -2048, 2048, 0, 0);
2369 input_abs_set_res(input_dev, ABS_X, 1024); /* points/g */
2370 input_set_abs_params(input_dev, ABS_Y, -2048, 2048, 0, 0);
2371 input_abs_set_res(input_dev, ABS_Y, 1024);
2372 input_set_abs_params(input_dev, ABS_Z, -2048, 2048, 0, 0);
2373 input_abs_set_res(input_dev, ABS_Z, 1024);
2374 __set_bit(INPUT_PROP_ACCELEROMETER, input_dev->propbit);
2375 break;
2376
2377 case DTK: 2377 case DTK:
2378 for (i = 0; i < 6; i++) 2378 for (i = 0; i < 6; i++)
2379 __set_bit(BTN_0 + i, input_dev->keybit); 2379 __set_bit(BTN_0 + i, input_dev->keybit);
@@ -2724,6 +2724,18 @@ static const struct wacom_features wacom_features_0xF6 =
2724 { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */ 2724 { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */
2725 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10, 2725 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10,
2726 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; 2726 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
2727static const struct wacom_features wacom_features_0x32A =
2728 { "Wacom Cintiq 27QHD", 119740, 67520, 2047,
2729 63, WACOM_27QHD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
2730 WACOM_27QHD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
2731static const struct wacom_features wacom_features_0x32B =
2732 { "Wacom Cintiq 27QHD touch", 119740, 67520, 2047, 63,
2733 WACOM_27QHD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
2734 WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
2735 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x32C };
2736static const struct wacom_features wacom_features_0x32C =
2737 { "Wacom Cintiq 27QHD touch", .type = WACOM_27QHDT,
2738 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x32B, .touch_max = 10 };
2727static const struct wacom_features wacom_features_0x3F = 2739static const struct wacom_features wacom_features_0x3F =
2728 { "Wacom Cintiq 21UX", 87200, 65600, 1023, 63, 2740 { "Wacom Cintiq 21UX", 87200, 65600, 1023, 63,
2729 CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 2741 CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
@@ -3090,6 +3102,9 @@ const struct hid_device_id wacom_ids[] = {
3090 { USB_DEVICE_WACOM(0x315) }, 3102 { USB_DEVICE_WACOM(0x315) },
3091 { USB_DEVICE_WACOM(0x317) }, 3103 { USB_DEVICE_WACOM(0x317) },
3092 { USB_DEVICE_WACOM(0x323) }, 3104 { USB_DEVICE_WACOM(0x323) },
3105 { USB_DEVICE_WACOM(0x32A) },
3106 { USB_DEVICE_WACOM(0x32B) },
3107 { USB_DEVICE_WACOM(0x32C) },
3093 { USB_DEVICE_WACOM(0x32F) }, 3108 { USB_DEVICE_WACOM(0x32F) },
3094 { USB_DEVICE_WACOM(0x4001) }, 3109 { USB_DEVICE_WACOM(0x4001) },
3095 { USB_DEVICE_WACOM(0x4004) }, 3110 { USB_DEVICE_WACOM(0x4004) },