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