On Fri, Aug 09, 2013 at 08:35:49AM +0200, Matthieu Herrb wrote:
> And you can also do the next step and tedu uhts
The following diff "tedus" uhts(4). This is the first driver I have
"tedued", so please check carefully.
Index: share/man/man4/Makefile
===================================================================
RCS file: /cvs/src/share/man/man4/Makefile,v
retrieving revision 1.550
diff -u -p -r1.550 Makefile
--- share/man/man4/Makefile 6 Jun 2013 15:30:51 -0000 1.550
+++ share/man/man4/Makefile 10 Aug 2013 11:26:34 -0000
@@ -57,7 +57,7 @@ MAN= aac.4 ac97.4 acphy.4 \
tlphy.4 thmc.4 tqphy.4 trm.4 trunk.4 tsl.4 tty.4 tun.4 twe.4 txp.4 \
txphy.4 uaudio.4 uark.4 uath.4 uberry.4 ubsa.4 ubsec.4 ubt.4 \
ucom.4 uchcom.4 ucycom.4 udav.4 udcf.4 udfu.4 udl.4 udp.4 udsbr.4 \
- ueagle.4 uftdi.4 ugen.4 uguru.4 uhci.4 uhid.4 uhidev.4 uhts.4 \
+ ueagle.4 uftdi.4 ugen.4 uguru.4 uhci.4 uhid.4 uhidev.4 \
uipaq.4 uk.4 ukbd.4 \
ukphy.4 ulpt.4 umass.4 umbg.4 umct.4 umidi.4 umodem.4 ums.4 umsm.4 \
unix.4 uow.4 uoaklux.4 uoakrh.4 uoakv.4 \
Index: share/man/man4/uhts.4
===================================================================
RCS file: share/man/man4/uhts.4
diff -N share/man/man4/uhts.4
--- share/man/man4/uhts.4 10 Dec 2009 16:25:41 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,71 +0,0 @@
-.\" $OpenBSD: uhts.4,v 1.2 2009/12/10 16:25:41 deraadt Exp $
-.\"
-.\" Copyright (c) 2009 Matthieu Herrb <[email protected]>
-.\" Copyright (c) 2005 Robert Nagy <[email protected]>
-.\"
-.\" Permission to use, copy, modify, and distribute this software for any
-.\" purpose with or without fee is hereby granted, provided that the above
-.\" copyright notice and this permission notice appear in all copies.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.\"
-.Dd $Mdocdate: December 10 2009 $
-.Dt UHTS 4
-.Os
-.Sh NAME
-.Nm uhts
-.Nd USB HID touchscreen support
-.Sh SYNOPSIS
-.Cd "uhts* at uhidev?"
-.Cd "wsmouse* at uhts? mux 0"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides support for USB Human Interface Device touchscreens.
-Access to the touchscreen is provided through the
-.Xr wscons 4
-framework.
-.Pp
-Touching the screen will emulate mouse button 0 being pressed.
-.Pp
-The touchscreen sensor is poorly aligned, therefore
-.Xr xtsscale 1
-should be used to provide calibration results to the
-.Nm
-driver.
-.Pp
-The
-.Nm
-driver works with the following touchscreens and panels:
-.Pp
-.Bl -dash -offset indent -compact
-.It
-Iyama ProLite T1530SR-B2
-.It
-Iyama ProLite T1730SR-B2
-.El
-.Sh SEE ALSO
-.Xr xtsscale 1 ,
-.Xr uhub 4 ,
-.Xr usb 4 ,
-.Xr wscons 4 ,
-.Xr wsmouse 4
-.Sh HISTORY
-The
-.Nm
-driver first appeared in
-.Ox 4.7 .
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-driver was written by
-.An Robert Nagy
-and
-.An Matthieu Herrb .
Index: share/man/man4/usb.4
===================================================================
RCS file: /cvs/src/share/man/man4/usb.4,v
retrieving revision 1.141
diff -u -p -r1.141 usb.4
--- share/man/man4/usb.4 9 Aug 2013 22:10:17 -0000 1.141
+++ share/man/man4/usb.4 10 Aug 2013 11:26:34 -0000
@@ -244,9 +244,6 @@ D-Link DSB-R100 USB radio device
Generic driver for Human Interface Devices
.It Xr uhidev 4
Base driver for all Human Interface Devices
-.It Xr uhts 4
-.Tn USB
-HID touchscreen support
.It Xr ukbd 4
.Tn USB
keyboards that follow the boot protocol
Index: sys/arch/amd64/conf/GENERIC
===================================================================
RCS file: /cvs/src/sys/arch/amd64/conf/GENERIC,v
retrieving revision 1.342
diff -u -p -r1.342 GENERIC
--- sys/arch/amd64/conf/GENERIC 1 Jun 2013 01:13:33 -0000 1.342
+++ sys/arch/amd64/conf/GENERIC 10 Aug 2013 11:26:35 -0000
@@ -207,8 +207,6 @@ umass* at uhub? # USB Mass Storage devi
uhidev* at uhub? # Human Interface Devices
ums* at uhidev? # USB mouse
wsmouse* at ums? mux 0
-uhts* at uhidev? # USB HID touch screen
-wsmouse* at uhts? mux 0
uts* at uhub? # USB touchscreen
wsmouse* at uts? mux 0
ukbd* at uhidev? # USB keyboard
Index: sys/arch/i386/conf/GENERIC
===================================================================
RCS file: /cvs/src/sys/arch/i386/conf/GENERIC,v
retrieving revision 1.747
diff -u -p -r1.747 GENERIC
--- sys/arch/i386/conf/GENERIC 1 Jun 2013 01:13:34 -0000 1.747
+++ sys/arch/i386/conf/GENERIC 10 Aug 2013 11:26:36 -0000
@@ -260,8 +260,6 @@ ums* at uhidev? # USB mouse
wsmouse* at ums? mux 0
uts* at uhub? # USB touchscreen
wsmouse* at uts? mux 0
-uhts* at uhidev? # USB HID touch screen
-wsmouse* at uhts? mux 0
ukbd* at uhidev? # USB keyboard
wskbd* at ukbd? mux 1
ucycom* at uhidev? # Cypress serial
Index: sys/arch/macppc/conf/GENERIC
===================================================================
RCS file: /cvs/src/sys/arch/macppc/conf/GENERIC,v
retrieving revision 1.220
diff -u -p -r1.220 GENERIC
--- sys/arch/macppc/conf/GENERIC 6 Jul 2013 17:40:01 -0000 1.220
+++ sys/arch/macppc/conf/GENERIC 10 Aug 2013 11:26:36 -0000
@@ -254,8 +254,6 @@ ums* at uhidev? # USB mouse
wsmouse* at ums? mux 0
uts* at uhub? # USB touchscreen
wsmouse* at uts? mux 0
-uhts* at uhidev? # USB HID touch screen
-wsmouse* at uhts? mux 0
ukbd* at uhidev? # USB keyboard
wskbd* at ukbd? mux 1
ucycom* at uhidev? # Cypress serial
Index: sys/dev/usb/files.usb
===================================================================
RCS file: /cvs/src/sys/dev/usb/files.usb,v
retrieving revision 1.105
diff -u -p -r1.105 files.usb
--- sys/dev/usb/files.usb 31 May 2013 19:32:30 -0000 1.105
+++ sys/dev/usb/files.usb 10 Aug 2013 11:26:39 -0000
@@ -99,10 +99,6 @@ device uts: wsmousedev
attach uts at uhub
file dev/usb/uts.c uts
-device uhts: wsmousedev
-attach uhts at uhidbus
-file dev/usb/uhts.c uhts
-
# Apple USB Touchpad
device utpms: hid, wsmousedev
attach utpms at uhidbus
Index: sys/dev/usb/uhts.c
===================================================================
RCS file: sys/dev/usb/uhts.c
diff -N sys/dev/usb/uhts.c
--- sys/dev/usb/uhts.c 9 Jul 2013 10:16:48 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,443 +0,0 @@
-/* $OpenBSD: uhts.c,v 1.8 2013/07/09 10:16:48 edd Exp $ */
-/*
- * Copyright (c) 2009 Matthieu Herrb <[email protected]>
- * Copyright (c) 2007 Robert Nagy <[email protected]>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson ([email protected]) at
- * Carlstedt Research & Technology.
- *
- * 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.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/selinfo.h>
-#include <sys/poll.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/uhidev.h>
-#include <dev/usb/hid.h>
-
-#include <dev/wscons/wsconsio.h>
-#include <dev/wscons/wsmousevar.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) do { if (uhtsdebug) printf x; } while (0)
-#define DPRINTFN(n,x) do { if (uhtsdebug>(n)) printf x; } while (0)
-int uhtsdebug = 0;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-#define UHTSUNIT(s) (minor(s))
-
-/* defined in such a way as to aid merge of hidms.c */
-#define UHTS_TIP 0x100
-#define UHTS_BARELL 0x200
-#define UHTS_ERASER 0x400
-
-struct tsscale {
- int minx, maxx;
- int miny, maxy;
- int swapxy;
- int resx, resy;
-};
-
-struct uhts_softc {
- struct uhidev sc_hdev;
- struct hid_location sc_loc_x, sc_loc_y;
-#define UHTS_MAX_BUTTONS 31
- struct hid_location sc_loc_btn[UHTS_MAX_BUTTONS];
- int sc_num_buttons;
- int sc_enabled;
- u_int32_t sc_buttons; /* mouse button status */
- int sc_rawmode;
- struct tsscale sc_tsscale;
- struct device *sc_wsmousedev;
- char sc_dying;
-};
-
-struct uhts_pos {
- int down;
- int x, y;
- int z; /* touch pressure */
-};
-
-void uhts_intr(struct uhidev *, void *, u_int);
-int uhts_enable(void *);
-void uhts_disable(void *);
-int uhts_ioctl(void *, u_long, caddr_t, int, struct proc *);
-
-const struct wsmouse_accessops uhts_accessops = {
- uhts_enable,
- uhts_ioctl,
- uhts_disable
-};
-
-int uhts_match(struct device *, void *, void *);
-void uhts_attach(struct device *, struct device *, void *);
-int uhts_detach(struct device *, int);
-int uhts_activate(struct device *, int);
-void uhts_parse_desc(struct uhts_softc *);
-
-struct cfdriver uhts_cd = {
- NULL, "uhts", DV_DULL
-};
-
-const struct cfattach uhts_ca = {
- sizeof(struct uhts_softc),
- uhts_match,
- uhts_attach,
- uhts_detach,
- uhts_activate
-};
-
-int
-uhts_match(struct device *parent, void *match, void *aux)
-{
- struct usb_attach_arg *uaa = aux;
- struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)uaa;
- 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_TOUCHSCREEN)))
- return (UMATCH_IFACECLASS);
-
- if (hid_is_collection(desc, size, uha->reportid,
- HID_USAGE2(HUP_DIGITIZERS, HUD_PEN)))
- return (UMATCH_IFACECLASS);
-
- return (UMATCH_NONE);
-}
-
-void
-uhts_parse_desc(struct uhts_softc *sc)
-{
- struct hid_data *d;
- struct hid_item h;
- int size;
- void *desc;
-
- uhidev_get_report_desc(sc->sc_hdev.sc_parent, &desc, &size);
- d = hid_start_parse(desc, size, hid_input);
- while (hid_get_item(d, &h)) {
- if (h.kind != hid_input ||
- HID_GET_USAGE_PAGE(h.usage) != HUP_GENERIC_DESKTOP ||
- h.report_ID != sc->sc_hdev.sc_report_id)
- continue;
- DPRINTF(("uhts: usage=0x%x range %d..%d\n",
- h.usage, h.logical_minimum, h.logical_maximum));
- switch (HID_GET_USAGE(h.usage)) {
- case HUG_X:
- sc->sc_tsscale.minx = h.logical_minimum;
- sc->sc_tsscale.maxx = h.logical_maximum;
- break;
- case HUG_Y:
- sc->sc_tsscale.miny = h.logical_minimum;
- sc->sc_tsscale.maxy = h.logical_maximum;
- break;
- }
- }
-}
-
-void
-uhts_attach(struct device *parent, struct device *self, void *aux)
-{
- struct uhts_softc *sc = (struct uhts_softc *)self;
- struct usb_attach_arg *uaa = aux;
- struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)uaa;
- struct wsmousedev_attach_args a;
- void *desc;
- int size;
- u_int32_t flags, buttons_flags = 0;
-
- sc->sc_hdev.sc_intr = uhts_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 (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
- uha->reportid, hid_input, &sc->sc_loc_x, &flags)) {
- printf("\n%s: touchscreen has no X report\n",
- sc->sc_hdev.sc_dev.dv_xname);
- return;
- }
- if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
- uha->reportid, hid_input, &sc->sc_loc_y, &flags)) {
- printf("\n%s: touchscreen has no Y report\n",
- sc->sc_hdev.sc_dev.dv_xname);
- return;
- }
-
- if (hid_locate(desc, size, HID_USAGE2(HUP_DIGITIZERS,
- HUD_TIP_SWITCH), uha->reportid, hid_input,
- &sc->sc_loc_btn[sc->sc_num_buttons], NULL)){
- buttons_flags |= UHTS_TIP;
- sc->sc_num_buttons++;
- }
-
- if (hid_locate(desc, size, HID_USAGE2(HUP_DIGITIZERS,
- HUD_BARREL_SWITCH), uha->reportid, hid_input,
- &sc->sc_loc_btn[sc->sc_num_buttons], NULL)){
- buttons_flags |= UHTS_BARELL;
- sc->sc_num_buttons++;
- }
-
- if (hid_locate(desc, size, HID_USAGE2(HUP_DIGITIZERS,
- HUD_ERASER), uha->reportid, hid_input,
- &sc->sc_loc_btn[sc->sc_num_buttons], NULL)){
- buttons_flags |= UHTS_ERASER;
- sc->sc_num_buttons++;
- }
-
- printf(": %d button%s",
- sc->sc_num_buttons, sc->sc_num_buttons <= 1 ? "" : "s");
- if (buttons_flags & UHTS_TIP)
- printf(", tip");
- if (buttons_flags & UHTS_BARELL)
- printf(", barrel");
- if (buttons_flags & UHTS_ERASER)
- printf(", eraser");
- printf("\n");
-
- a.accessops = &uhts_accessops;
- a.accesscookie = sc;
-
- uhts_parse_desc(sc);
- sc->sc_rawmode = 0;
- /* wild guess */
- sc->sc_tsscale.swapxy = 0;
- sc->sc_tsscale.resx = 1024;
- sc->sc_tsscale.resy = 768;
-
- sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint);
-}
-
-int
-uhts_activate(struct device *self, int act)
-{
- struct uhts_softc *sc = (struct uhts_softc *)self;
- int rv = 0;
-
- switch (act) {
- case DVACT_DEACTIVATE:
- if (sc->sc_wsmousedev != NULL)
- rv = config_deactivate(sc->sc_wsmousedev);
- sc->sc_dying = 1;
- break;
- }
- return (rv);
-}
-
-int
-uhts_detach(struct device *self, int flags)
-{
- struct uhts_softc *sc = (struct uhts_softc *)self;
- int rv = 0;
-
- DPRINTF(("uhts_detach: sc=%p flags=%d\n", sc, flags));
-
- /* wsmouse takes care of reference counting */
- if (sc->sc_wsmousedev != NULL)
- rv = config_detach(sc->sc_wsmousedev, flags);
- return (rv);
-}
-
-void
-uhts_intr(struct uhidev *addr, void *buf, u_int len)
-{
- struct uhts_softc *sc = (struct uhts_softc *)addr;
- u_char *ibuf = (u_char *)buf;
- struct uhts_pos tp;
- int x, y, s, i;
- u_int32_t buttons = 0;
-
- DPRINTFN(5, ("uhts_intr: len=%d\n", len));
-
- x = hid_get_data(ibuf, &sc->sc_loc_x);
- y = hid_get_data(ibuf, &sc->sc_loc_y);
-
- for (i = 0; i < sc->sc_num_buttons; i++) {
- if (hid_get_data(ibuf, &sc->sc_loc_btn[i]))
- buttons |= 1 << i;
- }
-
- DPRINTFN(10, ("uhts_intr: x:%d y:%d buttons:0x%x\n",
- x, y, buttons));
-
- if (sc->sc_tsscale.swapxy && !sc->sc_rawmode) {
- /* Swap X/Y-Axis */
- tp.y = x;
- tp.x = y;
- } else {
- tp.x = x;
- tp.y = y;
- }
- if (!sc->sc_rawmode &&
- (sc->sc_tsscale.maxx - sc->sc_tsscale.minx) != 0 &&
- (sc->sc_tsscale.maxy - sc->sc_tsscale.miny) != 0) {
- /* Scale down to the screen resolution. */
- tp.x = ((tp.x - sc->sc_tsscale.minx) *
- sc->sc_tsscale.resx) /
- (sc->sc_tsscale.maxx - sc->sc_tsscale.minx);
- tp.y = ((tp.y - sc->sc_tsscale.miny) *
- sc->sc_tsscale.resy) /
- (sc->sc_tsscale.maxy - sc->sc_tsscale.miny);
- }
-
- sc->sc_buttons = buttons;
- tp.z = buttons;
-
- if (sc->sc_wsmousedev != NULL) {
- s = spltty();
- wsmouse_input(sc->sc_wsmousedev, buttons, tp.x, tp.y, tp.z, 0,
- WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
- WSMOUSE_INPUT_ABSOLUTE_Z);
-
- splx(s);
- }
-}
-
-int
-uhts_enable(void *v)
-{
- struct uhts_softc *sc = v;
-
- DPRINTFN(1, ("uhts_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));
-}
-
-void
-uhts_disable(void *v)
-{
- struct uhts_softc *sc = v;
-
- DPRINTFN(1, ("uhts_disable: sc=%p\n", sc));
-#ifdef DIAGNOSTIC
- if (!sc->sc_enabled) {
- printf("uhts_disable: not enabled\n");
- return;
- }
-#endif
- sc->sc_enabled = 0;
- uhidev_close(&sc->sc_hdev);
-}
-
-int
-uhts_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
-{
- struct uhts_softc *sc = v;
- struct wsmouse_calibcoords *wsmc = (struct wsmouse_calibcoords *)data;
- int rc, error = 0;
-
- DPRINTF(("uhts_ioctl(%d, '%c', %d)\n",
- IOCPARM_LEN(cmd), IOCGROUP(cmd), cmd & 0xff));
-
- rc = uhidev_ioctl(&sc->sc_hdev, cmd, data, flag, p);
- if (rc != -1)
- return rc;
-
- switch (cmd) {
- case WSMOUSEIO_GTYPE:
- *(u_int *)data = WSMOUSE_TYPE_TPANEL;
- return (0);
- case WSMOUSEIO_SCALIBCOORDS:
- if (!(wsmc->minx >= 0 && wsmc->maxx >= 0 &&
- wsmc->miny >= 0 && wsmc->maxy >= 0 &&
- wsmc->resx >= 0 && wsmc->resy >= 0 &&
- wsmc->minx < 32768 && wsmc->maxx < 32768 &&
- wsmc->miny < 32768 && wsmc->maxy < 32768 &&
- (wsmc->maxx - wsmc->minx) != 0 &&
- (wsmc->maxy - wsmc->miny) != 0 &&
- wsmc->resx < 32768 && wsmc->resy < 32768 &&
- wsmc->swapxy >= 0 && wsmc->swapxy <= 1 &&
- wsmc->samplelen >= 0 && wsmc->samplelen <= 1))
- return (EINVAL);
-
- sc->sc_tsscale.minx = wsmc->minx;
- sc->sc_tsscale.maxx = wsmc->maxx;
- sc->sc_tsscale.miny = wsmc->miny;
- sc->sc_tsscale.maxy = wsmc->maxy;
- sc->sc_tsscale.swapxy = wsmc->swapxy;
- sc->sc_tsscale.resx = wsmc->resx;
- sc->sc_tsscale.resy = wsmc->resy;
- sc->sc_rawmode = wsmc->samplelen;
- break;
- case WSMOUSEIO_GCALIBCOORDS:
- wsmc->minx = sc->sc_tsscale.minx;
- wsmc->maxx = sc->sc_tsscale.maxx;
- wsmc->miny = sc->sc_tsscale.miny;
- wsmc->maxy = sc->sc_tsscale.maxy;
- wsmc->swapxy = sc->sc_tsscale.swapxy;
- wsmc->resx = sc->sc_tsscale.resx;
- wsmc->resy = sc->sc_tsscale.resy;
- wsmc->samplelen = sc->sc_rawmode;
- break;
- default:
- error = ENOTTY;
- break;
- }
-
- return error;
-}
Index: sys/dev/usb/ums.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/ums.c,v
retrieving revision 1.36
diff -u -p -r1.36 ums.c
--- sys/dev/usb/ums.c 9 Aug 2013 22:10:17 -0000 1.36
+++ sys/dev/usb/ums.c 10 Aug 2013 11:26:39 -0000
@@ -105,19 +105,13 @@ ums_match(struct device *parent, void *m
HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)))
return (UMATCH_IFACECLASS);
- /*
- * For now return a value higher than UMATCH_IFACECLASS to make sure
- * touchscreens and digitizers no longer attach to uhts(4).
- */
if (hid_is_collection(desc, size, uha->reportid,
HID_USAGE2(HUP_DIGITIZERS, HUD_TOUCHSCREEN)))
- return (UMATCH_IFACECLASS_IFACESUBCLASS); /* XXX */
- /* return (UMATCH_IFACECLASS); */
+ return (UMATCH_IFACECLASS);
if (hid_is_collection(desc, size, uha->reportid,
HID_USAGE2(HUP_DIGITIZERS, HUD_PEN)))
- return (UMATCH_IFACECLASS_IFACESUBCLASS); /* XXX */
- /* return (UMATCH_IFACECLASS); */
+ return (UMATCH_IFACECLASS);
return (UMATCH_NONE);
}
--
Best Regards
Edd Barrett
http://www.theunixzoo.co.uk