[PATCH] Fix udev population of input device USB product IDs

Chase Douglas chase.douglas at canonical.com
Mon Aug 30 14:05:40 PDT 2010


On Mon, 2010-08-30 at 11:47 +1000, Peter Hutterer wrote:
> On Thu, Aug 26, 2010 at 06:36:01PM -0400, Chase Douglas wrote:
> > From: Chase Douglas <chase.douglas at ubuntu.com>
> > 
> > The udev device_added function takes the vendor and model IDs of added
> > devices and converts them into an attribute that can be matched for by
> > an InputClass configuration. Currently, the udev mechanism is broken
> > because it looks for the product ID on evdev event nodes instead of the
> > input node.
> 
> at least on my system, ID_VENDOR_ID is provided on the event node and
> ID_MODEL* is the _name_ of the device. The bug I noticed here was that
> instead of ID_VENDOR_MODEL this should probably be just ID_MODEL_ID.

I had thought the event nodes didn't have the IDs for USB devices, but
it turns out they do. However, the real problem is that bluetooth
devices say their ID on the event node is the ID of the bluetooth
receiver, not the device itself.

By reading PRODUCT of the parent input node we can get an accurate
device ID for both USB and BT devices.

> > This patch reads the product ID from the PRODUCT property of the parent
> > of the added device. It has been tested on a bluetooth trackpad and a
> > builtin touchscreen connected over USB.
> 
> right, but AFAICT, this patch always provides the hex IDs of the product.
> xorg.conf documentation for MatchProduct claims
> 
>        MatchProduct  "matchproduct"
>               This entry can be used to check if the substring  "matchproduct"
>               occurs in the device's product name.
> 
> so it seems there are two overlapping issues at hand: one that the usb_id
> should either be constructed like you propose or from
> ID_VENDOR_ID:ID_MODEL_ID, and the other one that ID_VENDOR_MODEL should just
> be ID_VENDOR_MODEL. do I read this right? Dan, any comments?

I'm actually aiming to make MatchUSBID work for bluetooth devices.
Although the name is a little bit unfortunate, I think it only makes
sense to export the BT device ID instead of the USB ID of the bluetooth
receiver. This shouldn't affect MatchProduct functionality.

I'll be sending a new patch soon, maybe today, and I'll fix up the
commit message to make all this more clear.

Thanks,

-- Chase



More information about the xorg-devel mailing list