diff options
author | Jason Gerecke <killertofu@gmail.com> | 2012-04-03 18:47:22 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-04-04 12:25:41 -0400 |
commit | 9fee619505bdb202c9f54b58ec996884160cdbf2 (patch) | |
tree | 2ad56f5beb853f63a6c95a92ac0b98dc408bb88e /drivers/input/tablet/wacom_wac.c | |
parent | b3571400395e318306165eabbfbe05a4c3e4366c (diff) |
Input: wacom - add basic Intuos5 support
This patch adds support for the basic pen functions of Intuos5
tablets.
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Tested-by: Timo Aaltonen <tjaalton@ubuntu.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 99fb6fed2bf3..20ab3645a117 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -452,6 +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 >= INTUOS5S && features->type <= INTUOS5L) || | ||
455 | features->type == WACOM_21UX2 || features->type == WACOM_24HD) { | 456 | features->type == WACOM_21UX2 || features->type == WACOM_24HD) { |
456 | t = (t << 1) | (data[1] & 1); | 457 | t = (t << 1) | (data[1] & 1); |
457 | } | 458 | } |
@@ -632,7 +633,9 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
632 | (features->type == INTUOS3 || | 633 | (features->type == INTUOS3 || |
633 | features->type == INTUOS3S || | 634 | features->type == INTUOS3S || |
634 | features->type == INTUOS4 || | 635 | features->type == INTUOS4 || |
635 | features->type == INTUOS4S)) { | 636 | features->type == INTUOS4S || |
637 | features->type == INTUOS5 || | ||
638 | features->type == INTUOS5S)) { | ||
636 | 639 | ||
637 | return 0; | 640 | return 0; |
638 | } | 641 | } |
@@ -685,7 +688,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
685 | 688 | ||
686 | } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) { | 689 | } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) { |
687 | /* I4 mouse */ | 690 | /* I4 mouse */ |
688 | if (features->type >= INTUOS4S && features->type <= INTUOS4L) { | 691 | if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || |
692 | (features->type >= INTUOS5S && features->type <= INTUOS5L)) { | ||
689 | input_report_key(input, BTN_LEFT, data[6] & 0x01); | 693 | input_report_key(input, BTN_LEFT, data[6] & 0x01); |
690 | input_report_key(input, BTN_MIDDLE, data[6] & 0x02); | 694 | input_report_key(input, BTN_MIDDLE, data[6] & 0x02); |
691 | input_report_key(input, BTN_RIGHT, data[6] & 0x04); | 695 | input_report_key(input, BTN_RIGHT, data[6] & 0x04); |
@@ -712,7 +716,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
712 | } | 716 | } |
713 | } | 717 | } |
714 | } else if ((features->type < INTUOS3S || features->type == INTUOS3L || | 718 | } else if ((features->type < INTUOS3S || features->type == INTUOS3L || |
715 | features->type == INTUOS4L) && | 719 | features->type == INTUOS4L || features->type == INTUOS5L) && |
716 | wacom->tool[idx] == BTN_TOOL_LENS) { | 720 | wacom->tool[idx] == BTN_TOOL_LENS) { |
717 | /* Lens cursor packets */ | 721 | /* Lens cursor packets */ |
718 | input_report_key(input, BTN_LEFT, data[8] & 0x01); | 722 | input_report_key(input, BTN_LEFT, data[8] & 0x01); |
@@ -1107,6 +1111,9 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) | |||
1107 | case INTUOS4S: | 1111 | case INTUOS4S: |
1108 | case INTUOS4: | 1112 | case INTUOS4: |
1109 | case INTUOS4L: | 1113 | case INTUOS4L: |
1114 | case INTUOS5S: | ||
1115 | case INTUOS5: | ||
1116 | case INTUOS5L: | ||
1110 | case CINTIQ: | 1117 | case CINTIQ: |
1111 | case WACOM_BEE: | 1118 | case WACOM_BEE: |
1112 | case WACOM_21UX2: | 1119 | case WACOM_21UX2: |
@@ -1355,12 +1362,15 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1355 | wacom_setup_intuos(wacom_wac); | 1362 | wacom_setup_intuos(wacom_wac); |
1356 | break; | 1363 | break; |
1357 | 1364 | ||
1365 | case INTUOS5: | ||
1366 | case INTUOS5L: | ||
1358 | case INTUOS4: | 1367 | case INTUOS4: |
1359 | case INTUOS4L: | 1368 | case INTUOS4L: |
1360 | __set_bit(BTN_7, input_dev->keybit); | 1369 | __set_bit(BTN_7, input_dev->keybit); |
1361 | __set_bit(BTN_8, input_dev->keybit); | 1370 | __set_bit(BTN_8, input_dev->keybit); |
1362 | /* fall through */ | 1371 | /* fall through */ |
1363 | 1372 | ||
1373 | case INTUOS5S: | ||
1364 | case INTUOS4S: | 1374 | case INTUOS4S: |
1365 | for (i = 0; i < 7; i++) | 1375 | for (i = 0; i < 7; i++) |
1366 | __set_bit(BTN_0 + i, input_dev->keybit); | 1376 | __set_bit(BTN_0 + i, input_dev->keybit); |
@@ -1629,6 +1639,21 @@ static const struct wacom_features wacom_features_0xBB = | |||
1629 | static const struct wacom_features wacom_features_0xBC = | 1639 | static const struct wacom_features wacom_features_0xBC = |
1630 | { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, | 1640 | { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, |
1631 | 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1641 | 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
1642 | static const struct wacom_features wacom_features_0x26 = | ||
1643 | { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, | ||
1644 | 63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | ||
1645 | static const struct wacom_features wacom_features_0x27 = | ||
1646 | { "Wacom Intuos5 touch M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, | ||
1647 | 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | ||
1648 | static const struct wacom_features wacom_features_0x28 = | ||
1649 | { "Wacom Intuos5 touch L", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, | ||
1650 | 63, INTUOS5L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | ||
1651 | static const struct wacom_features wacom_features_0x29 = | ||
1652 | { "Wacom Intuos5 S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, | ||
1653 | 63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | ||
1654 | static const struct wacom_features wacom_features_0x2A = | ||
1655 | { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, | ||
1656 | 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | ||
1632 | static const struct wacom_features wacom_features_0xF4 = | 1657 | static const struct wacom_features wacom_features_0xF4 = |
1633 | { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, | 1658 | { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, |
1634 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1659 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
@@ -1801,6 +1826,11 @@ const struct usb_device_id wacom_ids[] = { | |||
1801 | { USB_DEVICE_WACOM(0xBA) }, | 1826 | { USB_DEVICE_WACOM(0xBA) }, |
1802 | { USB_DEVICE_WACOM(0xBB) }, | 1827 | { USB_DEVICE_WACOM(0xBB) }, |
1803 | { USB_DEVICE_WACOM(0xBC) }, | 1828 | { USB_DEVICE_WACOM(0xBC) }, |
1829 | { USB_DEVICE_WACOM(0x26) }, | ||
1830 | { USB_DEVICE_WACOM(0x27) }, | ||
1831 | { USB_DEVICE_WACOM(0x28) }, | ||
1832 | { USB_DEVICE_WACOM(0x29) }, | ||
1833 | { USB_DEVICE_WACOM(0x2A) }, | ||
1804 | { USB_DEVICE_WACOM(0x3F) }, | 1834 | { USB_DEVICE_WACOM(0x3F) }, |
1805 | { USB_DEVICE_WACOM(0xC5) }, | 1835 | { USB_DEVICE_WACOM(0xC5) }, |
1806 | { USB_DEVICE_WACOM(0xC6) }, | 1836 | { USB_DEVICE_WACOM(0xC6) }, |