diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-02-06 23:07:20 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-02-06 23:07:20 +0200 |
| commit | a4233c0b0db59dac06d3e57ae3d1be28fe44c11c (patch) | |
| tree | 66ac89f0c842975a6a8ad8a44186c8c34b222b6b | |
| parent | 94d92eed4108ae434e8859660d15dc9e6d2391d6 (diff) | |
| download | hid-tminit-a4233c0b0db59dac06d3e57ae3d1be28fe44c11c.tar.gz hid-tminit-a4233c0b0db59dac06d3e57ae3d1be28fe44c11c.zip | |
manually binding/rebinding works
+ Still need to tweak some stuff, usbhid seems to attach itself
to the device before this driver gets a chance.
| -rw-r--r-- | usb-tminit.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/usb-tminit.c b/usb-tminit.c index f8bcc91..b78ab29 100644 --- a/usb-tminit.c +++ b/usb-tminit.c @@ -13,6 +13,7 @@ * Copyright (c) 2020-2021 Dario Pagani <dario.pagani.146+linuxk@gmail.com> * Copyright (c) 2020-2024 Kim Kuparinen <kimi.h.kuparinen@gmail.com> */ +#include <linux/hid.h> #include <linux/usb.h> #include <linux/input.h> #include <linux/slab.h> @@ -309,6 +310,7 @@ static int thrustmaster_probe(struct usb_interface *interface, const struct usb_ int ret = 0; struct tm_wheel *tm_wheel = NULL; struct usb_device *udev = NULL; + printk("ahaa what the fuck\n"); udev = usb_get_dev(interface_to_usbdev(interface)); @@ -385,18 +387,18 @@ error1: usb_put_dev(udev); return ret; } -static const struct usb_device_id thrustmaster_devices[] = { - { USB_DEVICE(0x044f, 0xb65d) }, - { USB_DEVICE(0x044f, 0xb664) }, - { USB_DEVICE(0x044f, 0xb69c) }, +static const struct usb_device_id thrustmaster_hid_devices[] = { + { USB_DEVICE_INTERFACE_CLASS(0x044f, 0xb65d, USB_CLASS_HID) }, + { USB_DEVICE_INTERFACE_CLASS(0x044f, 0xb664, USB_CLASS_HID) }, + { USB_DEVICE_INTERFACE_CLASS(0x044f, 0xb69c, USB_CLASS_HID) }, {} }; -MODULE_DEVICE_TABLE(usb, thrustmaster_devices); +MODULE_DEVICE_TABLE(usb, thrustmaster_hid_devices); static struct usb_driver thrustmaster_driver = { .name = "usb-thrustmaster", - .id_table = thrustmaster_devices, + .id_table = thrustmaster_hid_devices, .probe = thrustmaster_probe, .disconnect = thrustmaster_disconnect, }; |
