diff options
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 73 |
1 files changed, 59 insertions, 14 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 847fd0135bcf..d564af58175c 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -300,7 +300,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) | |||
300 | case 0x823: /* Intuos3 Grip Pen */ | 300 | case 0x823: /* Intuos3 Grip Pen */ |
301 | case 0x813: /* Intuos3 Classic Pen */ | 301 | case 0x813: /* Intuos3 Classic Pen */ |
302 | case 0x885: /* Intuos3 Marker Pen */ | 302 | case 0x885: /* Intuos3 Marker Pen */ |
303 | case 0x802: /* Intuos4 Grip Pen Eraser */ | 303 | case 0x802: /* Intuos4 General Pen */ |
304 | case 0x804: /* Intuos4 Marker Pen */ | 304 | case 0x804: /* Intuos4 Marker Pen */ |
305 | case 0x40802: /* Intuos4 Classic Pen */ | 305 | case 0x40802: /* Intuos4 Classic Pen */ |
306 | case 0x022: | 306 | case 0x022: |
@@ -335,7 +335,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) | |||
335 | case 0x81b: /* Intuos3 Classic Pen Eraser */ | 335 | case 0x81b: /* Intuos3 Classic Pen Eraser */ |
336 | case 0x91b: /* Intuos3 Airbrush Eraser */ | 336 | case 0x91b: /* Intuos3 Airbrush Eraser */ |
337 | case 0x80c: /* Intuos4 Marker Pen Eraser */ | 337 | case 0x80c: /* Intuos4 Marker Pen Eraser */ |
338 | case 0x80a: /* Intuos4 Grip Pen Eraser */ | 338 | case 0x80a: /* Intuos4 General Pen Eraser */ |
339 | case 0x4080a: /* Intuos4 Classic Pen Eraser */ | 339 | case 0x4080a: /* Intuos4 Classic Pen Eraser */ |
340 | case 0x90a: /* Intuos4 Airbrush Eraser */ | 340 | case 0x90a: /* Intuos4 Airbrush Eraser */ |
341 | wacom->tool[idx] = BTN_TOOL_RUBBER; | 341 | wacom->tool[idx] = BTN_TOOL_RUBBER; |
@@ -356,6 +356,11 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) | |||
356 | return 1; | 356 | return 1; |
357 | } | 357 | } |
358 | 358 | ||
359 | /* older I4 styli don't work with new Cintiqs */ | ||
360 | if (!((wacom->id[idx] >> 20) & 0x01) && | ||
361 | (features->type == WACOM_21UX2)) | ||
362 | return 1; | ||
363 | |||
359 | /* Exit report */ | 364 | /* Exit report */ |
360 | if ((data[1] & 0xfe) == 0x80) { | 365 | if ((data[1] & 0xfe) == 0x80) { |
361 | /* | 366 | /* |
@@ -474,21 +479,43 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
474 | input_report_abs(input, ABS_MISC, 0); | 479 | input_report_abs(input, ABS_MISC, 0); |
475 | } | 480 | } |
476 | } else { | 481 | } else { |
477 | input_report_key(input, BTN_0, (data[5] & 0x01)); | 482 | if (features->type == WACOM_21UX2) { |
478 | input_report_key(input, BTN_1, (data[5] & 0x02)); | 483 | input_report_key(input, BTN_0, (data[5] & 0x01)); |
479 | input_report_key(input, BTN_2, (data[5] & 0x04)); | 484 | input_report_key(input, BTN_1, (data[6] & 0x01)); |
480 | input_report_key(input, BTN_3, (data[5] & 0x08)); | 485 | input_report_key(input, BTN_2, (data[6] & 0x02)); |
481 | input_report_key(input, BTN_4, (data[6] & 0x01)); | 486 | input_report_key(input, BTN_3, (data[6] & 0x04)); |
482 | input_report_key(input, BTN_5, (data[6] & 0x02)); | 487 | input_report_key(input, BTN_4, (data[6] & 0x08)); |
483 | input_report_key(input, BTN_6, (data[6] & 0x04)); | 488 | input_report_key(input, BTN_5, (data[6] & 0x10)); |
484 | input_report_key(input, BTN_7, (data[6] & 0x08)); | 489 | input_report_key(input, BTN_6, (data[6] & 0x20)); |
485 | input_report_key(input, BTN_8, (data[5] & 0x10)); | 490 | input_report_key(input, BTN_7, (data[6] & 0x40)); |
486 | input_report_key(input, BTN_9, (data[6] & 0x10)); | 491 | input_report_key(input, BTN_8, (data[6] & 0x80)); |
492 | input_report_key(input, BTN_9, (data[7] & 0x01)); | ||
493 | input_report_key(input, BTN_A, (data[8] & 0x01)); | ||
494 | input_report_key(input, BTN_B, (data[8] & 0x02)); | ||
495 | input_report_key(input, BTN_C, (data[8] & 0x04)); | ||
496 | input_report_key(input, BTN_X, (data[8] & 0x08)); | ||
497 | input_report_key(input, BTN_Y, (data[8] & 0x10)); | ||
498 | input_report_key(input, BTN_Z, (data[8] & 0x20)); | ||
499 | input_report_key(input, BTN_BASE, (data[8] & 0x40)); | ||
500 | input_report_key(input, BTN_BASE2, (data[8] & 0x80)); | ||
501 | } else { | ||
502 | input_report_key(input, BTN_0, (data[5] & 0x01)); | ||
503 | input_report_key(input, BTN_1, (data[5] & 0x02)); | ||
504 | input_report_key(input, BTN_2, (data[5] & 0x04)); | ||
505 | input_report_key(input, BTN_3, (data[5] & 0x08)); | ||
506 | input_report_key(input, BTN_4, (data[6] & 0x01)); | ||
507 | input_report_key(input, BTN_5, (data[6] & 0x02)); | ||
508 | input_report_key(input, BTN_6, (data[6] & 0x04)); | ||
509 | input_report_key(input, BTN_7, (data[6] & 0x08)); | ||
510 | input_report_key(input, BTN_8, (data[5] & 0x10)); | ||
511 | input_report_key(input, BTN_9, (data[6] & 0x10)); | ||
512 | } | ||
487 | input_report_abs(input, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); | 513 | input_report_abs(input, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); |
488 | input_report_abs(input, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); | 514 | input_report_abs(input, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); |
489 | 515 | ||
490 | if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) | | 516 | if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) | |
491 | data[2] | (data[3] & 0x1f) | data[4]) { | 517 | data[2] | (data[3] & 0x1f) | data[4] | data[8] | |
518 | (data[7] & 0x01)) { | ||
492 | input_report_key(input, wacom->tool[1], 1); | 519 | input_report_key(input, wacom->tool[1], 1); |
493 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); | 520 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); |
494 | } else { | 521 | } else { |
@@ -640,7 +667,7 @@ static void wacom_tpc_finger_in(struct wacom_wac *wacom, char *data, int idx) | |||
640 | if (!idx) | 667 | if (!idx) |
641 | input_report_key(input, BTN_TOUCH, 1); | 668 | input_report_key(input, BTN_TOUCH, 1); |
642 | input_event(input, EV_MSC, MSC_SERIAL, finger); | 669 | input_event(input, EV_MSC, MSC_SERIAL, finger); |
643 | input_sync(wacom->input); | 670 | input_sync(input); |
644 | 671 | ||
645 | wacom->last_finger = finger; | 672 | wacom->last_finger = finger; |
646 | } | 673 | } |
@@ -826,6 +853,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) | |||
826 | case INTUOS4L: | 853 | case INTUOS4L: |
827 | case CINTIQ: | 854 | case CINTIQ: |
828 | case WACOM_BEE: | 855 | case WACOM_BEE: |
856 | case WACOM_21UX2: | ||
829 | sync = wacom_intuos_irq(wacom_wac); | 857 | sync = wacom_intuos_irq(wacom_wac); |
830 | break; | 858 | break; |
831 | 859 | ||
@@ -921,6 +949,17 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
921 | __set_bit(BTN_STYLUS2, input_dev->keybit); | 949 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
922 | break; | 950 | break; |
923 | 951 | ||
952 | case WACOM_21UX2: | ||
953 | __set_bit(BTN_A, input_dev->keybit); | ||
954 | __set_bit(BTN_B, input_dev->keybit); | ||
955 | __set_bit(BTN_C, input_dev->keybit); | ||
956 | __set_bit(BTN_X, input_dev->keybit); | ||
957 | __set_bit(BTN_Y, input_dev->keybit); | ||
958 | __set_bit(BTN_Z, input_dev->keybit); | ||
959 | __set_bit(BTN_BASE, input_dev->keybit); | ||
960 | __set_bit(BTN_BASE2, input_dev->keybit); | ||
961 | /* fall through */ | ||
962 | |||
924 | case WACOM_BEE: | 963 | case WACOM_BEE: |
925 | __set_bit(BTN_8, input_dev->keybit); | 964 | __set_bit(BTN_8, input_dev->keybit); |
926 | __set_bit(BTN_9, input_dev->keybit); | 965 | __set_bit(BTN_9, input_dev->keybit); |
@@ -1105,6 +1144,8 @@ static const struct wacom_features wacom_features_0xBA = | |||
1105 | { "Wacom Intuos4 8x13", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, 63, INTUOS4L }; | 1144 | { "Wacom Intuos4 8x13", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, 63, INTUOS4L }; |
1106 | static const struct wacom_features wacom_features_0xBB = | 1145 | static const struct wacom_features wacom_features_0xBB = |
1107 | { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047, 63, INTUOS4L }; | 1146 | { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047, 63, INTUOS4L }; |
1147 | static const struct wacom_features wacom_features_0xBC = | ||
1148 | { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, 63, INTUOS4 }; | ||
1108 | static const struct wacom_features wacom_features_0x3F = | 1149 | static const struct wacom_features wacom_features_0x3F = |
1109 | { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, 63, CINTIQ }; | 1150 | { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, 63, CINTIQ }; |
1110 | static const struct wacom_features wacom_features_0xC5 = | 1151 | static const struct wacom_features wacom_features_0xC5 = |
@@ -1113,6 +1154,8 @@ static const struct wacom_features wacom_features_0xC6 = | |||
1113 | { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 63, WACOM_BEE }; | 1154 | { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 63, WACOM_BEE }; |
1114 | static const struct wacom_features wacom_features_0xC7 = | 1155 | static const struct wacom_features wacom_features_0xC7 = |
1115 | { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 0, PL }; | 1156 | { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 0, PL }; |
1157 | static const struct wacom_features wacom_features_0xCC = | ||
1158 | { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047, 63, WACOM_21UX2 }; | ||
1116 | static const struct wacom_features wacom_features_0x90 = | 1159 | static const struct wacom_features wacom_features_0x90 = |
1117 | { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; | 1160 | { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; |
1118 | static const struct wacom_features wacom_features_0x93 = | 1161 | static const struct wacom_features wacom_features_0x93 = |
@@ -1185,10 +1228,12 @@ const struct usb_device_id wacom_ids[] = { | |||
1185 | { USB_DEVICE_WACOM(0xB9) }, | 1228 | { USB_DEVICE_WACOM(0xB9) }, |
1186 | { USB_DEVICE_WACOM(0xBA) }, | 1229 | { USB_DEVICE_WACOM(0xBA) }, |
1187 | { USB_DEVICE_WACOM(0xBB) }, | 1230 | { USB_DEVICE_WACOM(0xBB) }, |
1231 | { USB_DEVICE_WACOM(0xBC) }, | ||
1188 | { USB_DEVICE_WACOM(0x3F) }, | 1232 | { USB_DEVICE_WACOM(0x3F) }, |
1189 | { USB_DEVICE_WACOM(0xC5) }, | 1233 | { USB_DEVICE_WACOM(0xC5) }, |
1190 | { USB_DEVICE_WACOM(0xC6) }, | 1234 | { USB_DEVICE_WACOM(0xC6) }, |
1191 | { USB_DEVICE_WACOM(0xC7) }, | 1235 | { USB_DEVICE_WACOM(0xC7) }, |
1236 | { USB_DEVICE_WACOM(0xCC) }, | ||
1192 | { USB_DEVICE_WACOM(0x90) }, | 1237 | { USB_DEVICE_WACOM(0x90) }, |
1193 | { USB_DEVICE_WACOM(0x93) }, | 1238 | { USB_DEVICE_WACOM(0x93) }, |
1194 | { USB_DEVICE_WACOM(0x9A) }, | 1239 | { USB_DEVICE_WACOM(0x9A) }, |