All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anssi Hannula <anssi.hannula@gmail.com>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, marcel@holtmann.org,
	mit-devel@lists.printk.net, linux-kernel@vger.kernel.org
Subject: Re: HID bus
Date: Sun, 20 Apr 2008 19:15:18 +0300	[thread overview]
Message-ID: <480B6C16.40806@gmail.com> (raw)
In-Reply-To: <1208644696-29129-1-git-send-email-jirislaby@gmail.com>

Jiri Slaby wrote:
> Hmm, I must admit, I didn't know how exactly autoloading works. On suse,
> at least, module aliases are used. So autoloading works for me after this
> patch and slight modifications of the previous patches. The pro of this
> is that it's in-kernel modification of modpost phase.

Indeed in current systems udev uses module aliases for autoloading.

> --
> 
> Generate aliases for usb hid device modules to support autoloading.
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
[...]
> +/* Looks like: usb */

Looks like: "usb:vNpNd*dc*dsc*dp*ic3isc*ip*"

> +static int do_hid_usb_entry(const char *filename,
> +			     struct hid_device_id *id, char *alias)
> +{
> +	__u16 v = TO_NATIVE((__u16)id->vendor);
> +	__u16 p = TO_NATIVE((__u16)id->product);
> +
> +	strcpy(alias, "usb:");
> +	ADD(alias, "v", id->vendor != HID_ANY_ID, v);
> +	ADD(alias, "p", id->product != HID_ANY_ID, p);
> +
> +	sprintf(alias + strlen(alias), "d*dc*dsc*dp*ic%02Xisc*ip*",
> +			USB_INTERFACE_CLASS_HID);
> +
> +	return 1;
> +}

Oh, so we create a normal usb modalias entry anyway, not a custom
'usbhid:' one.

Why not just do something like

#define HID_DEVICE(vend, dev) \
	.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
		       USB_DEVICE_ID_MATCH_INT_CLASS, \
	.idVendor = (vend), \
	.idProduct = (prod), \
	.bInterfaceClass = USB_INTERFACE_CLASS_HID
(see linux/usb.h)

and use USB hotplugging?

Or do we plan to match against something else as well, such as hid
reports or something?

-- 
Anssi Hannula

  parent reply	other threads:[~2008-04-20 16:15 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-04 20:35 Hid bus #2 Jiri Slaby
2008-04-04 20:35 ` [RFC 1/8] HID: make a bus from hid code Jiri Slaby
2008-04-04 20:35 ` [RFC 2/8] HID: hid, make parsing event driven Jiri Slaby
2008-04-04 20:35 ` [RFC 3/8] HID: move ids into separate file Jiri Slaby
2008-04-04 20:35 ` [RFC 4/8] HID: move usage input mapping to hid.h Jiri Slaby
2008-04-04 20:35 ` [RFC 5/8] HID: move logitech report quirks Jiri Slaby
2008-04-04 20:35 ` [RFC 6/8] HID: move ignore quirks Jiri Slaby
2008-04-04 20:35 ` [RFC 7/8] HID: move apple quirks Jiri Slaby
2008-04-16 13:31   ` HID bus Jiri Kosina
2008-04-16 14:43     ` Jiri Slaby
2008-04-16 20:30     ` Jiri Slaby
2008-04-16 20:45       ` Dmitry Torokhov
2008-04-16 20:54         ` Jiri Slaby
2008-04-16 21:05           ` Dmitry Torokhov
2008-04-18 11:36           ` Jiri Kosina
2008-04-19 22:38             ` Jiri Slaby
2008-04-20 11:57               ` Jiri Slaby
2008-04-22  0:00                 ` Jiri Kosina
2008-04-27 11:22                   ` Jiri Slaby
2008-05-09 21:24                   ` Jiri Slaby
2008-04-20 16:15               ` Anssi Hannula [this message]
2008-04-20 18:07                 ` Jiri Slaby
2008-04-21  9:25                 ` Jiri Kosina
2008-04-21 13:36                   ` Dmitry Torokhov
2008-04-21 23:05                     ` Jiri Slaby
2008-04-16 13:45   ` [RFC 7/8] HID: move apple quirks Jiri Kosina
2008-04-16 14:42     ` Jiri Slaby
2008-04-18 11:33       ` Jiri Kosina
2008-04-18 11:35         ` David Miller
2008-04-04 20:35 ` [RFC 8/8] test 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:
  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=480B6C16.40806@gmail.com \
    --to=anssi.hannula@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jirislaby@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mit-devel@lists.printk.net \
    /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.