aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
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/hid
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/hid')
-rw-r--r--drivers/hid/hid-core.c10
-rw-r--r--drivers/hid/hid-wacom.c2
2 files changed, 10 insertions, 2 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,