aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2011-12-12 03:11:45 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-12-12 03:14:16 -0500
commit803296b678a43005e3bc0aaa1951d211bd76a054 (patch)
tree6a7d59c4757e1c7197c11fd5cb3ada45b4087eb5 /drivers/input
parentff803ed4ddbbf9f4bbd439b5e23dc25a4e0cce7a (diff)
Input: wacom - add support for Cintiq 24HD
Adds support for the Cintiq 24HD. There are two quirks about this model that haven't been seen in prior tablets. First, a second touch ring is present on this display; it is being exposed via the ABS_THROTTLE axis. Second, three capacitive buttons at the top of the unit are available; though physically a touch strip, we report the use of these buttons with generic KEY_ events. Signed-off-by: Jason Gerecke <killertofu@gmail.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/tablet/wacom_wac.c77
-rw-r--r--drivers/input/tablet/wacom_wac.h1
2 files changed, 77 insertions, 1 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index ecfcbc8144dc..a22e7789d91b 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -452,7 +452,7 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
452 if ((data[1] & 0xb8) == 0xa0) { 452 if ((data[1] & 0xb8) == 0xa0) {
453 t = (data[6] << 2) | ((data[7] >> 6) & 3); 453 t = (data[6] << 2) | ((data[7] >> 6) & 3);
454 if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || 454 if ((features->type >= INTUOS4S && features->type <= INTUOS4L) ||
455 features->type == WACOM_21UX2) { 455 features->type == WACOM_21UX2 || features->type == WACOM_24HD) {
456 t = (t << 1) | (data[1] & 1); 456 t = (t << 1) | (data[1] & 1);
457 } 457 }
458 input_report_abs(input, ABS_PRESSURE, t); 458 input_report_abs(input, ABS_PRESSURE, t);
@@ -519,6 +519,56 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
519 input_report_key(input, wacom->tool[1], 0); 519 input_report_key(input, wacom->tool[1], 0);
520 input_report_abs(input, ABS_MISC, 0); 520 input_report_abs(input, ABS_MISC, 0);
521 } 521 }
522 } else if (features->type == WACOM_24HD) {
523 input_report_key(input, BTN_0, (data[6] & 0x01));
524 input_report_key(input, BTN_1, (data[6] & 0x02));
525 input_report_key(input, BTN_2, (data[6] & 0x04));
526 input_report_key(input, BTN_3, (data[6] & 0x08));
527 input_report_key(input, BTN_4, (data[6] & 0x10));
528 input_report_key(input, BTN_5, (data[6] & 0x20));
529 input_report_key(input, BTN_6, (data[6] & 0x40));
530 input_report_key(input, BTN_7, (data[6] & 0x80));
531 input_report_key(input, BTN_8, (data[8] & 0x01));
532 input_report_key(input, BTN_9, (data[8] & 0x02));
533 input_report_key(input, BTN_A, (data[8] & 0x04));
534 input_report_key(input, BTN_B, (data[8] & 0x08));
535 input_report_key(input, BTN_C, (data[8] & 0x10));
536 input_report_key(input, BTN_X, (data[8] & 0x20));
537 input_report_key(input, BTN_Y, (data[8] & 0x40));
538 input_report_key(input, BTN_Z, (data[8] & 0x80));
539
540 /*
541 * Three "buttons" are available on the 24HD which are
542 * physically implemented as a touchstrip. Each button
543 * is approximately 3 bits wide with a 2 bit spacing.
544 * The raw touchstrip bits are stored at:
545 * ((data[3] & 0x1f) << 8) | data[4])
546 */
547 input_report_key(input, KEY_PROG1, data[4] & 0x07);
548 input_report_key(input, KEY_PROG2, data[4] & 0xE0);
549 input_report_key(input, KEY_PROG3, data[3] & 0x1C);
550
551 if (data[1] & 0x80) {
552 input_report_abs(input, ABS_WHEEL, (data[1] & 0x7f));
553 } else {
554 /* Out of proximity, clear wheel value. */
555 input_report_abs(input, ABS_WHEEL, 0);
556 }
557
558 if (data[2] & 0x80) {
559 input_report_abs(input, ABS_THROTTLE, (data[2] & 0x7f));
560 } else {
561 /* Out of proximity, clear second wheel value. */
562 input_report_abs(input, ABS_THROTTLE, 0);
563 }
564
565 if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | data[6] | data[8]) {
566 input_report_key(input, wacom->tool[1], 1);
567 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
568 } else {
569 input_report_key(input, wacom->tool[1], 0);
570 input_report_abs(input, ABS_MISC, 0);
571 }
522 } else { 572 } else {
523 if (features->type == WACOM_21UX2) { 573 if (features->type == WACOM_21UX2) {
524 input_report_key(input, BTN_0, (data[5] & 0x01)); 574 input_report_key(input, BTN_0, (data[5] & 0x01));
@@ -1019,6 +1069,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1019 case CINTIQ: 1069 case CINTIQ:
1020 case WACOM_BEE: 1070 case WACOM_BEE:
1021 case WACOM_21UX2: 1071 case WACOM_21UX2:
1072 case WACOM_24HD:
1022 sync = wacom_intuos_irq(wacom_wac); 1073 sync = wacom_intuos_irq(wacom_wac);
1023 break; 1074 break;
1024 1075
@@ -1174,6 +1225,26 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1174 __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1225 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1175 break; 1226 break;
1176 1227
1228 case WACOM_24HD:
1229 __set_bit(BTN_A, input_dev->keybit);
1230 __set_bit(BTN_B, input_dev->keybit);
1231 __set_bit(BTN_C, input_dev->keybit);
1232 __set_bit(BTN_X, input_dev->keybit);
1233 __set_bit(BTN_Y, input_dev->keybit);
1234 __set_bit(BTN_Z, input_dev->keybit);
1235
1236 for (i = 0; i < 10; i++)
1237 __set_bit(BTN_0 + i, input_dev->keybit);
1238
1239 __set_bit(KEY_PROG1, input_dev->keybit);
1240 __set_bit(KEY_PROG2, input_dev->keybit);
1241 __set_bit(KEY_PROG3, input_dev->keybit);
1242
1243 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1244 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
1245 wacom_setup_cintiq(wacom_wac);
1246 break;
1247
1177 case WACOM_21UX2: 1248 case WACOM_21UX2:
1178 __set_bit(BTN_A, input_dev->keybit); 1249 __set_bit(BTN_A, input_dev->keybit);
1179 __set_bit(BTN_B, input_dev->keybit); 1250 __set_bit(BTN_B, input_dev->keybit);
@@ -1503,6 +1574,9 @@ static const struct wacom_features wacom_features_0xBB =
1503static const struct wacom_features wacom_features_0xBC = 1574static const struct wacom_features wacom_features_0xBC =
1504 { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, 1575 { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047,
1505 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1576 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1577static const struct wacom_features wacom_features_0xF4 =
1578 { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047,
1579 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1506static const struct wacom_features wacom_features_0x3F = 1580static const struct wacom_features wacom_features_0x3F =
1507 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, 1581 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023,
1508 63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1582 63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
@@ -1702,6 +1776,7 @@ const struct usb_device_id wacom_ids[] = {
1702 { USB_DEVICE_WACOM(0xE3) }, 1776 { USB_DEVICE_WACOM(0xE3) },
1703 { USB_DEVICE_WACOM(0xE6) }, 1777 { USB_DEVICE_WACOM(0xE6) },
1704 { USB_DEVICE_WACOM(0x47) }, 1778 { USB_DEVICE_WACOM(0x47) },
1779 { USB_DEVICE_WACOM(0xF4) },
1705 { USB_DEVICE_LENOVO(0x6004) }, 1780 { USB_DEVICE_LENOVO(0x6004) },
1706 { } 1781 { }
1707}; 1782};
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 27f1d1c203a1..050acaefee7d 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -59,6 +59,7 @@ enum {
59 INTUOS4S, 59 INTUOS4S,
60 INTUOS4, 60 INTUOS4,
61 INTUOS4L, 61 INTUOS4L,
62 WACOM_24HD,
62 WACOM_21UX2, 63 WACOM_21UX2,
63 CINTIQ, 64 CINTIQ,
64 WACOM_BEE, 65 WACOM_BEE,