From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anssi Hannula Subject: Re: HID bus Date: Sun, 20 Apr 2008 19:15:18 +0300 Message-ID: <480B6C16.40806@gmail.com> References: <1208644696-29129-1-git-send-email-jirislaby@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from pne-smtpout3-sn1.fre.skanova.net ([81.228.11.120]:33436 "EHLO pne-smtpout3-sn1.fre.skanova.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbYDTQP1 (ORCPT ); Sun, 20 Apr 2008 12:15:27 -0400 In-Reply-To: <1208644696-29129-1-git-send-email-jirislaby@gmail.com> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Jiri Slaby Cc: Jiri Kosina , Dmitry Torokhov , linux-input@vger.kernel.org, marcel@holtmann.org, mit-devel@lists.printk.net, linux-kernel@vger.kernel.org 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 [...] > +/* 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