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