NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/45850: Support for USB multi-touch panels



>Number:         45850
>Category:       kern
>Synopsis:       USB multi-touch panels are not supported
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 17 02:45:00 +0000 2012
>Originator:     Pierre Pronchery <khorben%defora.org@localhost>
>Release:        NetBSD 5.99.60
>Organization:
>Environment:
System: NetBSD syn.defora.rom 5.99.60 NetBSD 5.99.60 (GENERIC) #5: Mon Jan 16 
12:57:14 CET 2012 
khorben%syn.defora.rom@localhost:/home/amd64/obj/sys/arch/amd64/compile/GENERIC 
amd64
Architecture: x86_64
Machine: amd64
>Description:
USB multi-touch panels, as found on the Lenovo IdeaPad S10-3t, are not
supported by NetBSD at the moment. They are also known as "Touch
Digitizers".
>How-To-Repeat:
1. Find a computer equipped with a USB multi-touch panel
2. Run netbsd-current and X on said computer
3. Tap the screen, preferably with a finger
4. Do not expect anything to happen
>Fix:
I have written a driver for these devices, according to the "Digitizer
Drivers for Windows Touch and Pen-Based Computers" paper by Microsoft,
as available at:
http://download.microsoft.com/download/a/d/f/adf1347d-08dc-41a4-9084-623b1194d4b2/DigitizerDrvs_touch.docx

The following PR was also useful while writing this driver:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=40287 

And to adapt the xf86-input-mouse package:
http://mail-index.netbsd.org/current-users/2009/05/25/msg009555.html
http://www.x.org/wiki/Development/Documentation/XorgInputHOWTO  
(I will submit this patch in a separate PR shortly)

Enough said; here is the driver:

=== BEGIN PASTE ===
/*      $NetBSD$        */

/*
 * Copyright (c) 2012 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Pierre Pronchery (khorben%defora.org@localhost).
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 *  USB generic Touch Screen driver.
 */

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD$");

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/device.h>
#include <sys/ioctl.h>
#include <sys/vnode.h>

#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>

#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
#include <dev/usb/usbdevs.h>
#include <dev/usb/usb_quirks.h>
#include <dev/usb/uhidev.h>
#include <dev/usb/hid.h>

#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsmousevar.h>
#include <dev/wscons/tpcalibvar.h>

#ifdef USB_DEBUG
#define DPRINTF(x)      if (utsdebug) printf x
#define DPRINTFN(n,x)   if (utsdebug>(n)) printf x
int     utsdebug = 0;
#else
#define DPRINTF(x)
#define DPRINTFN(n,x)
#endif


struct uts_softc {
        struct uhidev sc_hdev;

        struct hid_location sc_loc_x, sc_loc_y, sc_loc_z;
        struct hid_location sc_loc_btn;

        int sc_enabled;

        int flags;              /* device configuration */
#define UTS_ABS         0x1     /* absolute position */

        u_int32_t               sc_buttons;     /* touchscreen button status */
        device_t                sc_wsmousedev;
        struct tpcalib_softc    sc_tpcalib;     /* calibration */
        struct wsmouse_calibcoords sc_calibcoords;

        char sc_dying;
};

#define TSCREEN_FLAGS_MASK (HIO_CONST|HIO_RELATIVE)

Static void uts_intr(struct uhidev *addr, void *ibuf, u_int len);

Static int      uts_enable(void *);
Static void     uts_disable(void *);
Static int      uts_ioctl(void *, u_long, void *, int, struct lwp *);

const struct wsmouse_accessops uts_accessops = {
        uts_enable,
        uts_ioctl,
        uts_disable,
};

int uts_match(device_t, cfdata_t, void *);
void uts_attach(device_t, device_t, void *);
void uts_childdet(device_t, device_t);
int uts_detach(device_t, int);
int uts_activate(device_t, enum devact);
extern struct cfdriver uts_cd;
CFATTACH_DECL2_NEW(uts, sizeof(struct uts_softc), uts_match, uts_attach,
    uts_detach, uts_activate, NULL, uts_childdet);

int
uts_match(device_t parent, cfdata_t match, void *aux)
{
        struct uhidev_attach_arg *uha = aux;
        int size;
        void *desc;

        uhidev_get_report_desc(uha->parent, &desc, &size);
        if (!hid_is_collection(desc, size, uha->reportid,
                                HID_USAGE2(HUP_DIGITIZERS, HUD_TOUCH_SCREEN)) &&
                        !hid_is_collection(desc, size, uha->reportid,
                                HID_USAGE2(HUP_DIGITIZERS, HUD_FINGER)))
                return (UMATCH_NONE);

        return (UMATCH_IFACECLASS);
}

void
uts_attach(device_t parent, device_t self, void *aux)
{
        struct uts_softc *sc = device_private(self);
        struct uhidev_attach_arg *uha = aux;
        struct wsmousedev_attach_args a;
        int size;
        void *desc;
        u_int32_t flags;
        struct hid_data * d;
        struct hid_item item;

        aprint_naive("\n");

        sc->sc_hdev.sc_dev = self;
        sc->sc_hdev.sc_intr = uts_intr;
        sc->sc_hdev.sc_parent = uha->parent;
        sc->sc_hdev.sc_report_id = uha->reportid;

        uhidev_get_report_desc(uha->parent, &desc, &size);

        if (!pmf_device_register(self, NULL, NULL))
                aprint_error_dev(self, "couldn't establish power handler\n");

        /* requires HID usage Generic_Desktop:X */
        if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
                uha->reportid, hid_input, &sc->sc_loc_x, &flags)) {
                aprint_error("\n%s: touchscreen has no X report\n",
                        device_xname(sc->sc_hdev.sc_dev));
                return;
        }
        switch (flags & TSCREEN_FLAGS_MASK) {
        case 0:
                sc->flags |= UTS_ABS;
                break;
        case HIO_RELATIVE:
                break;
        default:
                aprint_error("\n%s: X report 0x%04x not supported\n",
                        device_xname(sc->sc_hdev.sc_dev), flags);
                return;
        }

        /* requires HID usage Generic_Desktop:Y */
        if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
                uha->reportid, hid_input, &sc->sc_loc_y, &flags)) {
                aprint_error("\n%s: touchscreen has no Y report\n",
                        device_xname(sc->sc_hdev.sc_dev));
                return;
        }
        switch (flags & TSCREEN_FLAGS_MASK) {
        case 0:
                sc->flags |= UTS_ABS;
                break;
        case HIO_RELATIVE:
                break;
        default:
                aprint_error("\n%s: Y report 0x%04x not supported\n",
                        device_xname(sc->sc_hdev.sc_dev), flags);
                return;
        }

        /* requires HID usage Digitizer:Tip_Switch */
        if (!hid_locate(desc, size, HID_USAGE2(HUP_DIGITIZERS, HUD_TIP_SWITCH),
                                uha->reportid, hid_input, &sc->sc_loc_btn, 0)) {
                aprint_error("\n%s: touchscreen has no tip switch report\n",
                        device_xname(sc->sc_hdev.sc_dev));
                return;
        }

        /* requires HID usage Digitizer:In_Range */
        if (!hid_locate(desc, size, HID_USAGE2(HUP_DIGITIZERS, HUD_IN_RANGE),
                uha->reportid, hid_input, &sc->sc_loc_z, &flags)) {
                aprint_error("\n%s: touchscreen has no range report\n",
                        device_xname(sc->sc_hdev.sc_dev));
                return;
        }

        /* multi-touch support would need HUD_CONTACTID and HUD_CONTACTMAX */

#ifdef USB_DEBUG
        DPRINTF(("uts_attach: sc=%p\n", sc));
        DPRINTF(("uts_attach: X\t%d/%d\n",
                sc->sc_loc_x.pos, sc->sc_loc_x.size));
        DPRINTF(("uts_attach: Y\t%d/%d\n",
                sc->sc_loc_y.pos, sc->sc_loc_y.size));
        DPRINTF(("uts_attach: Z\t%d/%d\n",
                sc->sc_loc_z.pos, sc->sc_loc_z.size));
#endif

        a.accessops = &uts_accessops;
        a.accesscookie = sc;

        sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint);

        /* calibrate the touchscreen */
        memset(&sc->sc_calibcoords, 0, sizeof(sc->sc_calibcoords));
        sc->sc_calibcoords.maxx = 4095;
        sc->sc_calibcoords.maxy = 4095;
        sc->sc_calibcoords.samplelen = WSMOUSE_CALIBCOORDS_RESET;
        d = hid_start_parse(desc, size, hid_input);
        while (hid_get_item(d, &item)) {
                if (item.kind != hid_input
                        || HID_GET_USAGE_PAGE(item.usage) != HUP_GENERIC_DESKTOP
                        || item.report_ID != sc->sc_hdev.sc_report_id)
                        continue;
                if (HID_GET_USAGE(item.usage) == HUG_X) {
                        sc->sc_calibcoords.minx = item.logical_minimum;
                        sc->sc_calibcoords.maxx = item.logical_maximum;
                }
                if (HID_GET_USAGE(item.usage) == HUG_Y) {
                        sc->sc_calibcoords.miny = item.logical_minimum;
                        sc->sc_calibcoords.maxy = item.logical_maximum;
                }
        }
        hid_end_parse(d);

        tpcalib_init(&sc->sc_tpcalib);
        tpcalib_ioctl(&sc->sc_tpcalib, WSMOUSEIO_SCALIBCOORDS,
                (void *)&sc->sc_calibcoords, 0, 0);

        return;
}

int
uts_detach(device_t self, int flags)
{
        struct uts_softc *sc = device_private(self);
        int rv = 0;

        DPRINTF(("uts_detach: sc=%p flags=%d\n", sc, flags));

        if (sc->sc_wsmousedev != NULL)
                rv = config_detach(sc->sc_wsmousedev, flags);

        pmf_device_deregister(self);

        return (rv);
}

void
uts_childdet(device_t self, device_t child)
{
        struct uts_softc *sc = device_private(self);

        KASSERT(sc->sc_wsmousedev == child);
        sc->sc_wsmousedev = NULL;
}

int
uts_activate(device_t self, enum devact act)
{
        struct uts_softc *sc = device_private(self);

        switch (act) {
        case DVACT_DEACTIVATE:
                sc->sc_dying = 1;
                return 0;
        default:
                return EOPNOTSUPP;
        }
}

Static int
uts_enable(void *v)
{
        struct uts_softc *sc = v;

        DPRINTFN(1,("uts_enable: sc=%p\n", sc));

        if (sc->sc_dying)
                return (EIO);

        if (sc->sc_enabled)
                return (EBUSY);

        sc->sc_enabled = 1;
        sc->sc_buttons = 0;

        return (uhidev_open(&sc->sc_hdev));
}

Static void
uts_disable(void *v)
{
        struct uts_softc *sc = v;

        DPRINTFN(1,("uts_disable: sc=%p\n", sc));
#ifdef DIAGNOSTIC
        if (!sc->sc_enabled) {
                printf("uts_disable: not enabled\n");
                return;
        }
#endif

        sc->sc_enabled = 0;
        uhidev_close(&sc->sc_hdev);
}

Static int
uts_ioctl(void *v, u_long cmd, void *data, int flag, struct lwp *l)
{
        struct uts_softc *sc = v;

        switch (cmd) {
        case WSMOUSEIO_GTYPE:
                if (sc->flags & UTS_ABS)
                        *(u_int *)data = WSMOUSE_TYPE_TPANEL;
                else
                        *(u_int *)data = WSMOUSE_TYPE_USB;
                return (0);
        case WSMOUSEIO_SCALIBCOORDS:
        case WSMOUSEIO_GCALIBCOORDS:
                return tpcalib_ioctl(&sc->sc_tpcalib, cmd, data, flag, l);
        }

        return (EPASSTHROUGH);
}

void
uts_intr(struct uhidev *addr, void *ibuf, u_int len)
{
        struct uts_softc *sc = (struct uts_softc *)addr;
        int dx, dy, dz;
        u_int32_t buttons = 0;
        int flags, s;

        DPRINTFN(5,("uts_intr: len=%d\n", len));

        flags = WSMOUSE_INPUT_DELTA | WSMOUSE_INPUT_ABSOLUTE_Z;

        dx = hid_get_data(ibuf, &sc->sc_loc_x);
        if (sc->flags & UTS_ABS) {
                flags |= (WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y);
                dy = hid_get_data(ibuf, &sc->sc_loc_y);
                tpcalib_trans(&sc->sc_tpcalib, dx, dy, &dx, &dy);
        } else
                dy = -hid_get_data(ibuf, &sc->sc_loc_y);
        dz = hid_get_data(ibuf, &sc->sc_loc_z);

        if (hid_get_data(ibuf, &sc->sc_loc_btn))
                buttons |= 1;

        if (dx != 0 || dy != 0 || dz != 0 || buttons != sc->sc_buttons) {
                DPRINTFN(10,("uts_intr: x:%d y:%d z:%d buttons:0x%x\n",
                        dx, dy, dz, buttons));
                sc->sc_buttons = buttons;
                if (sc->sc_wsmousedev != NULL) {
                        s = spltty();
                        wsmouse_input(sc->sc_wsmousedev, buttons, dx, dy, dz, 0,
                                flags);
                        splx(s);
                }
        }
}
=== END PASTE ===

I have backported (but not tested) this driver to NetBSD 5 as well; the
changes are trivial (if any was really necessary) but I can of course
provide it as well if desired/necessary.

A corresponding manual page could be:

=== BEGIN PASTE ===
.\" $NetBSD$
.\"
.\" Copyright (c) 2012 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Pierre Pronchery.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd January 16, 2012
.Dt UTS 4
.Os
.Sh NAME
.Nm uts
.Nd USB generic touchscreens
.Sh SYNOPSIS
.Cd "uts*     at uhidev? reportid ?"
.Cd "wsmouse* at uts?"
.Sh DESCRIPTION
The
.Nm
driver provides support for USB touchscreens, otherwise known as Touch 
Digitizer devices.
Access to panel events is through the
.Xr wsmouse 4
driver.
.Sh SEE ALSO
.Xr uhidev 4 ,
.Xr wsmouse 4
.Sh HISTORY
The
.Nm
driver was written by Pierre Pronchery for
.Nx .
The
.Nm
driver appeared in
.Nx 6.0 .
.Sh BUGS
.Nm
currently does not support calibration.
Also, not all
.Nx Ns -supplied
X servers support the absolute position events it generates.
=== END PASTE ===

Some additional modifications to the source tree were useful as well:

Index: share/man/man4/Makefile
===================================================================
RCS file: /cvsroot/src/share/man/man4/Makefile,v
retrieving revision 1.577
diff -p -u -r1.577 Makefile
--- share/man/man4/Makefile     9 Jan 2012 15:16:31 -0000       1.577
+++ share/man/man4/Makefile     17 Jan 2012 00:53:50 -0000
@@ -74,7 +74,7 @@ MAN+= stuirda.4 u3g.4 uaudio.4 uberry.4 
        udsbr.4 uftdi.4 ugen.4 ugensa.4 uhid.4 \
        uhidev.4 uhmodem.4 uhso.4 uipaq.4 uirda.4 ukbd.4 ukyopon.4 ulpt.4 \
        umass.4 umct.4 umidi.4 umodem.4 ums.4 uplcom.4 urio.4 usb.4 \
-       uscanner.4 uslsa.4 usscanner.4 ustir.4 uvisor.4 uvscom.4 uyap.4 \
+       uscanner.4 uslsa.4 usscanner.4 ustir.4 uts.4 uvisor.4 uvscom.4 uyap.4 \
        aue.4 atu.4 axe.4 cdce.4 cue.4 kue.4 upgt.4 upl.4 url.4 udav.4 \
        ehci.4 ohci.4 slhci.4 uhci.4 uthum.4 utoppy.4 uvideo.4 uyurex.4 \
        urndis.4
Index: share/man/man4/wsmouse.4
===================================================================
RCS file: /cvsroot/src/share/man/man4/wsmouse.4,v
retrieving revision 1.18
diff -p -u -r1.18 wsmouse.4
--- share/man/man4/wsmouse.4    9 Mar 2009 19:24:28 -0000       1.18
+++ share/man/man4/wsmouse.4    17 Jan 2012 00:53:51 -0000
@@ -38,6 +38,8 @@
 (PS/2 mouse, including ``IntelliMouse''-compatible wheel mice)
 .Cd "wsmouse*   at ums? mux 0"
 (USB mouse)
+.Cd "wsmouse*   at uts? mux 0"
+(USB touchscreen)
 .Cd "wsmouse*   at lms? mux 0"
 (Logitech bus mouse, i386 only)
 .Cd "wsmouse*   at mms? mux 0"
@@ -124,6 +126,7 @@ above for more details.
 .Xr pms 4 ,
 .Xr uep 4 ,
 .Xr ums 4 ,
+.Xr uts 4 ,
 .Xr wscons 4 ,
 .Xr wsmux 4 ,
 .Xr moused 8 ,
Index: sys/arch/amd64/conf/GENERIC
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/conf/GENERIC,v
retrieving revision 1.344
diff -p -u -r1.344 GENERIC
--- sys/arch/amd64/conf/GENERIC 15 Jan 2012 15:05:07 -0000      1.344
+++ sys/arch/amd64/conf/GENERIC 17 Jan 2012 00:53:52 -0000
@@ -831,6 +834,10 @@ uhidev* at uhub? port ? configuration ? 
 ums*   at uhidev? reportid ?
 wsmouse* at ums? mux 0
 
+# USB Touchscreens
+uts*   at uhidev? reportid ?
+wsmouse* at uts? mux 0
+
 # USB eGalax touch-panel
 uep*   at uhub? port ?
 wsmouse* at uep? mux 0
Index: sys/dev/usb/FILES
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/FILES,v
retrieving revision 1.11
diff -p -u -r1.11 FILES
--- sys/dev/usb/FILES   4 Nov 2010 03:14:54 -0000       1.11
+++ sys/dev/usb/FILES   17 Jan 2012 00:54:06 -0000
@@ -80,6 +80,7 @@ usbdivar.h            internal defines and structu
 uscanner.c             minimal USB scanner driver
 usscanner.c            driver for some SCSI-over-USB scanners
 usbhid.h               USB HID class definitions
+uts.c                  USB touchscreen driver
 uvisor.c               USB Handsping Visor driver
 uyap.c                 Initial firmware downloader for Y@P phones
 uyap_firmware.h                Firmware for the Y@P phone
Index: sys/dev/usb/files.usb
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/files.usb,v
retrieving revision 1.118
diff -p -u -r1.118 files.usb
--- sys/dev/usb/files.usb       14 Jan 2012 21:06:01 -0000      1.118
+++ sys/dev/usb/files.usb       17 Jan 2012 00:54:06 -0000
@@ -91,6 +91,11 @@ device       ums: hid, wsmousedev
 attach ums at uhidbus
 file   dev/usb/ums.c                   ums
 
+# Touchscreens
+device uts: hid, wsmousedev
+attach uts at uhidbus
+file   dev/usb/uts.c                   uts
+
 # eGalax USB Touch Panel
 device uep: wsmousedev, tpcalib
 attach uep at usbdevif
Index: sys/dev/usb/usbdevices.config
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usbdevices.config,v
retrieving revision 1.11
diff -p -u -r1.11 usbdevices.config
--- sys/dev/usb/usbdevices.config       31 Dec 2011 15:01:06 -0000      1.11
+++ sys/dev/usb/usbdevices.config       17 Jan 2012 00:54:07 -0000
@@ -37,6 +37,10 @@ uhidev*      at uhub? port ? configuration ? 
 ums*   at uhidev? reportid ?
 wsmouse* at ums? mux 0
 
+# USB Touchscreens
+uts*   at uhidev? reportid ?
+wsmouse* at uts? mux 0
+
 # USB Keyboards
 ukbd*  at uhidev? reportid ?
 wskbd* at ukbd? console ? mux 1
Index: sys/dev/usb/usbhid.h
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usbhid.h,v
retrieving revision 1.13
diff -p -u -r1.13 usbhid.h
--- sys/dev/usb/usbhid.h        28 Apr 2008 20:24:01 -0000      1.13
+++ sys/dev/usb/usbhid.h        17 Jan 2012 00:54:07 -0000
@@ -133,6 +133,8 @@ typedef struct usb_hid_descriptor {
 
 /* Usages Digitizers */
 #define HUD_UNDEFINED          0x0000
+#define HUD_TOUCH_SCREEN       0x0004
+#define HUD_FINGER             0x0022
 #define HUD_TIP_PRESSURE       0x0030
 #define HUD_BARREL_PRESSURE    0x0031
 #define HUD_IN_RANGE           0x0032
Index: usb_hid_usages
===================================================================
RCS file: /cvsroot/src/lib/libusbhid/usb_hid_usages,v
retrieving revision 1.4
diff -p -u -r1.4 usb_hid_usages
--- usb_hid_usages      10 Jul 2009 22:11:58 -0000      1.4
+++ usb_hid_usages      17 Jan 2012 01:17:26 -0000
@@ -858,6 +858,10 @@
        0x44    Barrel Switch
        0x45    Eraser
        0x46    Tablet Pick
+       0x51    Contact ID
+       0x53    Device Index
+       0x54    Contact Count
+       0x55    Contact Count Maximum
 
 15     Physical Interface Device
 



Home | Main Index | Thread Index | Old Index