diff options
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 89a96427faa0..cecd35c8f0b3 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -1044,6 +1044,35 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) | |||
1044 | return 0; | 1044 | return 0; |
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len) | ||
1048 | { | ||
1049 | unsigned char *data = wacom->data; | ||
1050 | int connected; | ||
1051 | |||
1052 | if (len != WACOM_PKGLEN_WIRELESS || data[0] != 0x80) | ||
1053 | return 0; | ||
1054 | |||
1055 | connected = data[1] & 0x01; | ||
1056 | if (connected) { | ||
1057 | int pid, battery; | ||
1058 | |||
1059 | pid = get_unaligned_be16(&data[6]); | ||
1060 | battery = data[5] & 0x3f; | ||
1061 | if (wacom->pid != pid) { | ||
1062 | wacom->pid = pid; | ||
1063 | wacom_schedule_work(wacom); | ||
1064 | } | ||
1065 | wacom->battery_capacity = battery; | ||
1066 | } else if (wacom->pid != 0) { | ||
1067 | /* disconnected while previously connected */ | ||
1068 | wacom->pid = 0; | ||
1069 | wacom_schedule_work(wacom); | ||
1070 | wacom->battery_capacity = 0; | ||
1071 | } | ||
1072 | |||
1073 | return 0; | ||
1074 | } | ||
1075 | |||
1047 | void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) | 1076 | void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) |
1048 | { | 1077 | { |
1049 | bool sync; | 1078 | bool sync; |
@@ -1094,6 +1123,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) | |||
1094 | sync = wacom_bpt_irq(wacom_wac, len); | 1123 | sync = wacom_bpt_irq(wacom_wac, len); |
1095 | break; | 1124 | break; |
1096 | 1125 | ||
1126 | case WIRELESS: | ||
1127 | sync = wacom_wireless_irq(wacom_wac, len); | ||
1128 | break; | ||
1129 | |||
1097 | default: | 1130 | default: |
1098 | sync = false; | 1131 | sync = false; |
1099 | break; | 1132 | break; |
@@ -1155,7 +1188,7 @@ void wacom_setup_device_quirks(struct wacom_features *features) | |||
1155 | 1188 | ||
1156 | /* these device have multiple inputs */ | 1189 | /* these device have multiple inputs */ |
1157 | if (features->type == TABLETPC || features->type == TABLETPC2FG || | 1190 | if (features->type == TABLETPC || features->type == TABLETPC2FG || |
1158 | features->type == BAMBOO_PT) | 1191 | features->type == BAMBOO_PT || features->type == WIRELESS) |
1159 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; | 1192 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; |
1160 | 1193 | ||
1161 | /* quirk for bamboo touch with 2 low res touches */ | 1194 | /* quirk for bamboo touch with 2 low res touches */ |
@@ -1167,6 +1200,16 @@ void wacom_setup_device_quirks(struct wacom_features *features) | |||
1167 | features->y_fuzz <<= 5; | 1200 | features->y_fuzz <<= 5; |
1168 | features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; | 1201 | features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; |
1169 | } | 1202 | } |
1203 | |||
1204 | if (features->type == WIRELESS) { | ||
1205 | |||
1206 | /* monitor never has input and pen/touch have delayed create */ | ||
1207 | features->quirks |= WACOM_QUIRK_NO_INPUT; | ||
1208 | |||
1209 | /* must be monitor interface if no device_type set */ | ||
1210 | if (!features->device_type) | ||
1211 | features->quirks |= WACOM_QUIRK_MONITOR; | ||
1212 | } | ||
1170 | } | 1213 | } |
1171 | 1214 | ||
1172 | static unsigned int wacom_calculate_touch_res(unsigned int logical_max, | 1215 | static unsigned int wacom_calculate_touch_res(unsigned int logical_max, |
@@ -1640,6 +1683,9 @@ static const struct wacom_features wacom_features_0xEC = | |||
1640 | static const struct wacom_features wacom_features_0x47 = | 1683 | static const struct wacom_features wacom_features_0x47 = |
1641 | { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, | 1684 | { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, |
1642 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1685 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
1686 | static const struct wacom_features wacom_features_0x84 = | ||
1687 | { "Wacom Wireless Receiver", WACOM_PKGLEN_WIRELESS, 0, 0, 0, | ||
1688 | 0, WIRELESS, 0, 0 }; | ||
1643 | static const struct wacom_features wacom_features_0xD0 = | 1689 | static const struct wacom_features wacom_features_0xD0 = |
1644 | { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1690 | { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1645 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1691 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
@@ -1766,6 +1812,7 @@ const struct usb_device_id wacom_ids[] = { | |||
1766 | { USB_DEVICE_DETAILED(0xCE, USB_CLASS_HID, | 1812 | { USB_DEVICE_DETAILED(0xCE, USB_CLASS_HID, |
1767 | USB_INTERFACE_SUBCLASS_BOOT, | 1813 | USB_INTERFACE_SUBCLASS_BOOT, |
1768 | USB_INTERFACE_PROTOCOL_MOUSE) }, | 1814 | USB_INTERFACE_PROTOCOL_MOUSE) }, |
1815 | { USB_DEVICE_WACOM(0x84) }, | ||
1769 | { USB_DEVICE_WACOM(0xD0) }, | 1816 | { USB_DEVICE_WACOM(0xD0) }, |
1770 | { USB_DEVICE_WACOM(0xD1) }, | 1817 | { USB_DEVICE_WACOM(0xD1) }, |
1771 | { USB_DEVICE_WACOM(0xD2) }, | 1818 | { USB_DEVICE_WACOM(0xD2) }, |