Querying USB device's bInterfaceNumber

Ping pinglinux at gmail.com
Tue Nov 3 15:48:40 PST 2009


On Tue, Nov 3, 2009 at 3:13 PM, Peter Hutterer <peter.hutterer at who-t.net>wrote:

> On Tue, Nov 03, 2009 at 02:42:03PM -0800, Greg KH wrote:
> > On Tue, Nov 03, 2009 at 02:35:04PM -0800, Ping wrote:
> > > On Tue, Nov 3, 2009 at 2:08 PM, Greg KH <greg at kroah.com> wrote:
> > >
> > > > On Tue, Nov 03, 2009 at 12:19:54PM -0800, Ping wrote:
> > > > > These questions make me feel the kernel driver may need some work.
> > > >  Anyway,
> > > > > let me share what I have now before we can figure out a better
> solution:
> > > > >
> > > > > Wacom supports both penabled and touch digitizers.  The older
> tablets
> > > > > doesn't have touch.  So, there is no problem there.  The newer
> tablets
> > > > have
> > > > > both pen and touch through the same physical USB port. They are
> definded
> > > > in
> > > > > separate HID descriptors with the same vendor id and product id.
>  So, for
> > > > > kernel, I think, it is one physical device.
> > > >
> > > > Yes, but it should show up as 2 different hid devices, right?
> > > >
> > >
> > > Will that help?  Wacom devices are not processed by HID.  We told
> hid-core.c
> > > to ignore all Wacom devices. That is why I said "I am in control" (I
> know I
> > > am not in control. I am most likely in the middle of nowhere :).
> >
> > Heh, ah, that makes more sense now.
> >
> > So you need to intrepret the hid report yourself in your driver and
> > export 2 devices to userspace which your xorg driver should then be able
> > to determine which is which by some type of identifier in them (not the
> > interface number, use the type of the device somehow.)
>
> On that note - if you're exporting two devices to userspace for this
> feature
> how much more work would it be to have it export the other tools as
> separate
> devices as well. Getting rid of the "one device is really four devices"
> seems to be a winner from the X perspective at least. It would slim down
> the
> driver by a great deal.
>

Splitting touch from the other tools may be an option in the kernel. But it
will introduce other work in the X driver, such as, we will need to link
them together in X driver since we need to disable touch when pen tools are
in proximity, etc. The reality is they are actually one physical device,
like it or not.  Translating other pen tools into individual devices would
bring more work than "bundle" them together, I think. So, I don't think
there would be an easy way for X driver to deal with the device on an
one-to-one or one-to-many basis.  It is just a matter of where we are going
to put the effort in.

Making one device into many (stylus/eraser/cursor) is an open source feature
- users get the freedom to make one physical device into many different
types.  Window and Mac can not or do not do this.  From what I
understood/learnt, kernel driver reports the raw data as close as it can
be.  It is up to the X driver to interpret the data whatever/however the way
users or the developers want.


>
> It also means we don't need this massive table in the X driver that decides
> which tools are available for a given device - stuff like that belongs in
> the kernel driver.
>

One way or the other, somewhere we still need to decide which types the
device support.

So, I am more inclined to stay as is, which causes less rework and keeps the
interfaces unchanged.

Ping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.x.org/archives/xorg-devel/attachments/20091103/63a18444/attachment.html 


More information about the xorg-devel mailing list