aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_wac.c
diff options
context:
space:
mode:
authorChris Bagwell <chris@cnpbagwell.com>2012-03-26 02:26:11 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-03-26 02:31:32 -0400
commitd3825d51c3eddb8a3c7d1281f27181aff6db19b8 (patch)
treeb493c50841f11e097ddcf45f462b6da764ba1c64 /drivers/input/tablet/wacom_wac.c
parent3aac0ef10bf5c76ba4262cfd9b044a6c067d5aae (diff)
Input: wacom - wireless monitor framework
The 3rd gen Bamboo Pen & Touch and Intuos5 tablets support an optional wireless module. When its receiver is plugged into USB, it presents 3 interfaces: 0) Monitor 1) Pen and 2) Touch. The exact capabilities of the Pen and Touch interfaces can not be determined until a tablet connection is established and reported over the Monitor interface. This patch detects this wireless receiver and enables interrupt packets to be processed for the Monitor interface. Processing the data in packets will be left to another patch. Since it doesn't make sense to create an input device for the Monitor interface, it is not created. Creation of Pen and Touch input device is also delayed until monitor packets can be processed. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Tested-by: Jason Gerecke <killertofu@gmail.com> Acked-by: Ping Cheng <pingc@wacom.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.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 07a1f218b5c..6264e6a8d51 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1044,6 +1044,14 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
1044 return 0; 1044 return 0;
1045} 1045}
1046 1046
1047static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
1048{
1049 if (len != WACOM_PKGLEN_WIRELESS)
1050 return 0;
1051
1052 return 0;
1053}
1054
1047void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) 1055void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1048{ 1056{
1049 bool sync; 1057 bool sync;
@@ -1094,6 +1102,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1094 sync = wacom_bpt_irq(wacom_wac, len); 1102 sync = wacom_bpt_irq(wacom_wac, len);
1095 break; 1103 break;
1096 1104
1105 case WIRELESS:
1106 sync = wacom_wireless_irq(wacom_wac, len);
1107 break;
1108
1097 default: 1109 default:
1098 sync = false; 1110 sync = false;
1099 break; 1111 break;
@@ -1155,7 +1167,7 @@ void wacom_setup_device_quirks(struct wacom_features *features)
1155 1167
1156 /* these device have multiple inputs */ 1168 /* these device have multiple inputs */
1157 if (features->type == TABLETPC || features->type == TABLETPC2FG || 1169 if (features->type == TABLETPC || features->type == TABLETPC2FG ||
1158 features->type == BAMBOO_PT) 1170 features->type == BAMBOO_PT || features->type == WIRELESS)
1159 features->quirks |= WACOM_QUIRK_MULTI_INPUT; 1171 features->quirks |= WACOM_QUIRK_MULTI_INPUT;
1160 1172
1161 /* quirk for bamboo touch with 2 low res touches */ 1173 /* quirk for bamboo touch with 2 low res touches */
@@ -1167,6 +1179,16 @@ void wacom_setup_device_quirks(struct wacom_features *features)
1167 features->y_fuzz <<= 5; 1179 features->y_fuzz <<= 5;
1168 features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; 1180 features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES;
1169 } 1181 }
1182
1183 if (features->type == WIRELESS) {
1184
1185 /* monitor never has input and pen/touch have delayed create */
1186 features->quirks |= WACOM_QUIRK_NO_INPUT;
1187
1188 /* must be monitor interface if no device_type set */
1189 if (!features->device_type)
1190 features->quirks |= WACOM_QUIRK_MONITOR;
1191 }
1170} 1192}
1171 1193
1172static unsigned int wacom_calculate_touch_res(unsigned int logical_max, 1194static unsigned int wacom_calculate_touch_res(unsigned int logical_max,
@@ -1640,6 +1662,9 @@ static const struct wacom_features wacom_features_0xEC =
1640static const struct wacom_features wacom_features_0x47 = 1662static const struct wacom_features wacom_features_0x47 =
1641 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 1663 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
1642 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1664 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1665static const struct wacom_features wacom_features_0x84 =
1666 { "Wacom Wireless Receiver", WACOM_PKGLEN_WIRELESS, 0, 0, 0,
1667 0, WIRELESS, 0, 0 };
1643static const struct wacom_features wacom_features_0xD0 = 1668static const struct wacom_features wacom_features_0xD0 =
1644 { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1669 { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1645 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1670 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -1766,6 +1791,7 @@ const struct usb_device_id wacom_ids[] = {
1766 { USB_DEVICE_DETAILED(0xCE, USB_CLASS_HID, 1791 { USB_DEVICE_DETAILED(0xCE, USB_CLASS_HID,
1767 USB_INTERFACE_SUBCLASS_BOOT, 1792 USB_INTERFACE_SUBCLASS_BOOT,
1768 USB_INTERFACE_PROTOCOL_MOUSE) }, 1793 USB_INTERFACE_PROTOCOL_MOUSE) },
1794 { USB_DEVICE_WACOM(0x84) },
1769 { USB_DEVICE_WACOM(0xD0) }, 1795 { USB_DEVICE_WACOM(0xD0) },
1770 { USB_DEVICE_WACOM(0xD1) }, 1796 { USB_DEVICE_WACOM(0xD1) },
1771 { USB_DEVICE_WACOM(0xD2) }, 1797 { USB_DEVICE_WACOM(0xD2) },