aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2013-09-20 12:47:35 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-09-20 12:58:51 -0400
commit36d3c510e6f0a05d6aec6bc54eb708bc6f01c3b4 (patch)
treef0036aeb087a665535e0a89dbf9cb0d38ffd0a64 /drivers/input
parentc7c8b533c7be077acf6cfee6d0f83ca57b55a19a (diff)
Input: wacom - support EMR and MFT sensors of Cintiq Companion Hybrid
Adds support for the sensors integrated in to the Cintiq Companion Hybrid. These sensors use by-and-large the same protocol as the Cintiq 24HD touch. NOTE: The ExpressKeys on the Cintiq Companion Hybrid are wired to both the EMR controller and CPU GPIO pins. It may be necessary to disable their functionality in this driver if building a custom Android kernel for this device (lest two events be sent to userspace for every button press). Signed-off-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/tablet/wacom_sys.c2
-rw-r--r--drivers/input/tablet/wacom_wac.c46
-rw-r--r--drivers/input/tablet/wacom_wac.h1
3 files changed, 47 insertions, 2 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 79b69ea47f74..7e4cc2fd83e4 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -548,7 +548,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
548 /* MT Tablet PC touch */ 548 /* MT Tablet PC touch */
549 return wacom_set_device_mode(intf, 3, 4, 4); 549 return wacom_set_device_mode(intf, 3, 4, 4);
550 } 550 }
551 else if (features->type == WACOM_24HDT) { 551 else if (features->type == WACOM_24HDT || features->type == CINTIQ_HYBRID) {
552 return wacom_set_device_mode(intf, 18, 3, 2); 552 return wacom_set_device_mode(intf, 18, 3, 2);
553 } 553 }
554 } else if (features->device_type == BTN_TOOL_PEN) { 554 } else if (features->device_type == BTN_TOOL_PEN) {
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index b2aa503c16b1..45984afb040d 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -477,7 +477,7 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
477 /* general pen packet */ 477 /* general pen packet */
478 if ((data[1] & 0xb8) == 0xa0) { 478 if ((data[1] & 0xb8) == 0xa0) {
479 t = (data[6] << 2) | ((data[7] >> 6) & 3); 479 t = (data[6] << 2) | ((data[7] >> 6) & 3);
480 if (features->type >= INTUOS4S && features->type <= WACOM_24HD) { 480 if (features->type >= INTUOS4S && features->type <= CINTIQ_HYBRID) {
481 t = (t << 1) | (data[1] & 1); 481 t = (t << 1) | (data[1] & 1);
482 } 482 }
483 input_report_abs(input, ABS_PRESSURE, t); 483 input_report_abs(input, ABS_PRESSURE, t);
@@ -621,6 +621,22 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
621 } else { 621 } else {
622 input_report_abs(input, ABS_MISC, 0); 622 input_report_abs(input, ABS_MISC, 0);
623 } 623 }
624 } else if (features->type == CINTIQ_HYBRID) {
625 /*
626 * Do not send hardware buttons under Android. They
627 * are already sent to the system through GPIO (and
628 * have different meaning).
629 */
630 input_report_key(input, BTN_1, (data[4] & 0x01));
631 input_report_key(input, BTN_2, (data[4] & 0x02));
632 input_report_key(input, BTN_3, (data[4] & 0x04));
633 input_report_key(input, BTN_4, (data[4] & 0x08));
634
635 input_report_key(input, BTN_5, (data[4] & 0x10)); /* Right */
636 input_report_key(input, BTN_6, (data[4] & 0x20)); /* Up */
637 input_report_key(input, BTN_7, (data[4] & 0x40)); /* Left */
638 input_report_key(input, BTN_8, (data[4] & 0x80)); /* Down */
639 input_report_key(input, BTN_0, (data[3] & 0x01)); /* Center */
624 } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) { 640 } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
625 int i; 641 int i;
626 642
@@ -1327,6 +1343,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1327 case WACOM_22HD: 1343 case WACOM_22HD:
1328 case WACOM_24HD: 1344 case WACOM_24HD:
1329 case DTK: 1345 case DTK:
1346 case CINTIQ_HYBRID:
1330 sync = wacom_intuos_irq(wacom_wac); 1347 sync = wacom_intuos_irq(wacom_wac);
1331 break; 1348 break;
1332 1349
@@ -1765,6 +1782,24 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1765 0, 0); 1782 0, 0);
1766 } 1783 }
1767 break; 1784 break;
1785
1786 case CINTIQ_HYBRID:
1787 __set_bit(BTN_1, input_dev->keybit);
1788 __set_bit(BTN_2, input_dev->keybit);
1789 __set_bit(BTN_3, input_dev->keybit);
1790 __set_bit(BTN_4, input_dev->keybit);
1791
1792 __set_bit(BTN_5, input_dev->keybit);
1793 __set_bit(BTN_6, input_dev->keybit);
1794 __set_bit(BTN_7, input_dev->keybit);
1795 __set_bit(BTN_8, input_dev->keybit);
1796 __set_bit(BTN_0, input_dev->keybit);
1797
1798 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1799 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1800
1801 wacom_setup_cintiq(wacom_wac);
1802 break;
1768 } 1803 }
1769 return 0; 1804 return 0;
1770} 1805}
@@ -2125,6 +2160,13 @@ static const struct wacom_features wacom_features_0x301 =
2125static const struct wacom_features wacom_features_0x6004 = 2160static const struct wacom_features wacom_features_0x6004 =
2126 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255, 2161 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
2127 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2162 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
2163static const struct wacom_features wacom_features_0x0307 =
2164 { "Wacom ISDv5 307", WACOM_PKGLEN_INTUOS, 59552, 33848, 2047,
2165 63, CINTIQ_HYBRID, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
2166 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x309 };
2167static const struct wacom_features wacom_features_0x0309 =
2168 { "Wacom ISDv5 309", .type = WACOM_24HDT, /* Touch */
2169 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x0307, .touch_max = 10 };
2128 2170
2129#define USB_DEVICE_WACOM(prod) \ 2171#define USB_DEVICE_WACOM(prod) \
2130 USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ 2172 USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
@@ -2257,6 +2299,8 @@ const struct usb_device_id wacom_ids[] = {
2257 { USB_DEVICE_WACOM(0xF8) }, 2299 { USB_DEVICE_WACOM(0xF8) },
2258 { USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) }, 2300 { USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) },
2259 { USB_DEVICE_WACOM(0xFA) }, 2301 { USB_DEVICE_WACOM(0xFA) },
2302 { USB_DEVICE_WACOM(0x0307) },
2303 { USB_DEVICE_DETAILED(0x0309, USB_CLASS_HID, 0, 0) },
2260 { USB_DEVICE_LENOVO(0x6004) }, 2304 { USB_DEVICE_LENOVO(0x6004) },
2261 { } 2305 { }
2262}; 2306};
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index dfc9e08e7f70..90ce10dadb33 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -80,6 +80,7 @@ enum {
80 WACOM_22HD, 80 WACOM_22HD,
81 DTK, 81 DTK,
82 WACOM_24HD, 82 WACOM_24HD,
83 CINTIQ_HYBRID,
83 CINTIQ, 84 CINTIQ,
84 WACOM_BEE, 85 WACOM_BEE,
85 WACOM_13HD, 86 WACOM_13HD,