From mboxrd@z Thu Jan 1 00:00:00 1970 From: bjorn@mork.no (=?utf-8?Q?Bj=C3=B8rn_Mork?=) Date: Fri, 13 Nov 2015 09:11:12 +0100 Subject: is there a reason "usbhid.quirks" parameter is not root writable? In-Reply-To: (Robert P. J. Day's message of "Fri, 13 Nov 2015 00:53:49 -0700 (MST)") References: <20151113004435.GA25513@kroah.com> Message-ID: <8737wanwtb.fsf@nemi.mork.no> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org "Robert P. J. Day" writes: > On Thu, 12 Nov 2015, Greg KH wrote: > >> You can add a runtime quirk to the device itself when it shows up in >> sysfs for the hid driver. Use that instead of the module parameter for >> that specific device. > > sorry, i'm not sure what you're suggesting here. I don't know if this was what Greg meant, but you can always use /sys/bus/usb/drivers/usbhid/unbind to unbind the device from the usbhid driver. Then you can manually bind it to some other driver supporting the same device using the same mechanism (with s/un// of course), or load another supporting driver to make it probe and bind the device. Hmm, I was going to point you to the file documenting bind/unbind for the usb bus, but it doesn't seem to exist? There you have a task for someone wanting to improve the docs :) Anyway, it goes like this: Look at the device driver binding in sysfs: $ ls -l /sys/bus/usb/drivers/usbhid total 0 lrwxrwxrwx 1 root root 0 Nov 13 09:06 4-4:1.0 -> ../../../../devices/pci0000:00/0000:00:1d.7/usb4/4-4/4-4:1.0 --w------- 1 root root 4096 Nov 13 09:06 bind lrwxrwxrwx 1 root root 0 Nov 13 09:06 module -> ../../../../module/usbhid -rw-r--r-- 1 root root 4096 Nov 13 09:06 new_id -rw-r--r-- 1 root root 4096 Nov 13 09:06 remove_id --w------- 1 root root 4096 Nov 13 09:06 uevent --w------- 1 root root 4096 Nov 13 09:06 unbind Unbind the device you want to move somewhere else: $ echo 4-4:1.0 >/sys/bus/usb/drivers/usbhid/unbind Bind it to 'otherdriver': $ echo 4-4:1.0 >/sys/bus/usb/drivers/'otherdriver'/bind (wich will only succeed of that driver's probe succeeds, of course. If you need to add a device ID to another driver, then do that using 'new_id' instead. Which will trigger automatic probing of 'free' devices) Bj?rn