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.c95
1 files changed, 71 insertions, 24 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 0bfd8cf25200..518282da6d85 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -342,10 +342,10 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
342 wacom->id[idx] = (data[2] << 4) | (data[3] >> 4) | 342 wacom->id[idx] = (data[2] << 4) | (data[3] >> 4) |
343 ((data[7] & 0x0f) << 20) | ((data[8] & 0xf0) << 12); 343 ((data[7] & 0x0f) << 20) | ((data[8] & 0xf0) << 12);
344 344
345 switch (wacom->id[idx] & 0xfffff) { 345 switch (wacom->id[idx]) {
346 case 0x812: /* Inking pen */ 346 case 0x812: /* Inking pen */
347 case 0x801: /* Intuos3 Inking pen */ 347 case 0x801: /* Intuos3 Inking pen */
348 case 0x20802: /* Intuos4 Inking Pen */ 348 case 0x120802: /* Intuos4/5 Inking Pen */
349 case 0x012: 349 case 0x012:
350 wacom->tool[idx] = BTN_TOOL_PENCIL; 350 wacom->tool[idx] = BTN_TOOL_PENCIL;
351 break; 351 break;
@@ -356,11 +356,13 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
356 case 0x823: /* Intuos3 Grip Pen */ 356 case 0x823: /* Intuos3 Grip Pen */
357 case 0x813: /* Intuos3 Classic Pen */ 357 case 0x813: /* Intuos3 Classic Pen */
358 case 0x885: /* Intuos3 Marker Pen */ 358 case 0x885: /* Intuos3 Marker Pen */
359 case 0x802: /* Intuos4 General Pen */ 359 case 0x802: /* Intuos4/5 13HD/24HD General Pen */
360 case 0x804: /* Intuos4 Marker Pen */ 360 case 0x804: /* Intuos4/5 13HD/24HD Marker Pen */
361 case 0x40802: /* Intuos4 Classic Pen */
362 case 0x18802: /* DTH2242 Grip Pen */
363 case 0x022: 361 case 0x022:
362 case 0x100804: /* Intuos4/5 13HD/24HD Art Pen */
363 case 0x140802: /* Intuos4/5 13HD/24HD Classic Pen */
364 case 0x160802: /* Cintiq 13HD Pro Pen */
365 case 0x180802: /* DTH2242 Pen */
364 wacom->tool[idx] = BTN_TOOL_PEN; 366 wacom->tool[idx] = BTN_TOOL_PEN;
365 break; 367 break;
366 368
@@ -391,10 +393,14 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
391 case 0x82b: /* Intuos3 Grip Pen Eraser */ 393 case 0x82b: /* Intuos3 Grip Pen Eraser */
392 case 0x81b: /* Intuos3 Classic Pen Eraser */ 394 case 0x81b: /* Intuos3 Classic Pen Eraser */
393 case 0x91b: /* Intuos3 Airbrush Eraser */ 395 case 0x91b: /* Intuos3 Airbrush Eraser */
394 case 0x80c: /* Intuos4 Marker Pen Eraser */ 396 case 0x80c: /* Intuos4/5 13HD/24HD Marker Pen Eraser */
395 case 0x80a: /* Intuos4 General Pen Eraser */ 397 case 0x80a: /* Intuos4/5 13HD/24HD General Pen Eraser */
396 case 0x4080a: /* Intuos4 Classic Pen Eraser */ 398 case 0x90a: /* Intuos4/5 13HD/24HD Airbrush Eraser */
397 case 0x90a: /* Intuos4 Airbrush Eraser */ 399 case 0x14080a: /* Intuos4/5 13HD/24HD Classic Pen Eraser */
400 case 0x10090a: /* Intuos4/5 13HD/24HD Airbrush Eraser */
401 case 0x10080c: /* Intuos4/5 13HD/24HD Art Pen Eraser */
402 case 0x16080a: /* Cintiq 13HD Pro Pen Eraser */
403 case 0x18080a: /* DTH2242 Eraser */
398 wacom->tool[idx] = BTN_TOOL_RUBBER; 404 wacom->tool[idx] = BTN_TOOL_RUBBER;
399 break; 405 break;
400 406
@@ -402,7 +408,8 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
402 case 0x912: 408 case 0x912:
403 case 0x112: 409 case 0x112:
404 case 0x913: /* Intuos3 Airbrush */ 410 case 0x913: /* Intuos3 Airbrush */
405 case 0x902: /* Intuos4 Airbrush */ 411 case 0x902: /* Intuos4/5 13HD/24HD Airbrush */
412 case 0x100902: /* Intuos4/5 13HD/24HD Airbrush */
406 wacom->tool[idx] = BTN_TOOL_AIRBRUSH; 413 wacom->tool[idx] = BTN_TOOL_AIRBRUSH;
407 break; 414 break;
408 415
@@ -533,10 +540,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
533 input_report_key(input, BTN_8, (data[3] & 0x80)); 540 input_report_key(input, BTN_8, (data[3] & 0x80));
534 } 541 }
535 if (data[1] | (data[2] & 0x01) | data[3]) { 542 if (data[1] | (data[2] & 0x01) | data[3]) {
536 input_report_key(input, wacom->tool[1], 1);
537 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); 543 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
538 } else { 544 } else {
539 input_report_key(input, wacom->tool[1], 0);
540 input_report_abs(input, ABS_MISC, 0); 545 input_report_abs(input, ABS_MISC, 0);
541 } 546 }
542 } else if (features->type == DTK) { 547 } else if (features->type == DTK) {
@@ -546,6 +551,26 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
546 input_report_key(input, BTN_3, (data[6] & 0x08)); 551 input_report_key(input, BTN_3, (data[6] & 0x08));
547 input_report_key(input, BTN_4, (data[6] & 0x10)); 552 input_report_key(input, BTN_4, (data[6] & 0x10));
548 input_report_key(input, BTN_5, (data[6] & 0x20)); 553 input_report_key(input, BTN_5, (data[6] & 0x20));
554 if (data[6] & 0x3f) {
555 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
556 } else {
557 input_report_abs(input, ABS_MISC, 0);
558 }
559 } else if (features->type == WACOM_13HD) {
560 input_report_key(input, BTN_0, (data[3] & 0x01));
561 input_report_key(input, BTN_1, (data[4] & 0x01));
562 input_report_key(input, BTN_2, (data[4] & 0x02));
563 input_report_key(input, BTN_3, (data[4] & 0x04));
564 input_report_key(input, BTN_4, (data[4] & 0x08));
565 input_report_key(input, BTN_5, (data[4] & 0x10));
566 input_report_key(input, BTN_6, (data[4] & 0x20));
567 input_report_key(input, BTN_7, (data[4] & 0x40));
568 input_report_key(input, BTN_8, (data[4] & 0x80));
569 if ((data[3] & 0x01) | data[4]) {
570 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
571 } else {
572 input_report_abs(input, ABS_MISC, 0);
573 }
549 } else if (features->type == WACOM_24HD) { 574 } else if (features->type == WACOM_24HD) {
550 input_report_key(input, BTN_0, (data[6] & 0x01)); 575 input_report_key(input, BTN_0, (data[6] & 0x01));
551 input_report_key(input, BTN_1, (data[6] & 0x02)); 576 input_report_key(input, BTN_1, (data[6] & 0x02));
@@ -590,10 +615,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
590 } 615 }
591 616
592 if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | data[6] | data[8]) { 617 if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | data[6] | data[8]) {
593 input_report_key(input, wacom->tool[1], 1);
594 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); 618 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
595 } else { 619 } else {
596 input_report_key(input, wacom->tool[1], 0);
597 input_report_abs(input, ABS_MISC, 0); 620 input_report_abs(input, ABS_MISC, 0);
598 } 621 }
599 } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) { 622 } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
@@ -618,10 +641,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
618 } 641 }
619 642
620 if (data[2] | (data[3] & 0x01) | data[4] | data[5]) { 643 if (data[2] | (data[3] & 0x01) | data[4] | data[5]) {
621 input_report_key(input, wacom->tool[1], 1);
622 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); 644 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
623 } else { 645 } else {
624 input_report_key(input, wacom->tool[1], 0);
625 input_report_abs(input, ABS_MISC, 0); 646 input_report_abs(input, ABS_MISC, 0);
626 } 647 }
627 } else { 648 } else {
@@ -668,10 +689,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
668 if ((data[5] & 0x1f) | data[6] | (data[1] & 0x1f) | 689 if ((data[5] & 0x1f) | data[6] | (data[1] & 0x1f) |
669 data[2] | (data[3] & 0x1f) | data[4] | data[8] | 690 data[2] | (data[3] & 0x1f) | data[4] | data[8] |
670 (data[7] & 0x01)) { 691 (data[7] & 0x01)) {
671 input_report_key(input, wacom->tool[1], 1);
672 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); 692 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
673 } else { 693 } else {
674 input_report_key(input, wacom->tool[1], 0);
675 input_report_abs(input, ABS_MISC, 0); 694 input_report_abs(input, ABS_MISC, 0);
676 } 695 }
677 } 696 }
@@ -1301,6 +1320,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1301 case INTUOS4L: 1320 case INTUOS4L:
1302 case CINTIQ: 1321 case CINTIQ:
1303 case WACOM_BEE: 1322 case WACOM_BEE:
1323 case WACOM_13HD:
1304 case WACOM_21UX2: 1324 case WACOM_21UX2:
1305 case WACOM_22HD: 1325 case WACOM_22HD:
1306 case WACOM_24HD: 1326 case WACOM_24HD:
@@ -1530,15 +1550,15 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1530 __set_bit(KEY_PROG1, input_dev->keybit); 1550 __set_bit(KEY_PROG1, input_dev->keybit);
1531 __set_bit(KEY_PROG2, input_dev->keybit); 1551 __set_bit(KEY_PROG2, input_dev->keybit);
1532 __set_bit(KEY_PROG3, input_dev->keybit); 1552 __set_bit(KEY_PROG3, input_dev->keybit);
1553
1554 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1555 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
1533 /* fall through */ 1556 /* fall through */
1534 1557
1535 case DTK: 1558 case DTK:
1536 for (i = 0; i < 6; i++) 1559 for (i = 0; i < 6; i++)
1537 __set_bit(BTN_0 + i, input_dev->keybit); 1560 __set_bit(BTN_0 + i, input_dev->keybit);
1538 1561
1539 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1540 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
1541
1542 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); 1562 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1543 1563
1544 wacom_setup_cintiq(wacom_wac); 1564 wacom_setup_cintiq(wacom_wac);
@@ -1579,6 +1599,15 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1579 wacom_setup_cintiq(wacom_wac); 1599 wacom_setup_cintiq(wacom_wac);
1580 break; 1600 break;
1581 1601
1602 case WACOM_13HD:
1603 for (i = 0; i < 9; i++)
1604 __set_bit(BTN_0 + i, input_dev->keybit);
1605
1606 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1607 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1608 wacom_setup_cintiq(wacom_wac);
1609 break;
1610
1582 case INTUOS3: 1611 case INTUOS3:
1583 case INTUOS3L: 1612 case INTUOS3L:
1584 __set_bit(BTN_4, input_dev->keybit); 1613 __set_bit(BTN_4, input_dev->keybit);
@@ -1937,7 +1966,8 @@ static const struct wacom_features wacom_features_0xF4 =
1937 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1966 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1938static const struct wacom_features wacom_features_0xF8 = 1967static const struct wacom_features wacom_features_0xF8 =
1939 { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, /* Pen */ 1968 { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, /* Pen */
1940 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 }; 1969 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
1970 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 };
1941static const struct wacom_features wacom_features_0xF6 = 1971static const struct wacom_features wacom_features_0xF6 =
1942 { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */ 1972 { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */
1943 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10 }; 1973 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10 };
@@ -1950,6 +1980,9 @@ static const struct wacom_features wacom_features_0xC5 =
1950static const struct wacom_features wacom_features_0xC6 = 1980static const struct wacom_features wacom_features_0xC6 =
1951 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 1981 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023,
1952 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1982 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1983static const struct wacom_features wacom_features_0x304 =
1984 { "Wacom Cintiq 13HD", WACOM_PKGLEN_INTUOS, 59552, 33848, 1023,
1985 63, WACOM_13HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1953static const struct wacom_features wacom_features_0xC7 = 1986static const struct wacom_features wacom_features_0xC7 =
1954 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 1987 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511,
1955 0, PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1988 0, PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -1959,6 +1992,9 @@ static const struct wacom_features wacom_features_0xCE =
1959static const struct wacom_features wacom_features_0xF0 = 1992static const struct wacom_features wacom_features_0xF0 =
1960 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511, 1993 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511,
1961 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1994 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1995static const struct wacom_features wacom_features_0x57 =
1996 { "Wacom DTK2241", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047,
1997 63, DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES};
1962static const struct wacom_features wacom_features_0x59 = /* Pen */ 1998static const struct wacom_features wacom_features_0x59 = /* Pen */
1963 { "Wacom DTH2242", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047, 1999 { "Wacom DTH2242", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047,
1964 63, DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 2000 63, DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
@@ -1972,6 +2008,13 @@ static const struct wacom_features wacom_features_0xCC =
1972static const struct wacom_features wacom_features_0xFA = 2008static const struct wacom_features wacom_features_0xFA =
1973 { "Wacom Cintiq 22HD", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047, 2009 { "Wacom Cintiq 22HD", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047,
1974 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 2010 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
2011static const struct wacom_features wacom_features_0x5B =
2012 { "Wacom Cintiq 22HDT", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047,
2013 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
2014 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5e };
2015static const struct wacom_features wacom_features_0x5E =
2016 { "Wacom Cintiq 22HDT", .type = WACOM_24HDT,
2017 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5b, .touch_max = 10 };
1975static const struct wacom_features wacom_features_0x90 = 2018static const struct wacom_features wacom_features_0x90 =
1976 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 2019 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1977 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2020 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2001,7 +2044,7 @@ static const struct wacom_features wacom_features_0xE5 =
2001static const struct wacom_features wacom_features_0xE6 = 2044static const struct wacom_features wacom_features_0xE6 =
2002 { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255, 2045 { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255,
2003 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 2046 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
2004 .touch_max = 2 }; 2047 .touch_max = 2 };
2005static const struct wacom_features wacom_features_0xEC = 2048static const struct wacom_features wacom_features_0xEC =
2006 { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255, 2049 { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255,
2007 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2050 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2143,8 +2186,11 @@ const struct usb_device_id wacom_ids[] = {
2143 { USB_DEVICE_WACOM(0x43) }, 2186 { USB_DEVICE_WACOM(0x43) },
2144 { USB_DEVICE_WACOM(0x44) }, 2187 { USB_DEVICE_WACOM(0x44) },
2145 { USB_DEVICE_WACOM(0x45) }, 2188 { USB_DEVICE_WACOM(0x45) },
2189 { USB_DEVICE_WACOM(0x57) },
2146 { USB_DEVICE_WACOM(0x59) }, 2190 { USB_DEVICE_WACOM(0x59) },
2147 { USB_DEVICE_DETAILED(0x5D, USB_CLASS_HID, 0, 0) }, 2191 { USB_DEVICE_DETAILED(0x5D, USB_CLASS_HID, 0, 0) },
2192 { USB_DEVICE_WACOM(0x5B) },
2193 { USB_DEVICE_DETAILED(0x5E, USB_CLASS_HID, 0, 0) },
2148 { USB_DEVICE_WACOM(0xB0) }, 2194 { USB_DEVICE_WACOM(0xB0) },
2149 { USB_DEVICE_WACOM(0xB1) }, 2195 { USB_DEVICE_WACOM(0xB1) },
2150 { USB_DEVICE_WACOM(0xB2) }, 2196 { USB_DEVICE_WACOM(0xB2) },
@@ -2205,6 +2251,7 @@ const struct usb_device_id wacom_ids[] = {
2205 { USB_DEVICE_WACOM(0x100) }, 2251 { USB_DEVICE_WACOM(0x100) },
2206 { USB_DEVICE_WACOM(0x101) }, 2252 { USB_DEVICE_WACOM(0x101) },
2207 { USB_DEVICE_WACOM(0x10D) }, 2253 { USB_DEVICE_WACOM(0x10D) },
2254 { USB_DEVICE_WACOM(0x304) },
2208 { USB_DEVICE_WACOM(0x4001) }, 2255 { USB_DEVICE_WACOM(0x4001) },
2209 { USB_DEVICE_WACOM(0x47) }, 2256 { USB_DEVICE_WACOM(0x47) },
2210 { USB_DEVICE_WACOM(0xF4) }, 2257 { USB_DEVICE_WACOM(0xF4) },