OS: Debian 8

Problem: I'm writing usb driver module for my microcontroller, custom usb HID, but when I plug it to laptop it binds to usbhid driver, if I do rmmod usbhid it also disconnects a mouse and it's not very nice) I can unbind it via

sudo sh -c 'echo -n "1-3:1.0" > /sys/bus/usb/drivers/usbhid/unbind'

, however it's not interesting to do it every time i plug my device in. Even after I wrote a script, I've got that it not fun to run it again and again. Is it possible to unbind my device from usbhid driver automatically?

  • 1
    add your script to a custom udev rule, then udev will run your script on every plug. – Ipor Sircer Oct 18 '16 at 18:43

It was not easy to find the real cool solution, but I've done it. The solution doesn't deal with udev. We need to say to hid core that it shouldn't touch our device. It possible to do it in 2 ways depending either usbhid compiled as a module, or not. Check out this:



PS "GRUB_CMDLINE_LINUX_DEFAULT contains command line arguments to the linux kernel. You can put as many as you want there provided they are separated by a space."

Hopefully, it will save someone's time, since I spent great amount of time to find this, i think, excellent solution.

Best regards, anon


You could blacklist the driver so it does not load and bind to the device on boot. If other modules that have a dependency on it, they will fail to load.


  • Yep, but it's a default hid driver that control my mice, and it's at all not a good idea to suppress a hid driver – JuicyKitty Oct 20 '16 at 19:01
  • I agree. udev is the way to go. just for testing and writing a usb driver module you could go this way to avoid a learning curve if you didn't know udev. – Kyle H Oct 20 '16 at 19:07
  • Thanks for answer) I already got a basics of udev) and in general I used to do this curves since I installed Linux:D – JuicyKitty Oct 20 '16 at 19:11
  • I already solved it. In the case u interested, check the solution below. – JuicyKitty Oct 20 '16 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.