LKML Archive on
help / color / mirror / Atom feed
From: Jiri Kosina <>
To: Adam Nielsen <>
Cc: LKML Mailinglist <>
Subject: Re: Can you use the USB HID interface within a driver?
Date: Sat, 1 Nov 2008 21:26:23 +0100 (CET)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Sat, 1 Nov 2008, Adam Nielsen wrote:

> I would rather write the driver in kernel space (so that it "just works" 
> and provides a hwmon interface without installing extra software), 
> however the device already appears to the system as a USB HID device, 
> and so gets claimed by the existing usbhid driver.

There is a long blacklist/ignorelist in the usbhid driver, for the VID/PID 
combinations that we don't want to have claimed by usbhid driver, because 
there is a more specific one.

> Is there any way to interface with the HID driver from within another 
> driver? Or will I have to claim the device first (or disconnect usbhid), 
> and communicate with it myself?
> I've tried to find some example code from a driver that already does this
> (such as a USB keyboard driver) but I'm having some trouble finding one!  The
> closest drivers I can find are all the ones in drivers/hid/usbhid, but they
> all seem to be "embedded" in hid-core.c. Does that mean I need to modify
> hid-core.c to call my driver?

For 2.6.28, the HID code has been completely refactored, and converted 
into a proper bus, making it possible to write driver easily in a way that 
the driver implements only parts where device deviates from the HID 
standard, and lets the rest to be handled by generic code. I guess this is 
what you are looking for?

Please look at drivers/hid in 2.6.28-rc1 or newer. There are quite a 
couple of drivers already using this new infrastructure.

If you have any further questions, I'll be happy to help you, but I will 
be completely offline until 11th November, sorry.

Hope this helps,

Jiri Kosina

  parent reply	other threads:[~2008-11-01 20:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-01 11:44 Adam Nielsen
2008-11-01 12:08 ` Oliver Neukum
2008-11-01 12:32   ` Adam Nielsen
2008-11-01 14:52     ` Kay Sievers
2008-11-01 20:26 ` Jiri Kosina [this message]
2008-11-01 23:20   ` Adam Nielsen
2008-11-02  6:43     ` Driver for new hid class (was: Can you use the USB HID interface within a driver?) Adam Nielsen
2008-11-02 12:14       ` Driver for new hid class Jiri Slaby

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:

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

  git send-email \ \ \ \ \
    --subject='Re: Can you use the USB HID interface within a driver?' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).