0

I'm currently trying to create my own USB HID mouse driver as an override of the standard generic USB, which always gets in the way. How can I unbind the generic driver and rebind it to my specific automatically?

My Zuoya MMR6 module/driver: https://github.com/vladipus/zuoya-mmr6

Vladius
  • 131
  • 5
  • May be able to create a custom rule for the PID/VID of your mouse. This [Q/A](https://unix.stackexchange.com/questions/270725/how-do-i-connect-a-usb-mass-storage-device-that-has-a-custom-pid-and-vid) may help with that. – jc__ Oct 11 '18 at 18:17
  • I'm just surprised how much of a hassle it is to implement a custom Linux USB device driver. – Vladius Oct 13 '18 at 12:02

1 Answers1

0

Created the following udev rules, which helped much with the issue:

KERNEL=="0003:18F8:1486.*"\
PROGRAM="/bin/sh -c 'echo -n %k > /sys/bus/hid/drivers/hid-generic/unbind;\
echo -n %k > /sys/bus/hid/drivers/hid-zuoya-mmr6/bind'"

Those can be automatically installed to /etc/udev/rules.d/ by the driver installation scripts/routine.

Pablo A
  • 2,307
  • 1
  • 22
  • 34
Vladius
  • 131
  • 5