How can I bind a driver with a USB device?
Own USB driver taking precedence over usbhid
If you want to prevent binding to the usbhid
driver, you can use its HID_QUIRK_IGNORE
(= 4) setting. To stick with the example Karl Bielefeldt used, add
options usbhid quirks=0x15c2:0x0043:0x04
to some /etc/modprobe.d/*.conf
file (and perhaps recreate your initramfs). That will tell hid-core
to ignore that device. So usbhid
will have a look at it but leave it for some other driver instead.
Own HID driver taking precedence over hid-generic
However, if your other driver is a HID driver not an USB driver, then you need usbhid
to bind to the driver on the USB level, and you need your own HID driver to take precedence over hid-generic
. This is the problem I'm facing my self, and for which I haven't found a solution yet, short of unbinding and rebinding the device later on.
Here's a thread with a fix for a similar problem. To summarize, you add something like the following to one of your /etc/udev/rules.d
files:
SYSFS{idVendor}=="15c2", SYSFS{idProduct}=="0043", MODE="0666", PROGRAM="/bin/sh -c 'echo -n $id:1.0 >/sys/bus/usb/drivers/usbhid/unbind;\echo -n $id:1.1 >/sys/bus/usb/drivers/usbhid/unbind'"