Binding (in your case HID-) device to a specific driver is not a trivial task and depends on the kernel version used:
Kernel <4.16
Prior to kernel 4.16, you had to edit and recompile drivers/hid/HID-core.c since this file contained a list of devices that should not be processed by HID-generic ( hid_have_special_driver structure), you can see an example of how this was done here: https: //github.com/atar-axis/xpadneo/blob/master/misc/kernel_patches/0002-hid_generic_claims_devices.patch
Kernel> = 4.16
Starting with Kernel 4.16, the list has been deleted, and HID-generic checks to see if the device wants any of the other drivers, if so, then the HID-generic step back is not a HID-generic device. Associated patch: https://github.com/torvalds/linux/commit/e04a0442d33b8cf183bba38646447b891bb02123#diff-88d50bd989bbdf3bbd2f3c5dcd4edcb9
Workaround (always works)
You can always use the udev rule (for example, /etc/udev/rules.d/99-xpadneo.rules ), either until 4.16, or when your system has more than one specialized driver:
# unbind the device from hid-generic on kernel < 4.16 # and bind it to the specialized driver (xpadneo in this case) ACTION=="add", KERNEL=="0005:045E:02FD.*|0005:045E:02E0.*", SUBSYSTEM=="hid",\ RUN+="/bin/bash -c 'echo $kernel > /sys/bus/hid/drivers/hid-generic/unbind'", \ RUN+="/bin/bash -c 'echo $kernel > /sys/bus/hid/drivers/xpadneo/bind'" # unbind the device from another specialized driver which came first # and bind it to xpadneo ACTION=="add", KERNEL=="0005:045E:02FD.*|0005:045E:02E0.*", SUBSYSTEM=="hid",\ RUN+="/bin/bash -c 'echo $kernel > /sys/bus/hid/drivers/microsoft/unbind'", \ RUN+="/bin/bash -c 'echo $kernel > /sys/bus/hid/drivers/xpadneo/bind'"
Notes
- Instead of
bash you should use sh - I do not remember when
bind and unbind where added, but it was quite a long time ago.
You can read a little more about loading , binding and registering (HID-) drivers here:
flood source share