aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-07-24 15:52:23 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-25 21:53:50 -0400
commit29b4739134c73a2873adec93346f09bb76d6a794 (patch)
treefbb2527a5c99a8a613adc043dbc05417139f5050 /drivers
parentf54bc61cf7236db84939ca8827ac89737d79ef24 (diff)
Input: wacom - switch from an USB driver to a HID driver
All USB Wacom tablets are actually HID devices. For historical reasons, they are handled as plain USB devices. The current code makes more and more reference to the HID subsystem like implementing its own HID report descriptor parser to handle new devices. From the user point of view, we can transparently switch from this state to a driver handled in the HID subsystem and clean up a lot of USB specific code in the wacom.ko driver. The other benefit once the USB dependecies have been removed is that we can use a tool like uhid to make regression tests and allow further cleanup or new implementations without risking breaking current behaviors. To match the current handling of devices in wacom_wac.c, we rely on the hid_type set by usbhid. usbhid sets the hid_type to HID_TYPE_USBMOUSE when it sees a USB boot mouse protocol declared and HID_TYPE_USBNONE when the device is plain HID. There is thus a one to one matching between the list of supported devices before and after the switch from USB to HID. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Jason Gerecke <killertofu@gmail.com> Tested-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/hid-core.c10
-rw-r--r--drivers/hid/hid-wacom.c2
-rw-r--r--drivers/input/tablet/wacom.h6
-rw-r--r--drivers/input/tablet/wacom_sys.c222
-rw-r--r--drivers/input/tablet/wacom_wac.c80
-rw-r--r--drivers/input/tablet/wacom_wac.h4
6 files changed, 136 insertions, 188 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 8ed66fd1ea87..1ce751db5a7a 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -787,6 +787,15 @@ static int hid_scan_report(struct hid_device *hid)
787 /* hid-rmi should take care of them, not hid-generic */ 787 /* hid-rmi should take care of them, not hid-generic */
788 hid->group = HID_GROUP_RMI; 788 hid->group = HID_GROUP_RMI;
789 789
790 /*
791 * Vendor specific handlings
792 */
793 switch (hid->vendor) {
794 case USB_VENDOR_ID_WACOM:
795 hid->group = HID_GROUP_WACOM;
796 break;
797 }
798
790 vfree(parser); 799 vfree(parser);
791 return 0; 800 return 0;
792} 801}
@@ -2339,7 +2348,6 @@ static const struct hid_device_id hid_ignore_list[] = {
2339 { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) }, 2348 { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
2340 { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_CYCLOPS) }, 2349 { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_CYCLOPS) },
2341 { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LCSPEC) }, 2350 { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LCSPEC) },
2342 { HID_USB_DEVICE(USB_VENDOR_ID_WACOM, HID_ANY_ID) },
2343 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20) }, 2351 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20) },
2344 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) }, 2352 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) },
2345 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) }, 2353 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) },
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 902013ec041b..4874f4ec43f5 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -960,7 +960,7 @@ static const struct hid_device_id wacom_devices[] = {
960MODULE_DEVICE_TABLE(hid, wacom_devices); 960MODULE_DEVICE_TABLE(hid, wacom_devices);
961 961
962static struct hid_driver wacom_driver = { 962static struct hid_driver wacom_driver = {
963 .name = "wacom", 963 .name = "hid-wacom",
964 .id_table = wacom_devices, 964 .id_table = wacom_devices,
965 .probe = wacom_probe, 965 .probe = wacom_probe,
966 .remove = wacom_remove, 966 .remove = wacom_remove,
diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
index caa59cab2c5f..b9212390db71 100644
--- a/drivers/input/tablet/wacom.h
+++ b/drivers/input/tablet/wacom.h
@@ -106,14 +106,12 @@ MODULE_LICENSE(DRIVER_LICENSE);
106#define USB_VENDOR_ID_LENOVO 0x17ef 106#define USB_VENDOR_ID_LENOVO 0x17ef
107 107
108struct wacom { 108struct wacom {
109 dma_addr_t data_dma;
110 struct usb_device *usbdev; 109 struct usb_device *usbdev;
111 struct usb_interface *intf; 110 struct usb_interface *intf;
112 struct urb *irq;
113 struct wacom_wac wacom_wac; 111 struct wacom_wac wacom_wac;
112 struct hid_device *hdev;
114 struct mutex lock; 113 struct mutex lock;
115 struct work_struct work; 114 struct work_struct work;
116 bool open;
117 char phys[32]; 115 char phys[32];
118 struct wacom_led { 116 struct wacom_led {
119 u8 select[2]; /* status led selector (0..3) */ 117 u8 select[2]; /* status led selector (0..3) */
@@ -130,7 +128,7 @@ static inline void wacom_schedule_work(struct wacom_wac *wacom_wac)
130 schedule_work(&wacom->work); 128 schedule_work(&wacom->work);
131} 129}
132 130
133extern const struct usb_device_id wacom_ids[]; 131extern const struct hid_device_id wacom_ids[];
134 132
135void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len); 133void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len);
136void wacom_setup_device_quirks(struct wacom_features *features); 134void wacom_setup_device_quirks(struct wacom_features *features);
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index c34791e7f0b9..5ceeab6e95f1 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -83,86 +83,40 @@ static int wacom_set_report(struct usb_interface *intf, u8 type, u8 id,
83 return retval; 83 return retval;
84} 84}
85 85
86static void wacom_sys_irq(struct urb *urb) 86static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
87 u8 *raw_data, int size)
87{ 88{
88 struct wacom *wacom = urb->context; 89 struct wacom *wacom = hid_get_drvdata(hdev);
89 struct device *dev = &wacom->intf->dev;
90 int retval;
91 90
92 switch (urb->status) { 91 if (size > WACOM_PKGLEN_MAX)
93 case 0: 92 return 1;
94 /* success */
95 break;
96 case -ECONNRESET:
97 case -ENOENT:
98 case -ESHUTDOWN:
99 /* this urb is terminated, clean up */
100 dev_dbg(dev, "%s - urb shutting down with status: %d\n",
101 __func__, urb->status);
102 return;
103 default:
104 dev_dbg(dev, "%s - nonzero urb status received: %d\n",
105 __func__, urb->status);
106 goto exit;
107 }
108 93
109 wacom_wac_irq(&wacom->wacom_wac, urb->actual_length); 94 memcpy(wacom->wacom_wac.data, raw_data, size);
110 95
111 exit: 96 wacom_wac_irq(&wacom->wacom_wac, size);
112 usb_mark_last_busy(wacom->usbdev); 97
113 retval = usb_submit_urb(urb, GFP_ATOMIC); 98 return 0;
114 if (retval)
115 dev_err(dev, "%s - usb_submit_urb failed with result %d\n",
116 __func__, retval);
117} 99}
118 100
119static int wacom_open(struct input_dev *dev) 101static int wacom_open(struct input_dev *dev)
120{ 102{
121 struct wacom *wacom = input_get_drvdata(dev); 103 struct wacom *wacom = input_get_drvdata(dev);
122 int retval = 0; 104 int retval;
123
124 if (usb_autopm_get_interface(wacom->intf) < 0)
125 return -EIO;
126 105
127 mutex_lock(&wacom->lock); 106 mutex_lock(&wacom->lock);
128 107 retval = hid_hw_open(wacom->hdev);
129 if (wacom->open)
130 goto out;
131
132 if (usb_submit_urb(wacom->irq, GFP_KERNEL)) {
133 retval = -EIO;
134 goto out;
135 }
136
137 wacom->open = true;
138 wacom->intf->needs_remote_wakeup = 1;
139
140out:
141 mutex_unlock(&wacom->lock); 108 mutex_unlock(&wacom->lock);
142 usb_autopm_put_interface(wacom->intf); 109
143 return retval; 110 return retval;
144} 111}
145 112
146static void wacom_close(struct input_dev *dev) 113static void wacom_close(struct input_dev *dev)
147{ 114{
148 struct wacom *wacom = input_get_drvdata(dev); 115 struct wacom *wacom = input_get_drvdata(dev);
149 int autopm_error;
150
151 autopm_error = usb_autopm_get_interface(wacom->intf);
152 116
153 mutex_lock(&wacom->lock); 117 mutex_lock(&wacom->lock);
154 if (!wacom->open) 118 hid_hw_close(wacom->hdev);
155 goto out;
156
157 usb_kill_urb(wacom->irq);
158 wacom->open = false;
159 wacom->intf->needs_remote_wakeup = 0;
160
161out:
162 mutex_unlock(&wacom->lock); 119 mutex_unlock(&wacom->lock);
163
164 if (!autopm_error)
165 usb_autopm_put_interface(wacom->intf);
166} 120}
167 121
168/* 122/*
@@ -807,7 +761,8 @@ out:
807static ssize_t wacom_led_select_store(struct device *dev, int set_id, 761static ssize_t wacom_led_select_store(struct device *dev, int set_id,
808 const char *buf, size_t count) 762 const char *buf, size_t count)
809{ 763{
810 struct wacom *wacom = dev_get_drvdata(dev); 764 struct hid_device *hdev = dev_get_drvdata(dev);
765 struct wacom *wacom = hid_get_drvdata(hdev);
811 unsigned int id; 766 unsigned int id;
812 int err; 767 int err;
813 768
@@ -834,7 +789,8 @@ static ssize_t wacom_led##SET_ID##_select_store(struct device *dev, \
834static ssize_t wacom_led##SET_ID##_select_show(struct device *dev, \ 789static ssize_t wacom_led##SET_ID##_select_show(struct device *dev, \
835 struct device_attribute *attr, char *buf) \ 790 struct device_attribute *attr, char *buf) \
836{ \ 791{ \
837 struct wacom *wacom = dev_get_drvdata(dev); \ 792 struct hid_device *hdev = dev_get_drvdata(dev); \
793 struct wacom *wacom = hid_get_drvdata(hdev); \
838 return snprintf(buf, 2, "%d\n", wacom->led.select[SET_ID]); \ 794 return snprintf(buf, 2, "%d\n", wacom->led.select[SET_ID]); \
839} \ 795} \
840static DEVICE_ATTR(status_led##SET_ID##_select, S_IWUSR | S_IRUSR, \ 796static DEVICE_ATTR(status_led##SET_ID##_select, S_IWUSR | S_IRUSR, \
@@ -868,7 +824,8 @@ static ssize_t wacom_luminance_store(struct wacom *wacom, u8 *dest,
868static ssize_t wacom_##name##_luminance_store(struct device *dev, \ 824static ssize_t wacom_##name##_luminance_store(struct device *dev, \
869 struct device_attribute *attr, const char *buf, size_t count) \ 825 struct device_attribute *attr, const char *buf, size_t count) \
870{ \ 826{ \
871 struct wacom *wacom = dev_get_drvdata(dev); \ 827 struct hid_device *hdev = dev_get_drvdata(dev); \
828 struct wacom *wacom = hid_get_drvdata(hdev); \
872 \ 829 \
873 return wacom_luminance_store(wacom, &wacom->led.field, \ 830 return wacom_luminance_store(wacom, &wacom->led.field, \
874 buf, count); \ 831 buf, count); \
@@ -883,7 +840,8 @@ DEVICE_LUMINANCE_ATTR(buttons, img_lum);
883static ssize_t wacom_button_image_store(struct device *dev, int button_id, 840static ssize_t wacom_button_image_store(struct device *dev, int button_id,
884 const char *buf, size_t count) 841 const char *buf, size_t count)
885{ 842{
886 struct wacom *wacom = dev_get_drvdata(dev); 843 struct hid_device *hdev = dev_get_drvdata(dev);
844 struct wacom *wacom = hid_get_drvdata(hdev);
887 int err; 845 int err;
888 846
889 if (count != 1024) 847 if (count != 1024)
@@ -1201,6 +1159,7 @@ static void wacom_wireless_work(struct work_struct *work)
1201 struct wacom *wacom = container_of(work, struct wacom, work); 1159 struct wacom *wacom = container_of(work, struct wacom, work);
1202 struct usb_device *usbdev = wacom->usbdev; 1160 struct usb_device *usbdev = wacom->usbdev;
1203 struct wacom_wac *wacom_wac = &wacom->wacom_wac; 1161 struct wacom_wac *wacom_wac = &wacom->wacom_wac;
1162 struct hid_device *hdev1, *hdev2;
1204 struct wacom *wacom1, *wacom2; 1163 struct wacom *wacom1, *wacom2;
1205 struct wacom_wac *wacom_wac1, *wacom_wac2; 1164 struct wacom_wac *wacom_wac1, *wacom_wac2;
1206 int error; 1165 int error;
@@ -1213,32 +1172,34 @@ static void wacom_wireless_work(struct work_struct *work)
1213 wacom_destroy_battery(wacom); 1172 wacom_destroy_battery(wacom);
1214 1173
1215 /* Stylus interface */ 1174 /* Stylus interface */
1216 wacom1 = usb_get_intfdata(usbdev->config->interface[1]); 1175 hdev1 = usb_get_intfdata(usbdev->config->interface[1]);
1176 wacom1 = hid_get_drvdata(hdev1);
1217 wacom_wac1 = &(wacom1->wacom_wac); 1177 wacom_wac1 = &(wacom1->wacom_wac);
1218 wacom_unregister_inputs(wacom1); 1178 wacom_unregister_inputs(wacom1);
1219 1179
1220 /* Touch interface */ 1180 /* Touch interface */
1221 wacom2 = usb_get_intfdata(usbdev->config->interface[2]); 1181 hdev2 = usb_get_intfdata(usbdev->config->interface[2]);
1182 wacom2 = hid_get_drvdata(hdev2);
1222 wacom_wac2 = &(wacom2->wacom_wac); 1183 wacom_wac2 = &(wacom2->wacom_wac);
1223 wacom_unregister_inputs(wacom2); 1184 wacom_unregister_inputs(wacom2);
1224 1185
1225 if (wacom_wac->pid == 0) { 1186 if (wacom_wac->pid == 0) {
1226 dev_info(&wacom->intf->dev, "wireless tablet disconnected\n"); 1187 dev_info(&wacom->intf->dev, "wireless tablet disconnected\n");
1227 } else { 1188 } else {
1228 const struct usb_device_id *id = wacom_ids; 1189 const struct hid_device_id *id = wacom_ids;
1229 1190
1230 dev_info(&wacom->intf->dev, 1191 dev_info(&wacom->intf->dev,
1231 "wireless tablet connected with PID %x\n", 1192 "wireless tablet connected with PID %x\n",
1232 wacom_wac->pid); 1193 wacom_wac->pid);
1233 1194
1234 while (id->match_flags) { 1195 while (id->bus) {
1235 if (id->idVendor == USB_VENDOR_ID_WACOM && 1196 if (id->vendor == USB_VENDOR_ID_WACOM &&
1236 id->idProduct == wacom_wac->pid) 1197 id->product == wacom_wac->pid)
1237 break; 1198 break;
1238 id++; 1199 id++;
1239 } 1200 }
1240 1201
1241 if (!id->match_flags) { 1202 if (!id->bus) {
1242 dev_info(&wacom->intf->dev, 1203 dev_info(&wacom->intf->dev,
1243 "ignoring unknown PID.\n"); 1204 "ignoring unknown PID.\n");
1244 return; 1205 return;
@@ -1246,7 +1207,7 @@ static void wacom_wireless_work(struct work_struct *work)
1246 1207
1247 /* Stylus interface */ 1208 /* Stylus interface */
1248 wacom_wac1->features = 1209 wacom_wac1->features =
1249 *((struct wacom_features *)id->driver_info); 1210 *((struct wacom_features *)id->driver_data);
1250 wacom_wac1->features.device_type = BTN_TOOL_PEN; 1211 wacom_wac1->features.device_type = BTN_TOOL_PEN;
1251 snprintf(wacom_wac1->name, WACOM_NAME_MAX, "%s (WL) Pen", 1212 snprintf(wacom_wac1->name, WACOM_NAME_MAX, "%s (WL) Pen",
1252 wacom_wac1->features.name); 1213 wacom_wac1->features.name);
@@ -1262,7 +1223,7 @@ static void wacom_wireless_work(struct work_struct *work)
1262 if (wacom_wac1->features.touch_max || 1223 if (wacom_wac1->features.touch_max ||
1263 wacom_wac1->features.type == INTUOSHT) { 1224 wacom_wac1->features.type == INTUOSHT) {
1264 wacom_wac2->features = 1225 wacom_wac2->features =
1265 *((struct wacom_features *)id->driver_info); 1226 *((struct wacom_features *)id->driver_data);
1266 wacom_wac2->features.pktlen = WACOM_PKGLEN_BBTOUCH3; 1227 wacom_wac2->features.pktlen = WACOM_PKGLEN_BBTOUCH3;
1267 wacom_wac2->features.device_type = BTN_TOOL_FINGER; 1228 wacom_wac2->features.device_type = BTN_TOOL_FINGER;
1268 wacom_wac2->features.x_max = wacom_wac2->features.y_max = 4096; 1229 wacom_wac2->features.x_max = wacom_wac2->features.y_max = 4096;
@@ -1323,8 +1284,10 @@ static void wacom_calculate_res(struct wacom_features *features)
1323 features->unitExpo); 1284 features->unitExpo);
1324} 1285}
1325 1286
1326static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) 1287static int wacom_probe(struct hid_device *hdev,
1288 const struct hid_device_id *id)
1327{ 1289{
1290 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
1328 struct usb_device *dev = interface_to_usbdev(intf); 1291 struct usb_device *dev = interface_to_usbdev(intf);
1329 struct usb_endpoint_descriptor *endpoint; 1292 struct usb_endpoint_descriptor *endpoint;
1330 struct wacom *wacom; 1293 struct wacom *wacom;
@@ -1332,34 +1295,29 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
1332 struct wacom_features *features; 1295 struct wacom_features *features;
1333 int error; 1296 int error;
1334 1297
1335 if (!id->driver_info) 1298 if (!id->driver_data)
1336 return -EINVAL; 1299 return -EINVAL;
1337 1300
1338 wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); 1301 wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
1339 if (!wacom) 1302 if (!wacom)
1340 return -ENOMEM; 1303 return -ENOMEM;
1341 1304
1305 hid_set_drvdata(hdev, wacom);
1306 wacom->hdev = hdev;
1307
1342 wacom_wac = &wacom->wacom_wac; 1308 wacom_wac = &wacom->wacom_wac;
1343 wacom_wac->features = *((struct wacom_features *)id->driver_info); 1309 wacom_wac->features = *((struct wacom_features *)id->driver_data);
1344 features = &wacom_wac->features; 1310 features = &wacom_wac->features;
1345 if (features->pktlen > WACOM_PKGLEN_MAX) { 1311 if (features->pktlen > WACOM_PKGLEN_MAX) {
1346 error = -EINVAL; 1312 error = -EINVAL;
1347 goto fail1; 1313 goto fail1;
1348 } 1314 }
1349 1315
1350 wacom_wac->data = usb_alloc_coherent(dev, WACOM_PKGLEN_MAX, 1316 if (features->check_for_hid_type && features->hid_type != hdev->type) {
1351 GFP_KERNEL, &wacom->data_dma); 1317 error = -ENODEV;
1352 if (!wacom_wac->data) {
1353 error = -ENOMEM;
1354 goto fail1; 1318 goto fail1;
1355 } 1319 }
1356 1320
1357 wacom->irq = usb_alloc_urb(0, GFP_KERNEL);
1358 if (!wacom->irq) {
1359 error = -ENOMEM;
1360 goto fail2;
1361 }
1362
1363 wacom->usbdev = dev; 1321 wacom->usbdev = dev;
1364 wacom->intf = intf; 1322 wacom->intf = intf;
1365 mutex_init(&wacom->lock); 1323 mutex_init(&wacom->lock);
@@ -1375,7 +1333,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
1375 /* Retrieve the physical and logical size for touch devices */ 1333 /* Retrieve the physical and logical size for touch devices */
1376 error = wacom_retrieve_hid_descriptor(intf, features); 1334 error = wacom_retrieve_hid_descriptor(intf, features);
1377 if (error) 1335 if (error)
1378 goto fail3; 1336 goto fail1;
1379 1337
1380 /* 1338 /*
1381 * Intuos5 has no useful data about its touch interface in its 1339 * Intuos5 has no useful data about its touch interface in its
@@ -1423,38 +1381,38 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
1423 other_dev = dev; 1381 other_dev = dev;
1424 error = wacom_add_shared_data(wacom_wac, other_dev); 1382 error = wacom_add_shared_data(wacom_wac, other_dev);
1425 if (error) 1383 if (error)
1426 goto fail3; 1384 goto fail1;
1427 } 1385 }
1428 1386
1429 usb_fill_int_urb(wacom->irq, dev,
1430 usb_rcvintpipe(dev, endpoint->bEndpointAddress),
1431 wacom_wac->data, features->pktlen,
1432 wacom_sys_irq, wacom, endpoint->bInterval);
1433 wacom->irq->transfer_dma = wacom->data_dma;
1434 wacom->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
1435
1436 error = wacom_initialize_leds(wacom); 1387 error = wacom_initialize_leds(wacom);
1437 if (error) 1388 if (error)
1438 goto fail4; 1389 goto fail2;
1439 1390
1440 if (!(features->quirks & WACOM_QUIRK_NO_INPUT)) { 1391 if (!(features->quirks & WACOM_QUIRK_NO_INPUT)) {
1441 error = wacom_register_inputs(wacom); 1392 error = wacom_register_inputs(wacom);
1442 if (error) 1393 if (error)
1443 goto fail5; 1394 goto fail3;
1444 } 1395 }
1445 1396
1446 /* Note that if query fails it is not a hard failure */ 1397 /* Note that if query fails it is not a hard failure */
1447 wacom_query_tablet_data(intf, features); 1398 wacom_query_tablet_data(intf, features);
1448 1399
1449 usb_set_intfdata(intf, wacom); 1400 /* Regular HID work starts now */
1401 error = hid_parse(hdev);
1402 if (error) {
1403 hid_err(hdev, "parse failed\n");
1404 goto fail4;
1405 }
1450 1406
1451 if (features->quirks & WACOM_QUIRK_MONITOR) { 1407 error = hid_hw_start(hdev, HID_CONNECT_HIDRAW);
1452 if (usb_submit_urb(wacom->irq, GFP_KERNEL)) { 1408 if (error) {
1453 error = -EIO; 1409 hid_err(hdev, "hw start failed\n");
1454 goto fail5; 1410 goto fail4;
1455 }
1456 } 1411 }
1457 1412
1413 if (features->quirks & WACOM_QUIRK_MONITOR)
1414 error = hid_hw_open(hdev);
1415
1458 if (wacom_wac->features.type == INTUOSHT && wacom_wac->features.touch_max) { 1416 if (wacom_wac->features.type == INTUOSHT && wacom_wac->features.touch_max) {
1459 if (wacom_wac->features.device_type == BTN_TOOL_FINGER) 1417 if (wacom_wac->features.device_type == BTN_TOOL_FINGER)
1460 wacom_wac->shared->touch_input = wacom_wac->input; 1418 wacom_wac->shared->touch_input = wacom_wac->input;
@@ -1462,78 +1420,60 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
1462 1420
1463 return 0; 1421 return 0;
1464 1422
1465 fail5: wacom_destroy_leds(wacom); 1423 fail4: wacom_unregister_inputs(wacom);
1466 fail4: wacom_remove_shared_data(wacom_wac); 1424 fail3: wacom_destroy_leds(wacom);
1467 fail3: usb_free_urb(wacom->irq); 1425 fail2: wacom_remove_shared_data(wacom_wac);
1468 fail2: usb_free_coherent(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma);
1469 fail1: kfree(wacom); 1426 fail1: kfree(wacom);
1427 hid_set_drvdata(hdev, NULL);
1470 return error; 1428 return error;
1471} 1429}
1472 1430
1473static void wacom_disconnect(struct usb_interface *intf) 1431static void wacom_remove(struct hid_device *hdev)
1474{ 1432{
1475 struct wacom *wacom = usb_get_intfdata(intf); 1433 struct wacom *wacom = hid_get_drvdata(hdev);
1476 1434
1477 usb_set_intfdata(intf, NULL); 1435 hid_hw_stop(hdev);
1478 1436
1479 usb_kill_urb(wacom->irq);
1480 cancel_work_sync(&wacom->work); 1437 cancel_work_sync(&wacom->work);
1481 wacom_unregister_inputs(wacom); 1438 wacom_unregister_inputs(wacom);
1482 wacom_destroy_battery(wacom); 1439 wacom_destroy_battery(wacom);
1483 wacom_destroy_leds(wacom); 1440 wacom_destroy_leds(wacom);
1484 usb_free_urb(wacom->irq);
1485 usb_free_coherent(interface_to_usbdev(intf), WACOM_PKGLEN_MAX,
1486 wacom->wacom_wac.data, wacom->data_dma);
1487 wacom_remove_shared_data(&wacom->wacom_wac); 1441 wacom_remove_shared_data(&wacom->wacom_wac);
1488 kfree(wacom);
1489}
1490
1491static int wacom_suspend(struct usb_interface *intf, pm_message_t message)
1492{
1493 struct wacom *wacom = usb_get_intfdata(intf);
1494
1495 mutex_lock(&wacom->lock);
1496 usb_kill_urb(wacom->irq);
1497 mutex_unlock(&wacom->lock);
1498 1442
1499 return 0; 1443 hid_set_drvdata(hdev, NULL);
1444 kfree(wacom);
1500} 1445}
1501 1446
1502static int wacom_resume(struct usb_interface *intf) 1447static int wacom_resume(struct hid_device *hdev)
1503{ 1448{
1504 struct wacom *wacom = usb_get_intfdata(intf); 1449 struct wacom *wacom = hid_get_drvdata(hdev);
1505 struct wacom_features *features = &wacom->wacom_wac.features; 1450 struct wacom_features *features = &wacom->wacom_wac.features;
1506 int rv = 0;
1507 1451
1508 mutex_lock(&wacom->lock); 1452 mutex_lock(&wacom->lock);
1509 1453
1510 /* switch to wacom mode first */ 1454 /* switch to wacom mode first */
1511 wacom_query_tablet_data(intf, features); 1455 wacom_query_tablet_data(wacom->intf, features);
1512 wacom_led_control(wacom); 1456 wacom_led_control(wacom);
1513 1457
1514 if ((wacom->open || (features->quirks & WACOM_QUIRK_MONITOR)) &&
1515 usb_submit_urb(wacom->irq, GFP_NOIO) < 0)
1516 rv = -EIO;
1517
1518 mutex_unlock(&wacom->lock); 1458 mutex_unlock(&wacom->lock);
1519 1459
1520 return rv; 1460 return 0;
1521} 1461}
1522 1462
1523static int wacom_reset_resume(struct usb_interface *intf) 1463static int wacom_reset_resume(struct hid_device *hdev)
1524{ 1464{
1525 return wacom_resume(intf); 1465 return wacom_resume(hdev);
1526} 1466}
1527 1467
1528static struct usb_driver wacom_driver = { 1468static struct hid_driver wacom_driver = {
1529 .name = "wacom", 1469 .name = "wacom",
1530 .id_table = wacom_ids, 1470 .id_table = wacom_ids,
1531 .probe = wacom_probe, 1471 .probe = wacom_probe,
1532 .disconnect = wacom_disconnect, 1472 .remove = wacom_remove,
1533 .suspend = wacom_suspend, 1473#ifdef CONFIG_PM
1534 .resume = wacom_resume, 1474 .resume = wacom_resume,
1535 .reset_resume = wacom_reset_resume, 1475 .reset_resume = wacom_reset_resume,
1536 .supports_autosuspend = 1, 1476#endif
1477 .raw_event = wacom_raw_event,
1537}; 1478};
1538 1479module_hid_driver(wacom_driver);
1539module_usb_driver(wacom_driver);
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index f170277b6f28..1c95ce78d749 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -2197,15 +2197,18 @@ static const struct wacom_features wacom_features_0x2A =
2197static const struct wacom_features wacom_features_0x314 = 2197static const struct wacom_features wacom_features_0x314 =
2198 { "Wacom Intuos Pro S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, 2198 { "Wacom Intuos Pro S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047,
2199 63, INTUOSPS, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 2199 63, INTUOSPS, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
2200 .touch_max = 16 }; 2200 .touch_max = 16,
2201 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
2201static const struct wacom_features wacom_features_0x315 = 2202static const struct wacom_features wacom_features_0x315 =
2202 { "Wacom Intuos Pro M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, 2203 { "Wacom Intuos Pro M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047,
2203 63, INTUOSPM, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 2204 63, INTUOSPM, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
2204 .touch_max = 16 }; 2205 .touch_max = 16,
2206 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
2205static const struct wacom_features wacom_features_0x317 = 2207static const struct wacom_features wacom_features_0x317 =
2206 { "Wacom Intuos Pro L", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, 2208 { "Wacom Intuos Pro L", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047,
2207 63, INTUOSPL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 2209 63, INTUOSPL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
2208 .touch_max = 16 }; 2210 .touch_max = 16,
2211 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
2209static const struct wacom_features wacom_features_0xF4 = 2212static const struct wacom_features wacom_features_0xF4 =
2210 { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104280, 65400, 2047, 2213 { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104280, 65400, 2047,
2211 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 200, 200 }; 2214 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 200, 200 };
@@ -2215,7 +2218,8 @@ static const struct wacom_features wacom_features_0xF8 =
2215 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 }; 2218 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 };
2216static const struct wacom_features wacom_features_0xF6 = 2219static const struct wacom_features wacom_features_0xF6 =
2217 { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */ 2220 { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */
2218 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10 }; 2221 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10,
2222 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
2219static const struct wacom_features wacom_features_0x3F = 2223static const struct wacom_features wacom_features_0x3F =
2220 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, 2224 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023,
2221 63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 2225 63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
@@ -2233,7 +2237,8 @@ static const struct wacom_features wacom_features_0xC7 =
2233 0, PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2237 0, PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
2234static const struct wacom_features wacom_features_0xCE = 2238static const struct wacom_features wacom_features_0xCE =
2235 { "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511, 2239 { "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511,
2236 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2240 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
2241 .check_for_hid_type = true, .hid_type = HID_TYPE_USBMOUSE };
2237static const struct wacom_features wacom_features_0xF0 = 2242static const struct wacom_features wacom_features_0xF0 =
2238 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511, 2243 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511,
2239 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2244 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2249,7 +2254,8 @@ static const struct wacom_features wacom_features_0x59 = /* Pen */
2249 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5D }; 2254 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5D };
2250static const struct wacom_features wacom_features_0x5D = /* Touch */ 2255static const struct wacom_features wacom_features_0x5D = /* Touch */
2251 { "Wacom DTH2242", .type = WACOM_24HDT, 2256 { "Wacom DTH2242", .type = WACOM_24HDT,
2252 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x59, .touch_max = 10 }; 2257 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x59, .touch_max = 10,
2258 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
2253static const struct wacom_features wacom_features_0xCC = 2259static const struct wacom_features wacom_features_0xCC =
2254 { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87000, 65400, 2047, 2260 { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87000, 65400, 2047,
2255 63, WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 200, 200 }; 2261 63, WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 200, 200 };
@@ -2262,7 +2268,8 @@ static const struct wacom_features wacom_features_0x5B =
2262 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5e }; 2268 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5e };
2263static const struct wacom_features wacom_features_0x5E = 2269static const struct wacom_features wacom_features_0x5E =
2264 { "Wacom Cintiq 22HDT", .type = WACOM_24HDT, 2270 { "Wacom Cintiq 22HDT", .type = WACOM_24HDT,
2265 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5b, .touch_max = 10 }; 2271 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5b, .touch_max = 10,
2272 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
2266static const struct wacom_features wacom_features_0x90 = 2273static const struct wacom_features wacom_features_0x90 =
2267 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 2274 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
2268 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2275 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2400,14 +2407,17 @@ static const struct wacom_features wacom_features_0x301 =
2400static const struct wacom_features wacom_features_0x302 = 2407static const struct wacom_features wacom_features_0x302 =
2401 { "Wacom Intuos PT S", WACOM_PKGLEN_BBPEN, 15200, 9500, 1023, 2408 { "Wacom Intuos PT S", WACOM_PKGLEN_BBPEN, 15200, 9500, 1023,
2402 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 2409 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
2403 .touch_max = 16 }; 2410 .touch_max = 16,
2411 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
2404static const struct wacom_features wacom_features_0x303 = 2412static const struct wacom_features wacom_features_0x303 =
2405 { "Wacom Intuos PT M", WACOM_PKGLEN_BBPEN, 21600, 13500, 1023, 2413 { "Wacom Intuos PT M", WACOM_PKGLEN_BBPEN, 21600, 13500, 1023,
2406 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 2414 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
2407 .touch_max = 16 }; 2415 .touch_max = 16,
2416 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
2408static const struct wacom_features wacom_features_0x30E = 2417static const struct wacom_features wacom_features_0x30E =
2409 { "Wacom Intuos S", WACOM_PKGLEN_BBPEN, 15200, 9500, 1023, 2418 { "Wacom Intuos S", WACOM_PKGLEN_BBPEN, 15200, 9500, 1023,
2410 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2419 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
2420 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
2411static const struct wacom_features wacom_features_0x6004 = 2421static const struct wacom_features wacom_features_0x6004 =
2412 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255, 2422 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
2413 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2423 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2417,22 +2427,18 @@ static const struct wacom_features wacom_features_0x0307 =
2417 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x309 }; 2427 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x309 };
2418static const struct wacom_features wacom_features_0x0309 = 2428static const struct wacom_features wacom_features_0x0309 =
2419 { "Wacom ISDv5 309", .type = WACOM_24HDT, /* Touch */ 2429 { "Wacom ISDv5 309", .type = WACOM_24HDT, /* Touch */
2420 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x0307, .touch_max = 10 }; 2430 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x0307, .touch_max = 10,
2421 2431 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
2422#define USB_DEVICE_WACOM(prod) \
2423 USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
2424 .driver_info = (kernel_ulong_t)&wacom_features_##prod
2425 2432
2426#define USB_DEVICE_DETAILED(prod, class, sub, proto) \ 2433#define USB_DEVICE_WACOM(prod) \
2427 USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_WACOM, prod, class, \ 2434 HID_DEVICE(BUS_USB, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\
2428 sub, proto), \ 2435 .driver_data = (kernel_ulong_t)&wacom_features_##prod
2429 .driver_info = (kernel_ulong_t)&wacom_features_##prod
2430 2436
2431#define USB_DEVICE_LENOVO(prod) \ 2437#define USB_DEVICE_LENOVO(prod) \
2432 USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \ 2438 HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \
2433 .driver_info = (kernel_ulong_t)&wacom_features_##prod 2439 .driver_data = (kernel_ulong_t)&wacom_features_##prod
2434 2440
2435const struct usb_device_id wacom_ids[] = { 2441const struct hid_device_id wacom_ids[] = {
2436 { USB_DEVICE_WACOM(0x00) }, 2442 { USB_DEVICE_WACOM(0x00) },
2437 { USB_DEVICE_WACOM(0x10) }, 2443 { USB_DEVICE_WACOM(0x10) },
2438 { USB_DEVICE_WACOM(0x11) }, 2444 { USB_DEVICE_WACOM(0x11) },
@@ -2478,9 +2484,9 @@ const struct usb_device_id wacom_ids[] = {
2478 { USB_DEVICE_WACOM(0x45) }, 2484 { USB_DEVICE_WACOM(0x45) },
2479 { USB_DEVICE_WACOM(0x57) }, 2485 { USB_DEVICE_WACOM(0x57) },
2480 { USB_DEVICE_WACOM(0x59) }, 2486 { USB_DEVICE_WACOM(0x59) },
2481 { USB_DEVICE_DETAILED(0x5D, USB_CLASS_HID, 0, 0) }, 2487 { USB_DEVICE_WACOM(0x5D) },
2482 { USB_DEVICE_WACOM(0x5B) }, 2488 { USB_DEVICE_WACOM(0x5B) },
2483 { USB_DEVICE_DETAILED(0x5E, USB_CLASS_HID, 0, 0) }, 2489 { USB_DEVICE_WACOM(0x5E) },
2484 { USB_DEVICE_WACOM(0xB0) }, 2490 { USB_DEVICE_WACOM(0xB0) },
2485 { USB_DEVICE_WACOM(0xB1) }, 2491 { USB_DEVICE_WACOM(0xB1) },
2486 { USB_DEVICE_WACOM(0xB2) }, 2492 { USB_DEVICE_WACOM(0xB2) },
@@ -2502,13 +2508,7 @@ const struct usb_device_id wacom_ids[] = {
2502 { USB_DEVICE_WACOM(0xC5) }, 2508 { USB_DEVICE_WACOM(0xC5) },
2503 { USB_DEVICE_WACOM(0xC6) }, 2509 { USB_DEVICE_WACOM(0xC6) },
2504 { USB_DEVICE_WACOM(0xC7) }, 2510 { USB_DEVICE_WACOM(0xC7) },
2505 /* 2511 { USB_DEVICE_WACOM(0xCE) },
2506 * DTU-2231 has two interfaces on the same configuration,
2507 * only one is used.
2508 */
2509 { USB_DEVICE_DETAILED(0xCE, USB_CLASS_HID,
2510 USB_INTERFACE_SUBCLASS_BOOT,
2511 USB_INTERFACE_PROTOCOL_MOUSE) },
2512 { USB_DEVICE_WACOM(0x84) }, 2512 { USB_DEVICE_WACOM(0x84) },
2513 { USB_DEVICE_WACOM(0xD0) }, 2513 { USB_DEVICE_WACOM(0xD0) },
2514 { USB_DEVICE_WACOM(0xD1) }, 2514 { USB_DEVICE_WACOM(0xD1) },
@@ -2546,13 +2546,13 @@ const struct usb_device_id wacom_ids[] = {
2546 { USB_DEVICE_WACOM(0x116) }, 2546 { USB_DEVICE_WACOM(0x116) },
2547 { USB_DEVICE_WACOM(0x300) }, 2547 { USB_DEVICE_WACOM(0x300) },
2548 { USB_DEVICE_WACOM(0x301) }, 2548 { USB_DEVICE_WACOM(0x301) },
2549 { USB_DEVICE_DETAILED(0x302, USB_CLASS_HID, 0, 0) }, 2549 { USB_DEVICE_WACOM(0x302) },
2550 { USB_DEVICE_DETAILED(0x303, USB_CLASS_HID, 0, 0) }, 2550 { USB_DEVICE_WACOM(0x303) },
2551 { USB_DEVICE_DETAILED(0x30E, USB_CLASS_HID, 0, 0) }, 2551 { USB_DEVICE_WACOM(0x30E) },
2552 { USB_DEVICE_WACOM(0x304) }, 2552 { USB_DEVICE_WACOM(0x304) },
2553 { USB_DEVICE_DETAILED(0x314, USB_CLASS_HID, 0, 0) }, 2553 { USB_DEVICE_WACOM(0x314) },
2554 { USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) }, 2554 { USB_DEVICE_WACOM(0x315) },
2555 { USB_DEVICE_DETAILED(0x317, USB_CLASS_HID, 0, 0) }, 2555 { USB_DEVICE_WACOM(0x317) },
2556 { USB_DEVICE_WACOM(0x4001) }, 2556 { USB_DEVICE_WACOM(0x4001) },
2557 { USB_DEVICE_WACOM(0x4004) }, 2557 { USB_DEVICE_WACOM(0x4004) },
2558 { USB_DEVICE_WACOM(0x5000) }, 2558 { USB_DEVICE_WACOM(0x5000) },
@@ -2560,12 +2560,12 @@ const struct usb_device_id wacom_ids[] = {
2560 { USB_DEVICE_WACOM(0x47) }, 2560 { USB_DEVICE_WACOM(0x47) },
2561 { USB_DEVICE_WACOM(0xF4) }, 2561 { USB_DEVICE_WACOM(0xF4) },
2562 { USB_DEVICE_WACOM(0xF8) }, 2562 { USB_DEVICE_WACOM(0xF8) },
2563 { USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) }, 2563 { USB_DEVICE_WACOM(0xF6) },
2564 { USB_DEVICE_WACOM(0xFA) }, 2564 { USB_DEVICE_WACOM(0xFA) },
2565 { USB_DEVICE_WACOM(0xFB) }, 2565 { USB_DEVICE_WACOM(0xFB) },
2566 { USB_DEVICE_WACOM(0x0307) }, 2566 { USB_DEVICE_WACOM(0x0307) },
2567 { USB_DEVICE_DETAILED(0x0309, USB_CLASS_HID, 0, 0) }, 2567 { USB_DEVICE_WACOM(0x0309) },
2568 { USB_DEVICE_LENOVO(0x6004) }, 2568 { USB_DEVICE_LENOVO(0x6004) },
2569 { } 2569 { }
2570}; 2570};
2571MODULE_DEVICE_TABLE(usb, wacom_ids); 2571MODULE_DEVICE_TABLE(hid, wacom_ids);
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index f48164c780f4..8821a518abf6 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -137,6 +137,8 @@ struct wacom_features {
137 unsigned touch_max; 137 unsigned touch_max;
138 int oVid; 138 int oVid;
139 int oPid; 139 int oPid;
140 bool check_for_hid_type;
141 int hid_type;
140}; 142};
141 143
142struct wacom_shared { 144struct wacom_shared {
@@ -151,7 +153,7 @@ struct wacom_shared {
151struct wacom_wac { 153struct wacom_wac {
152 char name[WACOM_NAME_MAX]; 154 char name[WACOM_NAME_MAX];
153 char pad_name[WACOM_NAME_MAX]; 155 char pad_name[WACOM_NAME_MAX];
154 unsigned char *data; 156 unsigned char data[WACOM_PKGLEN_MAX];
155 int tool[2]; 157 int tool[2];
156 int id[2]; 158 int id[2];
157 __u32 serial[2]; 159 __u32 serial[2];