Arnaud:

I'm happy to give this a try.  I'm sorry I've been so slow to get started on this task.  I intend to write the Perl script this weekend.

Regards,
Andrew

On Nov 5, 2007 12:57 PM, Arnaud Quette <aquette.dev@gmail.com> wrote:
another update:

2007/10/29, Arnaud Quette <aquette.dev@gmail.com>:
> a small update:
>
> I've found out that by grep'ing "USB_DEVICE", we should get most (all
> maybe) entries in the drivers/ dir... cool. The remainder is for the
> daemon/ dir (hw_* drivers iirc)
>
> That gave me a better idea: instead of extracting once for all the
> info, and then be forced to double entries (in the driver and in the
> hal+udev file) for each new submission, we should do the necessary to
> extract all info at will from the driver and generate the hal+udev
> file.
> And the added bonus is the flexibility to enhance the generated result.
>
> We just need to have a standard declaration format in the drivers
> source, such as:
> {  USB_DEVICE(VendorID, ProductID) } /* Comment */
> or
> /* Comment */
> {  USB_DEVICE(VendorID, ProductID) }
>
> @Christoph and the list: any comment are welcome ;-)

Christoph has made an excellent comment
> The latter should be used.
> Otherwise you will easily exceed the 80 columns limit for kernel
> drivers.

Now I'm thinking about defining a "USB_DEVICE" macro for the daemons/
drivers, like:
#define USB_DEVICE(VendorID, ProductID) VendorID,ProductID

so that the USB IDs extraction routine can work for *all* existing IDs...

The only thing needed now is the script (shell or perl) that actually
do this extraction.
I see 3 routines:
* the first extract all IDs and create a [vid,pid] table,
* the 2nd will later be used to generate the udev helper. This point
needs the result of another subproject (the config helper), and will
allow to autoconfigure USB remotes,
* the 3rd generate the hal file using the following template:
- header
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
 <device>
 <match key="info.bus" string="usb_device">
- for each [vid,pid] entry
  <!-- $comment -->
  <match key="usb_device.vendor_id" int="$VendorID">
   <match key="usb_device.product_id" int="$ProductID">
    <merge key="info.category" type="string">input</merge>
    <append key="info.capabilities " type="strlist">input</append>
    <append key="info.capabilities"
type="strlist">input.remote_control</append>
   </match>
  </match>
 </match>
- footer
 </device>
</deviceinfo>


Any volunteer?

I'll check on my side to produce the patch to "standardize" lirc driver...

Arnaud
--
Linux / Unix Expert R&D - MGE Office Protection Systems - http://www.mgeops.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
Free Software Developer - http://arnaud.quette.free.fr/