diff --git a/driver/razeraccessory_driver.c b/driver/razeraccessory_driver.c index 833ca112ee46a72259e99fdd2bb1eec03bd98fc6..05d55c12acd3275bb0fe90cf8ea5b15dc20fe5e6 100644 --- a/driver/razeraccessory_driver.c +++ b/driver/razeraccessory_driver.c @@ -1041,6 +1041,26 @@ static int razer_input_mapping(struct hid_device *hdev, struct hid_input *hi, st return 0; } +/** + * Match method checks whether this driver should be used for a given HID device + */ +static bool razer_accessory_match(struct hid_device *hdev, bool ignore_special_driver) +{ + struct usb_interface *intf = to_usb_interface(hdev->dev.parent); + struct usb_device *usb_dev = interface_to_usbdev(intf); + + switch (usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_KRAKEN_KITTY_EDITION: + case USB_DEVICE_ID_RAZER_MOUSE_BUNGEE_V3_CHROMA: + if (intf->cur_altsetting->desc.bInterfaceNumber != 0) { + dev_info(&intf->dev, "skipping secondary interface\n"); + return false; + } + } + + return true; +} + /** * Probe method is ran whenever a device is binded to the driver */ @@ -1348,6 +1368,7 @@ MODULE_DEVICE_TABLE(hid, razer_devices); static struct hid_driver razer_accessory_driver = { .name = "razeraccessory", .id_table = razer_devices, + .match = razer_accessory_match, .probe = razer_accessory_probe, .remove = razer_accessory_disconnect, .raw_event = razer_raw_event,