Thread (8 messages) 8 messages, 3 authors, 2009-01-14

Re: new modular hid?

From: Michael Tokarev <hidden>
Date: 2009-01-14 13:26:23

Jiri Kosina wrote:
On Tue, 13 Jan 2009, Jiri Kosina wrote:
quoted
quoted
I would agree with Michael here, it looks like we went a bit overboard 
with HID quirks. I think sensible solution would be to merge quirks into 
3-4 files (one per device type) and maybe even compile keyboard quirks 
into hid core.
It might seem a too bit too much fine-grained right now, but my 
longer-term plan was to have more sophisticated drivers also register 
themselves to the HID bus, make use of the common parser, etc (Wacom comes 
to mind, for example). 
Having the quirks grouped together rather than nicely separate would then 
bring us close to the previous total mess, when unrelated quirks were 
glued together randomly in the spaghetti-code-way, which I really would 
like to avoid as much as possible, it started to become unmaintainable.
That being said, we of course need to think about the initrd issue brought 
up by Michael.

Compiling everything into single driver back again in the end would of 
course be a solution, but I am afraid that it'd be quite difficult with 
the bus infrastructure in place.
I'm not sure I understand.

Let's take a look at my example, hid_bright.  Without this module, my
keyboard does not work, even if usbhid&Co is loaded.  But this module
does exactly two things:

  hid_hw_start(hdev, HID_CONNECT_DEFAULT);
  usbhid_set_leds(hdev);

(modulo error checking and the like).  The leds (caps, scroll and num
locks) on this keyboard works without the last call (I just checked).
hid_hw_start() gets called from all other drivers too.  So *to me*
it looks like this subdriver does exactly nothing useful.  Yet
w/o it the (perfectly working before 2.6.28) keyboard does not
work.

Maybe, just maybe, it's possible to init stuff by default, and
get additional features or quirks later, when actually loading
the sub-driver?  But any way, this "doing nothing" driver thing
seems to be wrong...

It's even more (to me): I don't understand the "hid bus" thing to
start with.  How the autoload (with udev) works?  I don't see any
modalias things in this module, `modinfo hid_bright' shows nothing
useful, and there are no useful modalias files in /sys/bus/hid/
either.

What mess was before the split?  How it's different from the current
many-small-doing-nothing things?

Thanks!

/mjt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help