aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-09-30 13:18:28 -0400
committerJiri Kosina <jkosina@suse.cz>2014-10-29 05:51:39 -0400
commitab94e562ed45c99914fe874b7feaf75b80ceea84 (patch)
tree7f37f16362d583a83c386483b608209d335758f9 /drivers
parent2f31c52529103d8f0e1485272064f982d14ce54a (diff)
HID: logitech: move dj devices to the HID++ module
Devices connected through the Logitech Wireless Receiver are HID++ devices. We can handle them here to benefit from this new module and activate enhaced support of the various wireless touchpad or mice with touch sensors on them. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Tested-by: Andrew de los Reyes <adlr@chromium.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/Kconfig1
-rw-r--r--drivers/hid/hid-logitech-dj.c42
-rw-r--r--drivers/hid/hid-logitech-hidpp.c21
3 files changed, 15 insertions, 49 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 6f299cd54e6d..dd49a9b14b9c 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -371,6 +371,7 @@ config HID_LOGITECH_DJ
371 tristate "Logitech Unifying receivers full support" 371 tristate "Logitech Unifying receivers full support"
372 depends on HIDRAW 372 depends on HIDRAW
373 depends on HID_LOGITECH 373 depends on HID_LOGITECH
374 select HID_LOGITECH_HIDPP
374 ---help--- 375 ---help---
375 Say Y if you want support for Logitech Unifying receivers and devices. 376 Say Y if you want support for Logitech Unifying receivers and devices.
376 Unifying receivers are capable of pairing up to 6 Logitech compliant 377 Unifying receivers are capable of pairing up to 6 Logitech compliant
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 6aea16dca3ff..45a7eacdfe98 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -977,48 +977,8 @@ static struct hid_driver logi_djreceiver_driver = {
977#endif 977#endif
978}; 978};
979 979
980module_hid_driver(logi_djreceiver_driver);
980 981
981static const struct hid_device_id logi_dj_devices[] = {
982 { HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
983 USB_VENDOR_ID_LOGITECH, HID_ANY_ID)},
984 {}
985};
986
987static struct hid_driver logi_djdevice_driver = {
988 .name = "logitech-djdevice",
989 .id_table = logi_dj_devices,
990};
991
992
993static int __init logi_dj_init(void)
994{
995 int retval;
996
997 dbg_hid("Logitech-DJ:%s\n", __func__);
998
999 retval = hid_register_driver(&logi_djreceiver_driver);
1000 if (retval)
1001 return retval;
1002
1003 retval = hid_register_driver(&logi_djdevice_driver);
1004 if (retval)
1005 hid_unregister_driver(&logi_djreceiver_driver);
1006
1007 return retval;
1008
1009}
1010
1011static void __exit logi_dj_exit(void)
1012{
1013 dbg_hid("Logitech-DJ:%s\n", __func__);
1014
1015 hid_unregister_driver(&logi_djdevice_driver);
1016 hid_unregister_driver(&logi_djreceiver_driver);
1017
1018}
1019
1020module_init(logi_dj_init);
1021module_exit(logi_dj_exit);
1022MODULE_LICENSE("GPL"); 982MODULE_LICENSE("GPL");
1023MODULE_AUTHOR("Logitech"); 983MODULE_AUTHOR("Logitech");
1024MODULE_AUTHOR("Nestor Lopez Casado"); 984MODULE_AUTHOR("Nestor Lopez Casado");
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 7dd9163f7e03..48dec394dd38 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -777,15 +777,17 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
777 hid_device_io_start(hdev); 777 hid_device_io_start(hdev);
778 778
779 connected = hidpp_is_connected(hidpp); 779 connected = hidpp_is_connected(hidpp);
780 if (!connected) { 780 if (id->group != HID_GROUP_LOGITECH_DJ_DEVICE) {
781 hid_err(hdev, "Device not connected"); 781 if (!connected) {
782 goto hid_parse_fail; 782 hid_err(hdev, "Device not connected");
783 } 783 goto hid_parse_fail;
784 }
784 785
785 /* the device is connected, we can ask for its name */ 786 /* the device is connected, we can ask for its name */
786 hid_info(hdev, "HID++ %u.%u device connected.\n", 787 hid_info(hdev, "HID++ %u.%u device connected.\n",
787 hidpp->protocol_major, hidpp->protocol_minor); 788 hidpp->protocol_major, hidpp->protocol_minor);
788 hidpp_overwrite_name(hdev); 789 hidpp_overwrite_name(hdev);
790 }
789 791
790 if (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP) { 792 if (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP) {
791 ret = wtp_get_config(hidpp); 793 ret = wtp_get_config(hidpp);
@@ -824,6 +826,9 @@ static const struct hid_device_id hidpp_devices[] = {
824 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 826 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH,
825 USB_DEVICE_ID_LOGITECH_T651), 827 USB_DEVICE_ID_LOGITECH_T651),
826 .driver_data = HIDPP_QUIRK_CLASS_WTP }, 828 .driver_data = HIDPP_QUIRK_CLASS_WTP },
829
830 { HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
831 USB_VENDOR_ID_LOGITECH, HID_ANY_ID)},
827 {} 832 {}
828}; 833};
829 834