summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcs <jcs@openbsd.org>2018-07-30 15:56:30 +0000
committerjcs <jcs@openbsd.org>2018-07-30 15:56:30 +0000
commit57f285d3fef5a05fcb2a5f30803337c9a941be72 (patch)
tree26c408debfd7971aaf1d47fe8104a50aa4b27b20
parentSome cleanups and clarification, especially regarding locking (observed by rob) (diff)
downloadwireguard-openbsd-57f285d3fef5a05fcb2a5f30803337c9a941be72.tar.xz
wireguard-openbsd-57f285d3fef5a05fcb2a5f30803337c9a941be72.zip
define WSMOUSE_TYPE_TOUCHPAD so non-elantech drivers can stop
claiming to be elantech devices
-rw-r--r--sys/dev/hid/hidmt.c14
-rw-r--r--sys/dev/i2c/iatp.c13
-rw-r--r--sys/dev/usb/ubcmtp.c12
-rw-r--r--sys/dev/wscons/wsconsio.h3
4 files changed, 20 insertions, 22 deletions
diff --git a/sys/dev/hid/hidmt.c b/sys/dev/hid/hidmt.c
index c7653fb822b..7a9b91674cf 100644
--- a/sys/dev/hid/hidmt.c
+++ b/sys/dev/hid/hidmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hidmt.c,v 1.6 2017/10/10 20:31:50 jcs Exp $ */
+/* $OpenBSD: hidmt.c,v 1.7 2018/07/30 15:56:30 jcs Exp $ */
/*
* HID multitouch driver for devices conforming to Windows Precision Touchpad
* standard
@@ -235,7 +235,7 @@ hidmt_configure(struct hidmt *mt)
return;
hw = wsmouse_get_hw(mt->sc_wsmousedev);
- hw->type = WSMOUSE_TYPE_ELANTECH; /* see hidmt_ioctl */
+ hw->type = WSMOUSE_TYPE_TOUCHPAD;
hw->hw_type = (mt->sc_clickpad
? WSMOUSEHW_CLICKPAD : WSMOUSEHW_TOUCHPAD);
hw->x_min = mt->sc_minx;
@@ -468,13 +468,11 @@ hidmt_ioctl(struct hidmt *mt, u_long cmd, caddr_t data, int flag,
int wsmode;
switch (cmd) {
- case WSMOUSEIO_GTYPE:
- /*
- * So we can specify our own finger/w values to the
- * xf86-input-synaptics driver like pms(4)
- */
- *(u_int *)data = WSMOUSE_TYPE_ELANTECH;
+ case WSMOUSEIO_GTYPE: {
+ struct wsmousehw *hw = wsmouse_get_hw(mt->sc_wsmousedev);
+ *(u_int *)data = hw->type;
break;
+ }
case WSMOUSEIO_GCALIBCOORDS:
wsmc->minx = mt->sc_minx;
diff --git a/sys/dev/i2c/iatp.c b/sys/dev/i2c/iatp.c
index 189b547e189..7c6fdad4dbe 100644
--- a/sys/dev/i2c/iatp.c
+++ b/sys/dev/i2c/iatp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iatp.c,v 1.5 2018/06/22 15:58:26 jcs Exp $ */
+/* $OpenBSD: iatp.c,v 1.6 2018/07/30 15:56:30 jcs Exp $ */
/*
* Atmel maXTouch i2c touchscreen/touchpad driver
* Copyright (c) 2016 joshua stein <jcs@openbsd.org>
@@ -325,7 +325,7 @@ iatp_configure(struct iatp_softc *sc)
hw = wsmouse_get_hw(sc->sc_wsmousedev);
if (sc->sc_touchpad) {
- hw->type = WSMOUSE_TYPE_SYNAPTICS;
+ hw->type = WSMOUSE_TYPE_TOUCHPAD;
hw->hw_type = WSMOUSEHW_CLICKPAD;
} else {
hw->type = WSMOUSE_TYPE_TPANEL;
@@ -415,12 +415,11 @@ iatp_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
wsmc->resy = sc->sc_tsscale.resy;
break;
- case WSMOUSEIO_GTYPE:
- if (sc->sc_touchpad)
- *(u_int *)data = WSMOUSE_TYPE_SYNAPTICS;
- else
- *(u_int *)data = WSMOUSE_TYPE_TPANEL;
+ case WSMOUSEIO_GTYPE: {
+ struct wsmousehw *hw = wsmouse_get_hw(sc->sc_wsmousedev);
+ *(u_int *)data = hw->type;
break;
+ }
case WSMOUSEIO_SETMODE:
if (!sc->sc_touchpad)
diff --git a/sys/dev/usb/ubcmtp.c b/sys/dev/usb/ubcmtp.c
index 388850ea7ea..b4554e5b7a1 100644
--- a/sys/dev/usb/ubcmtp.c
+++ b/sys/dev/usb/ubcmtp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubcmtp.c,v 1.17 2017/06/06 21:53:07 bru Exp $ */
+/* $OpenBSD: ubcmtp.c,v 1.18 2018/07/30 15:56:30 jcs Exp $ */
/*
* Copyright (c) 2013-2014, joshua stein <jcs@openbsd.org>
@@ -521,7 +521,7 @@ ubcmtp_configure(struct ubcmtp_softc *sc)
{
struct wsmousehw *hw = wsmouse_get_hw(sc->sc_wsmousedev);
- hw->type = WSMOUSE_TYPE_ELANTECH; /* see ubcmtp_ioctl */
+ hw->type = WSMOUSE_TYPE_TOUCHPAD;
hw->hw_type = (IS_CLICKPAD(sc->dev_type->type)
? WSMOUSEHW_CLICKPAD : WSMOUSEHW_TOUCHPAD);
hw->x_min = sc->dev_type->l_x.min;
@@ -601,11 +601,11 @@ ubcmtp_ioctl(void *v, unsigned long cmd, caddr_t data, int flag, struct proc *p)
cmd);
switch (cmd) {
- case WSMOUSEIO_GTYPE:
- /* so we can specify our own finger/w values to the
- * xf86-input-synaptics driver like pms(4) */
- *(u_int *)data = WSMOUSE_TYPE_ELANTECH;
+ case WSMOUSEIO_GTYPE: {
+ struct wsmousehw *hw = wsmouse_get_hw(sc->sc_wsmousedev);
+ *(u_int *)data = hw->type;
break;
+ }
case WSMOUSEIO_GCALIBCOORDS:
wsmc->minx = sc->dev_type->l_x.min;
diff --git a/sys/dev/wscons/wsconsio.h b/sys/dev/wscons/wsconsio.h
index 7212e462e06..64478d4efd9 100644
--- a/sys/dev/wscons/wsconsio.h
+++ b/sys/dev/wscons/wsconsio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsconsio.h,v 1.88 2018/05/07 21:58:42 bru Exp $ */
+/* $OpenBSD: wsconsio.h,v 1.89 2018/07/30 15:56:30 jcs Exp $ */
/* $NetBSD: wsconsio.h,v 1.74 2005/04/28 07:15:44 martin Exp $ */
/*
@@ -238,6 +238,7 @@ struct wskbd_encoding_data {
#define WSMOUSE_TYPE_SGI 17 /* SGI serial mouse */
#define WSMOUSE_TYPE_ELANTECH 18 /* Elantech touchpad */
#define WSMOUSE_TYPE_SYNAP_SBTN 19 /* Synaptics soft buttons */
+#define WSMOUSE_TYPE_TOUCHPAD 20 /* Generic touchpad */
/* Set resolution. Not applicable to all mouse types. */
#define WSMOUSEIO_SRES _IOW('W', 33, u_int)