Input: wacom - add Cintiq 21UX2 and Intuos4 WL

Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by Ping Cheng and committed by Dmitry Torokhov 3a4b4aaa 56960b36

+60 -15
-1
drivers/input/tablet/wacom_sys.c
··· 508 508 } 509 509 510 510 input_dev->name = wacom_wac->name; 511 - input_dev->name = wacom_wac->name; 512 511 input_dev->dev.parent = &intf->dev; 513 512 input_dev->open = wacom_open; 514 513 input_dev->close = wacom_close;
+59 -14
drivers/input/tablet/wacom_wac.c
··· 300 300 case 0x823: /* Intuos3 Grip Pen */ 301 301 case 0x813: /* Intuos3 Classic Pen */ 302 302 case 0x885: /* Intuos3 Marker Pen */ 303 - case 0x802: /* Intuos4 Grip Pen Eraser */ 303 + case 0x802: /* Intuos4 General Pen */ 304 304 case 0x804: /* Intuos4 Marker Pen */ 305 305 case 0x40802: /* Intuos4 Classic Pen */ 306 306 case 0x022: ··· 335 335 case 0x81b: /* Intuos3 Classic Pen Eraser */ 336 336 case 0x91b: /* Intuos3 Airbrush Eraser */ 337 337 case 0x80c: /* Intuos4 Marker Pen Eraser */ 338 - case 0x80a: /* Intuos4 Grip Pen Eraser */ 338 + case 0x80a: /* Intuos4 General Pen Eraser */ 339 339 case 0x4080a: /* Intuos4 Classic Pen Eraser */ 340 340 case 0x90a: /* Intuos4 Airbrush Eraser */ 341 341 wacom->tool[idx] = BTN_TOOL_RUBBER; ··· 355 355 } 356 356 return 1; 357 357 } 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; 358 363 359 364 /* Exit report */ 360 365 if ((data[1] & 0xfe) == 0x80) { ··· 479 474 input_report_abs(input, ABS_MISC, 0); 480 475 } 481 476 } else { 482 - input_report_key(input, BTN_0, (data[5] & 0x01)); 483 - input_report_key(input, BTN_1, (data[5] & 0x02)); 484 - input_report_key(input, BTN_2, (data[5] & 0x04)); 485 - input_report_key(input, BTN_3, (data[5] & 0x08)); 486 - input_report_key(input, BTN_4, (data[6] & 0x01)); 487 - input_report_key(input, BTN_5, (data[6] & 0x02)); 488 - input_report_key(input, BTN_6, (data[6] & 0x04)); 489 - input_report_key(input, BTN_7, (data[6] & 0x08)); 490 - input_report_key(input, BTN_8, (data[5] & 0x10)); 491 - input_report_key(input, BTN_9, (data[6] & 0x10)); 477 + if (features->type == WACOM_21UX2) { 478 + input_report_key(input, BTN_0, (data[5] & 0x01)); 479 + input_report_key(input, BTN_1, (data[6] & 0x01)); 480 + input_report_key(input, BTN_2, (data[6] & 0x02)); 481 + input_report_key(input, BTN_3, (data[6] & 0x04)); 482 + input_report_key(input, BTN_4, (data[6] & 0x08)); 483 + input_report_key(input, BTN_5, (data[6] & 0x10)); 484 + input_report_key(input, BTN_6, (data[6] & 0x20)); 485 + input_report_key(input, BTN_7, (data[6] & 0x40)); 486 + input_report_key(input, BTN_8, (data[6] & 0x80)); 487 + input_report_key(input, BTN_9, (data[7] & 0x01)); 488 + input_report_key(input, BTN_A, (data[8] & 0x01)); 489 + input_report_key(input, BTN_B, (data[8] & 0x02)); 490 + input_report_key(input, BTN_C, (data[8] & 0x04)); 491 + input_report_key(input, BTN_X, (data[8] & 0x08)); 492 + input_report_key(input, BTN_Y, (data[8] & 0x10)); 493 + input_report_key(input, BTN_Z, (data[8] & 0x20)); 494 + input_report_key(input, BTN_BASE, (data[8] & 0x40)); 495 + input_report_key(input, BTN_BASE2, (data[8] & 0x80)); 496 + } else { 497 + input_report_key(input, BTN_0, (data[5] & 0x01)); 498 + input_report_key(input, BTN_1, (data[5] & 0x02)); 499 + input_report_key(input, BTN_2, (data[5] & 0x04)); 500 + input_report_key(input, BTN_3, (data[5] & 0x08)); 501 + input_report_key(input, BTN_4, (data[6] & 0x01)); 502 + input_report_key(input, BTN_5, (data[6] & 0x02)); 503 + input_report_key(input, BTN_6, (data[6] & 0x04)); 504 + input_report_key(input, BTN_7, (data[6] & 0x08)); 505 + input_report_key(input, BTN_8, (data[5] & 0x10)); 506 + input_report_key(input, BTN_9, (data[6] & 0x10)); 507 + } 492 508 input_report_abs(input, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); 493 509 input_report_abs(input, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); 494 510 495 511 if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) | 496 - data[2] | (data[3] & 0x1f) | data[4]) { 512 + data[2] | (data[3] & 0x1f) | data[4] | data[8] | 513 + (data[7] & 0x01)) { 497 514 input_report_key(input, wacom->tool[1], 1); 498 515 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); 499 516 } else { ··· 667 640 if (!idx) 668 641 input_report_key(input, BTN_TOUCH, 1); 669 642 input_event(input, EV_MSC, MSC_SERIAL, finger); 670 - input_sync(wacom->input); 643 + input_sync(input); 671 644 672 645 wacom->last_finger = finger; 673 646 } ··· 853 826 case INTUOS4L: 854 827 case CINTIQ: 855 828 case WACOM_BEE: 829 + case WACOM_21UX2: 856 830 sync = wacom_intuos_irq(wacom_wac); 857 831 break; 858 832 ··· 948 920 __set_bit(BTN_STYLUS, input_dev->keybit); 949 921 __set_bit(BTN_STYLUS2, input_dev->keybit); 950 922 break; 923 + 924 + case WACOM_21UX2: 925 + __set_bit(BTN_A, input_dev->keybit); 926 + __set_bit(BTN_B, input_dev->keybit); 927 + __set_bit(BTN_C, input_dev->keybit); 928 + __set_bit(BTN_X, input_dev->keybit); 929 + __set_bit(BTN_Y, input_dev->keybit); 930 + __set_bit(BTN_Z, input_dev->keybit); 931 + __set_bit(BTN_BASE, input_dev->keybit); 932 + __set_bit(BTN_BASE2, input_dev->keybit); 933 + /* fall through */ 951 934 952 935 case WACOM_BEE: 953 936 __set_bit(BTN_8, input_dev->keybit); ··· 1144 1105 { "Wacom Intuos4 8x13", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, 63, INTUOS4L }; 1145 1106 static const struct wacom_features wacom_features_0xBB = 1146 1107 { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047, 63, INTUOS4L }; 1108 + static const struct wacom_features wacom_features_0xBC = 1109 + { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, 63, INTUOS4 }; 1147 1110 static const struct wacom_features wacom_features_0x3F = 1148 1111 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, 63, CINTIQ }; 1149 1112 static const struct wacom_features wacom_features_0xC5 = ··· 1154 1113 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 63, WACOM_BEE }; 1155 1114 static const struct wacom_features wacom_features_0xC7 = 1156 1115 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 0, PL }; 1116 + static const struct wacom_features wacom_features_0xCC = 1117 + { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047, 63, WACOM_21UX2 }; 1157 1118 static const struct wacom_features wacom_features_0x90 = 1158 1119 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; 1159 1120 static const struct wacom_features wacom_features_0x93 = ··· 1228 1185 { USB_DEVICE_WACOM(0xB9) }, 1229 1186 { USB_DEVICE_WACOM(0xBA) }, 1230 1187 { USB_DEVICE_WACOM(0xBB) }, 1188 + { USB_DEVICE_WACOM(0xBC) }, 1231 1189 { USB_DEVICE_WACOM(0x3F) }, 1232 1190 { USB_DEVICE_WACOM(0xC5) }, 1233 1191 { USB_DEVICE_WACOM(0xC6) }, 1234 1192 { USB_DEVICE_WACOM(0xC7) }, 1193 + { USB_DEVICE_WACOM(0xCC) }, 1235 1194 { USB_DEVICE_WACOM(0x90) }, 1236 1195 { USB_DEVICE_WACOM(0x93) }, 1237 1196 { USB_DEVICE_WACOM(0x9A) },
+1
drivers/input/tablet/wacom_wac.h
··· 50 50 INTUOS4S, 51 51 INTUOS4, 52 52 INTUOS4L, 53 + WACOM_21UX2, 53 54 CINTIQ, 54 55 WACOM_BEE, 55 56 WACOM_MO,