kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: bjorn@mork.no (Bjørn Mork)
To: kernelnewbies@lists.kernelnewbies.org
Subject: is there a reason "usbhid.quirks" parameter is not root writable?
Date: Fri, 13 Nov 2015 09:11:12 +0100	[thread overview]
Message-ID: <8737wanwtb.fsf@nemi.mork.no> (raw)
In-Reply-To: <alpine.LFD.2.20.1511130053240.5741@localhost> (Robert P. J. Day's message of "Fri, 13 Nov 2015 00:53:49 -0700 (MST)")

"Robert P. J. Day" <rpjday@crashcourse.ca> 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

  reply	other threads:[~2015-11-13  8:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 10:15 is there a reason "usbhid.quirks" parameter is not root writable? Robert P. J. Day
2015-11-13  0:44 ` Greg KH
2015-11-13  1:02   ` Valdis.Kletnieks at vt.edu
2015-11-13  1:31     ` Greg KH
2015-11-13  7:53   ` Robert P. J. Day
2015-11-13  8:11     ` Bjørn Mork [this message]
2015-11-13  8:24       ` Robert P. J. Day

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737wanwtb.fsf@nemi.mork.no \
    --to=bjorn@mork.no \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).