diff options
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 304 |
1 files changed, 261 insertions, 43 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index b327790e9a0c..004bc1bb1544 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -61,7 +61,8 @@ static int wacom_penpartner_irq(struct wacom_wac *wacom) | |||
61 | break; | 61 | break; |
62 | 62 | ||
63 | default: | 63 | default: |
64 | printk(KERN_INFO "wacom_penpartner_irq: received unknown report #%d\n", data[0]); | 64 | dev_dbg(input->dev.parent, |
65 | "%s: received unknown report #%d\n", __func__, data[0]); | ||
65 | return 0; | 66 | return 0; |
66 | } | 67 | } |
67 | 68 | ||
@@ -76,8 +77,8 @@ static int wacom_pl_irq(struct wacom_wac *wacom) | |||
76 | int prox, pressure; | 77 | int prox, pressure; |
77 | 78 | ||
78 | if (data[0] != WACOM_REPORT_PENABLED) { | 79 | if (data[0] != WACOM_REPORT_PENABLED) { |
79 | dev_dbg(&input->dev, | 80 | dev_dbg(input->dev.parent, |
80 | "wacom_pl_irq: received unknown report #%d\n", data[0]); | 81 | "%s: received unknown report #%d\n", __func__, data[0]); |
81 | return 0; | 82 | return 0; |
82 | } | 83 | } |
83 | 84 | ||
@@ -147,7 +148,8 @@ static int wacom_ptu_irq(struct wacom_wac *wacom) | |||
147 | struct input_dev *input = wacom->input; | 148 | struct input_dev *input = wacom->input; |
148 | 149 | ||
149 | if (data[0] != WACOM_REPORT_PENABLED) { | 150 | if (data[0] != WACOM_REPORT_PENABLED) { |
150 | printk(KERN_INFO "wacom_ptu_irq: received unknown report #%d\n", data[0]); | 151 | dev_dbg(input->dev.parent, |
152 | "%s: received unknown report #%d\n", __func__, data[0]); | ||
151 | return 0; | 153 | return 0; |
152 | } | 154 | } |
153 | 155 | ||
@@ -176,7 +178,8 @@ static int wacom_dtu_irq(struct wacom_wac *wacom) | |||
176 | struct input_dev *input = wacom->input; | 178 | struct input_dev *input = wacom->input; |
177 | int prox = data[1] & 0x20, pressure; | 179 | int prox = data[1] & 0x20, pressure; |
178 | 180 | ||
179 | dev_dbg(&input->dev, "wacom_dtu_irq: received report #%d\n", data[0]); | 181 | dev_dbg(input->dev.parent, |
182 | "%s: received report #%d", __func__, data[0]); | ||
180 | 183 | ||
181 | if (prox) { | 184 | if (prox) { |
182 | /* Going into proximity select tool */ | 185 | /* Going into proximity select tool */ |
@@ -212,9 +215,8 @@ static int wacom_graphire_irq(struct wacom_wac *wacom) | |||
212 | int retval = 0; | 215 | int retval = 0; |
213 | 216 | ||
214 | if (data[0] != WACOM_REPORT_PENABLED) { | 217 | if (data[0] != WACOM_REPORT_PENABLED) { |
215 | dev_dbg(&input->dev, | 218 | dev_dbg(input->dev.parent, |
216 | "wacom_graphire_irq: received unknown report #%d\n", | 219 | "%s: received unknown report #%d\n", __func__, data[0]); |
217 | data[0]); | ||
218 | goto exit; | 220 | goto exit; |
219 | } | 221 | } |
220 | 222 | ||
@@ -324,6 +326,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) | |||
324 | 326 | ||
325 | /* Enter report */ | 327 | /* Enter report */ |
326 | if ((data[1] & 0xfc) == 0xc0) { | 328 | if ((data[1] & 0xfc) == 0xc0) { |
329 | if (features->type >= INTUOS5S && features->type <= INTUOS5L) | ||
330 | wacom->shared->stylus_in_proximity = true; | ||
331 | |||
327 | /* serial number of the tool */ | 332 | /* serial number of the tool */ |
328 | wacom->serial[idx] = ((data[3] & 0x0f) << 28) + | 333 | wacom->serial[idx] = ((data[3] & 0x0f) << 28) + |
329 | (data[4] << 20) + (data[5] << 12) + | 334 | (data[4] << 20) + (data[5] << 12) + |
@@ -409,6 +414,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) | |||
409 | 414 | ||
410 | /* Exit report */ | 415 | /* Exit report */ |
411 | if ((data[1] & 0xfe) == 0x80) { | 416 | if ((data[1] & 0xfe) == 0x80) { |
417 | if (features->type >= INTUOS5S && features->type <= INTUOS5L) | ||
418 | wacom->shared->stylus_in_proximity = false; | ||
419 | |||
412 | /* | 420 | /* |
413 | * Reset all states otherwise we lose the initial states | 421 | * Reset all states otherwise we lose the initial states |
414 | * when in-prox next time | 422 | * when in-prox next time |
@@ -455,6 +463,7 @@ static void wacom_intuos_general(struct wacom_wac *wacom) | |||
455 | if ((data[1] & 0xb8) == 0xa0) { | 463 | if ((data[1] & 0xb8) == 0xa0) { |
456 | t = (data[6] << 2) | ((data[7] >> 6) & 3); | 464 | t = (data[6] << 2) | ((data[7] >> 6) & 3); |
457 | if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || | 465 | if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || |
466 | (features->type >= INTUOS5S && features->type <= INTUOS5L) || | ||
458 | features->type == WACOM_21UX2 || features->type == WACOM_24HD) { | 467 | features->type == WACOM_21UX2 || features->type == WACOM_24HD) { |
459 | t = (t << 1) | (data[1] & 1); | 468 | t = (t << 1) | (data[1] & 1); |
460 | } | 469 | } |
@@ -485,11 +494,13 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
485 | unsigned int t; | 494 | unsigned int t; |
486 | int idx = 0, result; | 495 | int idx = 0, result; |
487 | 496 | ||
488 | if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD | 497 | if (data[0] != WACOM_REPORT_PENABLED && |
489 | && data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD) { | 498 | data[0] != WACOM_REPORT_INTUOSREAD && |
490 | dev_dbg(&input->dev, | 499 | data[0] != WACOM_REPORT_INTUOSWRITE && |
491 | "wacom_intuos_irq: received unknown report #%d\n", | 500 | data[0] != WACOM_REPORT_INTUOSPAD && |
492 | data[0]); | 501 | data[0] != WACOM_REPORT_INTUOS5PAD) { |
502 | dev_dbg(input->dev.parent, | ||
503 | "%s: received unknown report #%d\n", __func__, data[0]); | ||
493 | return 0; | 504 | return 0; |
494 | } | 505 | } |
495 | 506 | ||
@@ -498,7 +509,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
498 | idx = data[1] & 0x01; | 509 | idx = data[1] & 0x01; |
499 | 510 | ||
500 | /* pad packets. Works as a second tool and is always in prox */ | 511 | /* pad packets. Works as a second tool and is always in prox */ |
501 | if (data[0] == WACOM_REPORT_INTUOSPAD) { | 512 | if (data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD) { |
502 | if (features->type >= INTUOS4S && features->type <= INTUOS4L) { | 513 | if (features->type >= INTUOS4S && features->type <= INTUOS4L) { |
503 | input_report_key(input, BTN_0, (data[2] & 0x01)); | 514 | input_report_key(input, BTN_0, (data[2] & 0x01)); |
504 | input_report_key(input, BTN_1, (data[3] & 0x01)); | 515 | input_report_key(input, BTN_1, (data[3] & 0x01)); |
@@ -574,6 +585,34 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
574 | input_report_key(input, wacom->tool[1], 0); | 585 | input_report_key(input, wacom->tool[1], 0); |
575 | input_report_abs(input, ABS_MISC, 0); | 586 | input_report_abs(input, ABS_MISC, 0); |
576 | } | 587 | } |
588 | } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) { | ||
589 | int i; | ||
590 | |||
591 | /* Touch ring mode switch has no capacitive sensor */ | ||
592 | input_report_key(input, BTN_0, (data[3] & 0x01)); | ||
593 | |||
594 | /* | ||
595 | * ExpressKeys on Intuos5 have a capacitive sensor in | ||
596 | * addition to the mechanical switch. Switch data is | ||
597 | * stored in data[4], capacitive data in data[5]. | ||
598 | */ | ||
599 | for (i = 0; i < 8; i++) | ||
600 | input_report_key(input, BTN_1 + i, data[4] & (1 << i)); | ||
601 | |||
602 | if (data[2] & 0x80) { | ||
603 | input_report_abs(input, ABS_WHEEL, (data[2] & 0x7f)); | ||
604 | } else { | ||
605 | /* Out of proximity, clear wheel value. */ | ||
606 | input_report_abs(input, ABS_WHEEL, 0); | ||
607 | } | ||
608 | |||
609 | if (data[2] | (data[3] & 0x01) | data[4]) { | ||
610 | input_report_key(input, wacom->tool[1], 1); | ||
611 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); | ||
612 | } else { | ||
613 | input_report_key(input, wacom->tool[1], 0); | ||
614 | input_report_abs(input, ABS_MISC, 0); | ||
615 | } | ||
577 | } else { | 616 | } else { |
578 | if (features->type == WACOM_21UX2) { | 617 | if (features->type == WACOM_21UX2) { |
579 | input_report_key(input, BTN_0, (data[5] & 0x01)); | 618 | input_report_key(input, BTN_0, (data[5] & 0x01)); |
@@ -637,7 +676,9 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
637 | (features->type == INTUOS3 || | 676 | (features->type == INTUOS3 || |
638 | features->type == INTUOS3S || | 677 | features->type == INTUOS3S || |
639 | features->type == INTUOS4 || | 678 | features->type == INTUOS4 || |
640 | features->type == INTUOS4S)) { | 679 | features->type == INTUOS4S || |
680 | features->type == INTUOS5 || | ||
681 | features->type == INTUOS5S)) { | ||
641 | 682 | ||
642 | return 0; | 683 | return 0; |
643 | } | 684 | } |
@@ -690,7 +731,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
690 | 731 | ||
691 | } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) { | 732 | } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) { |
692 | /* I4 mouse */ | 733 | /* I4 mouse */ |
693 | if (features->type >= INTUOS4S && features->type <= INTUOS4L) { | 734 | if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || |
735 | (features->type >= INTUOS5S && features->type <= INTUOS5L)) { | ||
694 | input_report_key(input, BTN_LEFT, data[6] & 0x01); | 736 | input_report_key(input, BTN_LEFT, data[6] & 0x01); |
695 | input_report_key(input, BTN_MIDDLE, data[6] & 0x02); | 737 | input_report_key(input, BTN_MIDDLE, data[6] & 0x02); |
696 | input_report_key(input, BTN_RIGHT, data[6] & 0x04); | 738 | input_report_key(input, BTN_RIGHT, data[6] & 0x04); |
@@ -717,7 +759,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
717 | } | 759 | } |
718 | } | 760 | } |
719 | } else if ((features->type < INTUOS3S || features->type == INTUOS3L || | 761 | } else if ((features->type < INTUOS3S || features->type == INTUOS3L || |
720 | features->type == INTUOS4L) && | 762 | features->type == INTUOS4L || features->type == INTUOS5L) && |
721 | wacom->tool[idx] == BTN_TOOL_LENS) { | 763 | wacom->tool[idx] == BTN_TOOL_LENS) { |
722 | /* Lens cursor packets */ | 764 | /* Lens cursor packets */ |
723 | input_report_key(input, BTN_LEFT, data[8] & 0x01); | 765 | input_report_key(input, BTN_LEFT, data[8] & 0x01); |
@@ -734,6 +776,72 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
734 | return 1; | 776 | return 1; |
735 | } | 777 | } |
736 | 778 | ||
779 | static int find_slot_from_contactid(struct wacom_wac *wacom, int contactid) | ||
780 | { | ||
781 | int touch_max = wacom->features.touch_max; | ||
782 | int i; | ||
783 | |||
784 | if (!wacom->slots) | ||
785 | return -1; | ||
786 | |||
787 | for (i = 0; i < touch_max; ++i) { | ||
788 | if (wacom->slots[i] == contactid) | ||
789 | return i; | ||
790 | } | ||
791 | for (i = 0; i < touch_max; ++i) { | ||
792 | if (wacom->slots[i] == -1) | ||
793 | return i; | ||
794 | } | ||
795 | return -1; | ||
796 | } | ||
797 | |||
798 | static int wacom_mt_touch(struct wacom_wac *wacom) | ||
799 | { | ||
800 | struct input_dev *input = wacom->input; | ||
801 | char *data = wacom->data; | ||
802 | int i; | ||
803 | int current_num_contacts = data[2]; | ||
804 | int contacts_to_send = 0; | ||
805 | |||
806 | /* | ||
807 | * First packet resets the counter since only the first | ||
808 | * packet in series will have non-zero current_num_contacts. | ||
809 | */ | ||
810 | if (current_num_contacts) | ||
811 | wacom->num_contacts_left = current_num_contacts; | ||
812 | |||
813 | /* There are at most 5 contacts per packet */ | ||
814 | contacts_to_send = min(5, wacom->num_contacts_left); | ||
815 | |||
816 | for (i = 0; i < contacts_to_send; i++) { | ||
817 | int offset = (WACOM_BYTES_PER_MT_PACKET * i) + 3; | ||
818 | bool touch = data[offset] & 0x1; | ||
819 | int id = le16_to_cpup((__le16 *)&data[offset + 1]); | ||
820 | int slot = find_slot_from_contactid(wacom, id); | ||
821 | |||
822 | if (slot < 0) | ||
823 | continue; | ||
824 | |||
825 | input_mt_slot(input, slot); | ||
826 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); | ||
827 | if (touch) { | ||
828 | int x = le16_to_cpup((__le16 *)&data[offset + 7]); | ||
829 | int y = le16_to_cpup((__le16 *)&data[offset + 9]); | ||
830 | input_report_abs(input, ABS_MT_POSITION_X, x); | ||
831 | input_report_abs(input, ABS_MT_POSITION_Y, y); | ||
832 | } | ||
833 | wacom->slots[slot] = touch ? id : -1; | ||
834 | } | ||
835 | |||
836 | input_mt_report_pointer_emulation(input, true); | ||
837 | |||
838 | wacom->num_contacts_left -= contacts_to_send; | ||
839 | if (wacom->num_contacts_left < 0) | ||
840 | wacom->num_contacts_left = 0; | ||
841 | |||
842 | return 1; | ||
843 | } | ||
844 | |||
737 | static int wacom_tpc_mt_touch(struct wacom_wac *wacom) | 845 | static int wacom_tpc_mt_touch(struct wacom_wac *wacom) |
738 | { | 846 | { |
739 | struct input_dev *input = wacom->input; | 847 | struct input_dev *input = wacom->input; |
@@ -772,6 +880,9 @@ static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len) | |||
772 | bool prox; | 880 | bool prox; |
773 | int x = 0, y = 0; | 881 | int x = 0, y = 0; |
774 | 882 | ||
883 | if (wacom->features.touch_max > 1 || len > WACOM_PKGLEN_TPC2FG) | ||
884 | return 0; | ||
885 | |||
775 | if (!wacom->shared->stylus_in_proximity) { | 886 | if (!wacom->shared->stylus_in_proximity) { |
776 | if (len == WACOM_PKGLEN_TPC1FG) { | 887 | if (len == WACOM_PKGLEN_TPC1FG) { |
777 | prox = data[0] & 0x01; | 888 | prox = data[0] & 0x01; |
@@ -835,15 +946,15 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) | |||
835 | { | 946 | { |
836 | char *data = wacom->data; | 947 | char *data = wacom->data; |
837 | 948 | ||
838 | dev_dbg(&wacom->input->dev, "wacom_tpc_irq: received report #%d\n", | 949 | dev_dbg(wacom->input->dev.parent, |
839 | data[0]); | 950 | "%s: received report #%d\n", __func__, data[0]); |
840 | 951 | ||
841 | switch (len) { | 952 | switch (len) { |
842 | case WACOM_PKGLEN_TPC1FG: | 953 | case WACOM_PKGLEN_TPC1FG: |
843 | return wacom_tpc_single_touch(wacom, len); | 954 | return wacom_tpc_single_touch(wacom, len); |
844 | 955 | ||
845 | case WACOM_PKGLEN_TPC2FG: | 956 | case WACOM_PKGLEN_TPC2FG: |
846 | return wacom_tpc_mt_touch(wacom); | 957 | return wacom_tpc_mt_touch(wacom); |
847 | 958 | ||
848 | default: | 959 | default: |
849 | switch (data[0]) { | 960 | switch (data[0]) { |
@@ -852,6 +963,9 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) | |||
852 | case WACOM_REPORT_TPCST: | 963 | case WACOM_REPORT_TPCST: |
853 | return wacom_tpc_single_touch(wacom, len); | 964 | return wacom_tpc_single_touch(wacom, len); |
854 | 965 | ||
966 | case WACOM_REPORT_TPCMT: | ||
967 | return wacom_mt_touch(wacom); | ||
968 | |||
855 | case WACOM_REPORT_PENABLED: | 969 | case WACOM_REPORT_PENABLED: |
856 | return wacom_tpc_pen(wacom); | 970 | return wacom_tpc_pen(wacom); |
857 | } | 971 | } |
@@ -1120,8 +1234,18 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) | |||
1120 | sync = wacom_intuos_irq(wacom_wac); | 1234 | sync = wacom_intuos_irq(wacom_wac); |
1121 | break; | 1235 | break; |
1122 | 1236 | ||
1237 | case INTUOS5S: | ||
1238 | case INTUOS5: | ||
1239 | case INTUOS5L: | ||
1240 | if (len == WACOM_PKGLEN_BBTOUCH3) | ||
1241 | sync = wacom_bpt3_touch(wacom_wac); | ||
1242 | else | ||
1243 | sync = wacom_intuos_irq(wacom_wac); | ||
1244 | break; | ||
1245 | |||
1123 | case TABLETPC: | 1246 | case TABLETPC: |
1124 | case TABLETPC2FG: | 1247 | case TABLETPC2FG: |
1248 | case MTSCREEN: | ||
1125 | sync = wacom_tpc_irq(wacom_wac, len); | 1249 | sync = wacom_tpc_irq(wacom_wac, len); |
1126 | break; | 1250 | break; |
1127 | 1251 | ||
@@ -1194,7 +1318,9 @@ void wacom_setup_device_quirks(struct wacom_features *features) | |||
1194 | 1318 | ||
1195 | /* these device have multiple inputs */ | 1319 | /* these device have multiple inputs */ |
1196 | if (features->type == TABLETPC || features->type == TABLETPC2FG || | 1320 | if (features->type == TABLETPC || features->type == TABLETPC2FG || |
1197 | features->type == BAMBOO_PT || features->type == WIRELESS) | 1321 | features->type == BAMBOO_PT || features->type == WIRELESS || |
1322 | (features->type >= INTUOS5S && features->type <= INTUOS5L) || | ||
1323 | features->type == MTSCREEN) | ||
1198 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; | 1324 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; |
1199 | 1325 | ||
1200 | /* quirk for bamboo touch with 2 low res touches */ | 1326 | /* quirk for bamboo touch with 2 low res touches */ |
@@ -1225,8 +1351,8 @@ static unsigned int wacom_calculate_touch_res(unsigned int logical_max, | |||
1225 | return (logical_max * 100) / physical_max; | 1351 | return (logical_max * 100) / physical_max; |
1226 | } | 1352 | } |
1227 | 1353 | ||
1228 | void wacom_setup_input_capabilities(struct input_dev *input_dev, | 1354 | int wacom_setup_input_capabilities(struct input_dev *input_dev, |
1229 | struct wacom_wac *wacom_wac) | 1355 | struct wacom_wac *wacom_wac) |
1230 | { | 1356 | { |
1231 | struct wacom_features *features = &wacom_wac->features; | 1357 | struct wacom_features *features = &wacom_wac->features; |
1232 | int i; | 1358 | int i; |
@@ -1361,6 +1487,50 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1361 | wacom_setup_intuos(wacom_wac); | 1487 | wacom_setup_intuos(wacom_wac); |
1362 | break; | 1488 | break; |
1363 | 1489 | ||
1490 | case INTUOS5: | ||
1491 | case INTUOS5L: | ||
1492 | if (features->device_type == BTN_TOOL_PEN) { | ||
1493 | __set_bit(BTN_7, input_dev->keybit); | ||
1494 | __set_bit(BTN_8, input_dev->keybit); | ||
1495 | } | ||
1496 | /* fall through */ | ||
1497 | |||
1498 | case INTUOS5S: | ||
1499 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); | ||
1500 | |||
1501 | if (features->device_type == BTN_TOOL_PEN) { | ||
1502 | for (i = 0; i < 7; i++) | ||
1503 | __set_bit(BTN_0 + i, input_dev->keybit); | ||
1504 | |||
1505 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, | ||
1506 | features->distance_max, | ||
1507 | 0, 0); | ||
1508 | |||
1509 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | ||
1510 | |||
1511 | wacom_setup_intuos(wacom_wac); | ||
1512 | } else if (features->device_type == BTN_TOOL_FINGER) { | ||
1513 | __clear_bit(ABS_MISC, input_dev->absbit); | ||
1514 | |||
1515 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); | ||
1516 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); | ||
1517 | __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit); | ||
1518 | __set_bit(BTN_TOOL_QUADTAP, input_dev->keybit); | ||
1519 | |||
1520 | input_mt_init_slots(input_dev, features->touch_max); | ||
1521 | |||
1522 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, | ||
1523 | 0, 255, 0, 0); | ||
1524 | |||
1525 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, | ||
1526 | 0, features->x_max, | ||
1527 | features->x_fuzz, 0); | ||
1528 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, | ||
1529 | 0, features->y_max, | ||
1530 | features->y_fuzz, 0); | ||
1531 | } | ||
1532 | break; | ||
1533 | |||
1364 | case INTUOS4: | 1534 | case INTUOS4: |
1365 | case INTUOS4L: | 1535 | case INTUOS4L: |
1366 | __set_bit(BTN_7, input_dev->keybit); | 1536 | __set_bit(BTN_7, input_dev->keybit); |
@@ -1378,9 +1548,19 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1378 | break; | 1548 | break; |
1379 | 1549 | ||
1380 | case TABLETPC2FG: | 1550 | case TABLETPC2FG: |
1551 | case MTSCREEN: | ||
1381 | if (features->device_type == BTN_TOOL_FINGER) { | 1552 | if (features->device_type == BTN_TOOL_FINGER) { |
1382 | 1553 | ||
1383 | input_mt_init_slots(input_dev, 2); | 1554 | wacom_wac->slots = kmalloc(features->touch_max * |
1555 | sizeof(int), | ||
1556 | GFP_KERNEL); | ||
1557 | if (!wacom_wac->slots) | ||
1558 | return -ENOMEM; | ||
1559 | |||
1560 | for (i = 0; i < features->touch_max; i++) | ||
1561 | wacom_wac->slots[i] = -1; | ||
1562 | |||
1563 | input_mt_init_slots(input_dev, features->touch_max); | ||
1384 | input_set_abs_params(input_dev, ABS_MT_TOOL_TYPE, | 1564 | input_set_abs_params(input_dev, ABS_MT_TOOL_TYPE, |
1385 | 0, MT_TOOL_MAX, 0, 0); | 1565 | 0, MT_TOOL_MAX, 0, 0); |
1386 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, | 1566 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, |
@@ -1435,6 +1615,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1435 | 1615 | ||
1436 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); | 1616 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); |
1437 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); | 1617 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); |
1618 | input_mt_init_slots(input_dev, features->touch_max); | ||
1438 | 1619 | ||
1439 | if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) { | 1620 | if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) { |
1440 | __set_bit(BTN_TOOL_TRIPLETAP, | 1621 | __set_bit(BTN_TOOL_TRIPLETAP, |
@@ -1442,13 +1623,9 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1442 | __set_bit(BTN_TOOL_QUADTAP, | 1623 | __set_bit(BTN_TOOL_QUADTAP, |
1443 | input_dev->keybit); | 1624 | input_dev->keybit); |
1444 | 1625 | ||
1445 | input_mt_init_slots(input_dev, 16); | ||
1446 | |||
1447 | input_set_abs_params(input_dev, | 1626 | input_set_abs_params(input_dev, |
1448 | ABS_MT_TOUCH_MAJOR, | 1627 | ABS_MT_TOUCH_MAJOR, |
1449 | 0, 255, 0, 0); | 1628 | 0, 255, 0, 0); |
1450 | } else { | ||
1451 | input_mt_init_slots(input_dev, 2); | ||
1452 | } | 1629 | } |
1453 | 1630 | ||
1454 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, | 1631 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, |
@@ -1468,6 +1645,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1468 | } | 1645 | } |
1469 | break; | 1646 | break; |
1470 | } | 1647 | } |
1648 | return 0; | ||
1471 | } | 1649 | } |
1472 | 1650 | ||
1473 | static const struct wacom_features wacom_features_0x00 = | 1651 | static const struct wacom_features wacom_features_0x00 = |
@@ -1635,6 +1813,24 @@ static const struct wacom_features wacom_features_0xBB = | |||
1635 | static const struct wacom_features wacom_features_0xBC = | 1813 | static const struct wacom_features wacom_features_0xBC = |
1636 | { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, | 1814 | { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, |
1637 | 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1815 | 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
1816 | static const struct wacom_features wacom_features_0x26 = | ||
1817 | { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, | ||
1818 | 63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, | ||
1819 | .touch_max = 16 }; | ||
1820 | static const struct wacom_features wacom_features_0x27 = | ||
1821 | { "Wacom Intuos5 touch M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, | ||
1822 | 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, | ||
1823 | .touch_max = 16 }; | ||
1824 | static const struct wacom_features wacom_features_0x28 = | ||
1825 | { "Wacom Intuos5 touch L", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, | ||
1826 | 63, INTUOS5L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, | ||
1827 | .touch_max = 16 }; | ||
1828 | static const struct wacom_features wacom_features_0x29 = | ||
1829 | { "Wacom Intuos5 S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, | ||
1830 | 63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | ||
1831 | static const struct wacom_features wacom_features_0x2A = | ||
1832 | { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, | ||
1833 | 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | ||
1638 | static const struct wacom_features wacom_features_0xF4 = | 1834 | static const struct wacom_features wacom_features_0xF4 = |
1639 | { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, | 1835 | { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, |
1640 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1836 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
@@ -1676,13 +1872,19 @@ static const struct wacom_features wacom_features_0x9F = | |||
1676 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1872 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
1677 | static const struct wacom_features wacom_features_0xE2 = | 1873 | static const struct wacom_features wacom_features_0xE2 = |
1678 | { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, | 1874 | { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, |
1679 | 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1875 | 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1876 | .touch_max = 2 }; | ||
1680 | static const struct wacom_features wacom_features_0xE3 = | 1877 | static const struct wacom_features wacom_features_0xE3 = |
1681 | { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, | 1878 | { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, |
1682 | 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1879 | 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1880 | .touch_max = 2 }; | ||
1881 | static const struct wacom_features wacom_features_0xE5 = | ||
1882 | { "Wacom ISDv4 E5", WACOM_PKGLEN_MTOUCH, 26202, 16325, 255, | ||
1883 | 0, MTSCREEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | ||
1683 | static const struct wacom_features wacom_features_0xE6 = | 1884 | static const struct wacom_features wacom_features_0xE6 = |
1684 | { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255, | 1885 | { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255, |
1685 | 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1886 | 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1887 | .touch_max = 2 }; | ||
1686 | static const struct wacom_features wacom_features_0xEC = | 1888 | static const struct wacom_features wacom_features_0xEC = |
1687 | { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255, | 1889 | { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255, |
1688 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1890 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
@@ -1691,19 +1893,22 @@ static const struct wacom_features wacom_features_0x47 = | |||
1691 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1893 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
1692 | static const struct wacom_features wacom_features_0x84 = | 1894 | static const struct wacom_features wacom_features_0x84 = |
1693 | { "Wacom Wireless Receiver", WACOM_PKGLEN_WIRELESS, 0, 0, 0, | 1895 | { "Wacom Wireless Receiver", WACOM_PKGLEN_WIRELESS, 0, 0, 0, |
1694 | 0, WIRELESS, 0, 0 }; | 1896 | 0, WIRELESS, 0, 0, .touch_max = 16 }; |
1695 | static const struct wacom_features wacom_features_0xD0 = | 1897 | static const struct wacom_features wacom_features_0xD0 = |
1696 | { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1898 | { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1697 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1899 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1900 | .touch_max = 2 }; | ||
1698 | static const struct wacom_features wacom_features_0xD1 = | 1901 | static const struct wacom_features wacom_features_0xD1 = |
1699 | { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1902 | { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1700 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1903 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1904 | .touch_max = 2 }; | ||
1701 | static const struct wacom_features wacom_features_0xD2 = | 1905 | static const struct wacom_features wacom_features_0xD2 = |
1702 | { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1906 | { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1703 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1907 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
1704 | static const struct wacom_features wacom_features_0xD3 = | 1908 | static const struct wacom_features wacom_features_0xD3 = |
1705 | { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, | 1909 | { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, |
1706 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1910 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1911 | .touch_max = 2 }; | ||
1707 | static const struct wacom_features wacom_features_0xD4 = | 1912 | static const struct wacom_features wacom_features_0xD4 = |
1708 | { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1913 | { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1709 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1914 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
@@ -1712,28 +1917,35 @@ static const struct wacom_features wacom_features_0xD5 = | |||
1712 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1917 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
1713 | static const struct wacom_features wacom_features_0xD6 = | 1918 | static const struct wacom_features wacom_features_0xD6 = |
1714 | { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1919 | { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1715 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1920 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1921 | .touch_max = 2 }; | ||
1716 | static const struct wacom_features wacom_features_0xD7 = | 1922 | static const struct wacom_features wacom_features_0xD7 = |
1717 | { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1923 | { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1718 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1924 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1925 | .touch_max = 2 }; | ||
1719 | static const struct wacom_features wacom_features_0xD8 = | 1926 | static const struct wacom_features wacom_features_0xD8 = |
1720 | { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, | 1927 | { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, |
1721 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1928 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1929 | .touch_max = 2 }; | ||
1722 | static const struct wacom_features wacom_features_0xDA = | 1930 | static const struct wacom_features wacom_features_0xDA = |
1723 | { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1931 | { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1724 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1932 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1933 | .touch_max = 2 }; | ||
1725 | static struct wacom_features wacom_features_0xDB = | 1934 | static struct wacom_features wacom_features_0xDB = |
1726 | { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, | 1935 | { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, |
1727 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1936 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1937 | .touch_max = 2 }; | ||
1728 | static const struct wacom_features wacom_features_0xDD = | 1938 | static const struct wacom_features wacom_features_0xDD = |
1729 | { "Wacom Bamboo Connect", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023, | 1939 | { "Wacom Bamboo Connect", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023, |
1730 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1940 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
1731 | static const struct wacom_features wacom_features_0xDE = | 1941 | static const struct wacom_features wacom_features_0xDE = |
1732 | { "Wacom Bamboo 16FG 4x5", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023, | 1942 | { "Wacom Bamboo 16FG 4x5", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023, |
1733 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1943 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1944 | .touch_max = 16 }; | ||
1734 | static const struct wacom_features wacom_features_0xDF = | 1945 | static const struct wacom_features wacom_features_0xDF = |
1735 | { "Wacom Bamboo 16FG 6x8", WACOM_PKGLEN_BBPEN, 21648, 13700, 1023, | 1946 | { "Wacom Bamboo 16FG 6x8", WACOM_PKGLEN_BBPEN, 21648, 13700, 1023, |
1736 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1947 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
1948 | .touch_max = 16 }; | ||
1737 | static const struct wacom_features wacom_features_0x6004 = | 1949 | static const struct wacom_features wacom_features_0x6004 = |
1738 | { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255, | 1950 | { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255, |
1739 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1951 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
@@ -1807,6 +2019,11 @@ const struct usb_device_id wacom_ids[] = { | |||
1807 | { USB_DEVICE_WACOM(0xBA) }, | 2019 | { USB_DEVICE_WACOM(0xBA) }, |
1808 | { USB_DEVICE_WACOM(0xBB) }, | 2020 | { USB_DEVICE_WACOM(0xBB) }, |
1809 | { USB_DEVICE_WACOM(0xBC) }, | 2021 | { USB_DEVICE_WACOM(0xBC) }, |
2022 | { USB_DEVICE_WACOM(0x26) }, | ||
2023 | { USB_DEVICE_WACOM(0x27) }, | ||
2024 | { USB_DEVICE_WACOM(0x28) }, | ||
2025 | { USB_DEVICE_WACOM(0x29) }, | ||
2026 | { USB_DEVICE_WACOM(0x2A) }, | ||
1810 | { USB_DEVICE_WACOM(0x3F) }, | 2027 | { USB_DEVICE_WACOM(0x3F) }, |
1811 | { USB_DEVICE_WACOM(0xC5) }, | 2028 | { USB_DEVICE_WACOM(0xC5) }, |
1812 | { USB_DEVICE_WACOM(0xC6) }, | 2029 | { USB_DEVICE_WACOM(0xC6) }, |
@@ -1842,6 +2059,7 @@ const struct usb_device_id wacom_ids[] = { | |||
1842 | { USB_DEVICE_WACOM(0x9F) }, | 2059 | { USB_DEVICE_WACOM(0x9F) }, |
1843 | { USB_DEVICE_WACOM(0xE2) }, | 2060 | { USB_DEVICE_WACOM(0xE2) }, |
1844 | { USB_DEVICE_WACOM(0xE3) }, | 2061 | { USB_DEVICE_WACOM(0xE3) }, |
2062 | { USB_DEVICE_WACOM(0xE5) }, | ||
1845 | { USB_DEVICE_WACOM(0xE6) }, | 2063 | { USB_DEVICE_WACOM(0xE6) }, |
1846 | { USB_DEVICE_WACOM(0xEC) }, | 2064 | { USB_DEVICE_WACOM(0xEC) }, |
1847 | { USB_DEVICE_WACOM(0x47) }, | 2065 | { USB_DEVICE_WACOM(0x47) }, |