From: rpjday@crashcourse.ca (Robert P. J. Day)
To: kernelnewbies@lists.kernelnewbies.org
Subject: is there a reason "usbhid.quirks" parameter is not root writable?
Date: Fri, 13 Nov 2015 01:24:28 -0700 (MST) [thread overview]
Message-ID: <alpine.LFD.2.20.1511130121560.6263@localhost> (raw)
In-Reply-To: <8737wanwtb.fsf@nemi.mork.no>
On Fri, 13 Nov 2015, Bj?rn Mork wrote:
> "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.
ah, got it, thanks. i've never done that but the concept seems easy
enough.
> 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 :)
and that's one of the things i mention occasionally when newbies ask
how to get started working on the kernel. write/improve the docs. what
a perfect example.
> 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)
thank you kindly, i'll give this a shot.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
prev parent reply other threads:[~2015-11-13 8:24 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
2015-11-13 8:24 ` Robert P. J. Day [this message]
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=alpine.LFD.2.20.1511130121560.6263@localhost \
--to=rpjday@crashcourse.ca \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.