aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2026-04-12 18:09:23 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2026-04-12 18:09:23 +0000
commitdc5a94962e21a267550a2c20a0c4707d06843942 (patch)
tree5daf7c36b5ca132a3207f2761c7c281333c640fa
parent9d0404cfe92c18b7697b3e4ad4a5790b12d2261e (diff)
wsp(4): Do not handle pressure on non-ForceTouch devices
They always report it value as zero breaking pressure-driven drivers like moused(8) and xf86-input-synaptics. MFC after: 1 week
-rw-r--r--sys/dev/usb/input/wsp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c
index f78d64f69c08..a78fac49491a 100644
--- a/sys/dev/usb/input/wsp.c
+++ b/sys/dev/usb/input/wsp.c
@@ -231,6 +231,7 @@ enum tp_type {
/* list of device capability bits */
#define HAS_INTEGRATED_BUTTON 1
+#define SUPPORTS_FORCETOUCH 2
/* trackpad finger data block size */
#define FSIZE_TYPE1 (14 * 2)
@@ -285,7 +286,7 @@ struct wsp_tp {
.delta = 0,
},
[TYPE4] = {
- .caps = HAS_INTEGRATED_BUTTON,
+ .caps = HAS_INTEGRATED_BUTTON | SUPPORTS_FORCETOUCH,
.button = BUTTON_TYPE4,
.offset = FINGER_TYPE4,
.fsize = FSIZE_TYPE4,
@@ -896,7 +897,8 @@ wsp_attach(device_t dev)
WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_POSITION_X, sc->sc_params->x);
WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_POSITION_Y, sc->sc_params->y);
/* finger pressure */
- WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_PRESSURE, sc->sc_params->p);
+ if ((sc->sc_params->tp->caps & SUPPORTS_FORCETOUCH) != 0)
+ WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_PRESSURE, sc->sc_params->p);
/* finger major/minor axis */
WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_TOUCH_MAJOR, sc->sc_params->w);
WSP_SUPPORT_ABS(sc->sc_evdev, ABS_MT_TOUCH_MINOR, sc->sc_params->w);