2009-03-13 12:48:00

by Bill Gribble

[permalink] [raw]
Subject: usbhid: Changes since 2.6.28 in quirk handling?

Hi, I have been maintaining a patch for a quirky USB device built-in to
a UMPC, the Raon Digital Everun. Without the patch, the builtin
keyboard, mouse, and touchscreen are useless. I have never submitted it
for inclusion in the kernel because there are less than 5 people who
have ever even attempted to install Linux on this device, and it's
discontinued. However, *I* use the thing daily, and its wifi device
(libertas) has continued to get better support in the recent kernels so
I port the patch forward.

Anyway the patch adds a quirk handler that does a mandatory
initialization step to turn the USB device on at powerup or resume. In
recent kernels (I moved from 2.6.28, which was reliable, at 2.6.29-rc5,
I believe) this has become unreliable; about half the time the device is
not enabled at boot, and about 1 time in 10 it is disabled when resuming
from suspend-to-RAM.

I noticed that the structure of the quirk handling code has changed
somewhat; I left my patch using the "old" way of adding an entry to
hid_blacklist in hid-quirks.c. Is there a document or email trail that
describes the new way of structuring this quirk code? Any pitfalls to
look out for?

Thanks,
Bill Gribble


Attachments:
everun.patch (3.00 kB)

2009-03-18 14:14:55

by Jiri Kosina

[permalink] [raw]
Subject: Re: usbhid: Changes since 2.6.28 in quirk handling?

On Fri, 13 Mar 2009, Bill Gribble wrote:

> Hi, I have been maintaining a patch for a quirky USB device built-in to
> a UMPC, the Raon Digital Everun. Without the patch, the builtin
> keyboard, mouse, and touchscreen are useless. I have never submitted it
> for inclusion in the kernel because there are less than 5 people who
> have ever even attempted to install Linux on this device, and it's
> discontinued. However, *I* use the thing daily, and its wifi device
> (libertas) has continued to get better support in the recent kernels so
> I port the patch forward.

Hi Bill,

we have drivers (and even whole architectures) supported by the kernel,
which have less than 5 users in the world, that's not a big deal.

It makes 5 people happy, and saves you the pain from having to keep the
out-of-tree code working with the Linux kernel API changing all the time.

> I noticed that the structure of the quirk handling code has changed
> somewhat; I left my patch using the "old" way of adding an entry to
> hid_blacklist in hid-quirks.c. Is there a document or email trail that
> describes the new way of structuring this quirk code? Any pitfalls to
> look out for?

Looking at your patch, the only thing you need is sending a special URB to
the device in order to make it operational, right?

Please look at hid-sony driver, which does exactly that for some of the
PS3 devices.

You then only need to add your device to hid_blacklist[], so that generic
driver doesn't get bound to it and it'd be driven by your special driver.

--
Jiri Kosina
SUSE Labs

2009-03-18 14:29:53

by Bill Gribble

[permalink] [raw]
Subject: Re: usbhid: Changes since 2.6.28 in quirk handling?

On Wed, 2009-03-18 at 15:14 +0100, Jiri Kosina wrote:
> we have drivers (and even whole architectures) supported by the kernel,
> which have less than 5 users in the world, that's not a big deal.

Great to hear that! I will try to clean up my patches according to the
guidelines and send them in.

> Looking at your patch, the only thing you need is sending a special URB to
> the device in order to make it operational, right?

That's right.

> Please look at hid-sony driver, which does exactly that for some of the
> PS3 devices.
>
> You then only need to add your device to hid_blacklist[], so that generic
> driver doesn't get bound to it and it'd be driven by your special driver.

OK, thanks for the advice. I will do that.

Bill Gribble