Skip to content

Commit ab94e56

Browse files
bentissJiri Kosina
authored andcommitted
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 <[email protected]> Tested-by: Andrew de los Reyes <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 2f31c52 commit ab94e56

File tree

3 files changed

+15
-49
lines changed

3 files changed

+15
-49
lines changed

drivers/hid/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ config HID_LOGITECH_DJ
371371
tristate "Logitech Unifying receivers full support"
372372
depends on HIDRAW
373373
depends on HID_LOGITECH
374+
select HID_LOGITECH_HIDPP
374375
---help---
375376
Say Y if you want support for Logitech Unifying receivers and devices.
376377
Unifying receivers are capable of pairing up to 6 Logitech compliant

drivers/hid/hid-logitech-dj.c

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -977,48 +977,8 @@ static struct hid_driver logi_djreceiver_driver = {
977977
#endif
978978
};
979979

980+
module_hid_driver(logi_djreceiver_driver);
980981

981-
static 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-
987-
static struct hid_driver logi_djdevice_driver = {
988-
.name = "logitech-djdevice",
989-
.id_table = logi_dj_devices,
990-
};
991-
992-
993-
static 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-
1011-
static 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-
1020-
module_init(logi_dj_init);
1021-
module_exit(logi_dj_exit);
1022982
MODULE_LICENSE("GPL");
1023983
MODULE_AUTHOR("Logitech");
1024984
MODULE_AUTHOR("Nestor Lopez Casado");

drivers/hid/hid-logitech-hidpp.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -777,15 +777,17 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
777777
hid_device_io_start(hdev);
778778

779779
connected = hidpp_is_connected(hidpp);
780-
if (!connected) {
781-
hid_err(hdev, "Device not connected");
782-
goto hid_parse_fail;
783-
}
780+
if (id->group != HID_GROUP_LOGITECH_DJ_DEVICE) {
781+
if (!connected) {
782+
hid_err(hdev, "Device not connected");
783+
goto hid_parse_fail;
784+
}
784785

785-
/* the device is connected, we can ask for its name */
786-
hid_info(hdev, "HID++ %u.%u device connected.\n",
787-
hidpp->protocol_major, hidpp->protocol_minor);
788-
hidpp_overwrite_name(hdev);
786+
/* the device is connected, we can ask for its name */
787+
hid_info(hdev, "HID++ %u.%u device connected.\n",
788+
hidpp->protocol_major, hidpp->protocol_minor);
789+
hidpp_overwrite_name(hdev);
790+
}
789791

790792
if (hidpp->quirks & HIDPP_QUIRK_CLASS_WTP) {
791793
ret = wtp_get_config(hidpp);
@@ -824,6 +826,9 @@ static const struct hid_device_id hidpp_devices[] = {
824826
HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH,
825827
USB_DEVICE_ID_LOGITECH_T651),
826828
.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)},
827832
{}
828833
};
829834

0 commit comments

Comments
 (0)