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
commit9d0404cfe92c18b7697b3e4ad4a5790b12d2261e (patch)
treee70fd21bd6b035ad8f070510d025678822270b1a
parentd6477cd3a5c3aec6a3492c8423852b09239583a3 (diff)
bcm5974(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/hid/bcm5974.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/hid/bcm5974.c b/sys/dev/hid/bcm5974.c
index 7af6fbc24635..e2efeb08eb2e 100644
--- a/sys/dev/hid/bcm5974.c
+++ b/sys/dev/hid/bcm5974.c
@@ -120,6 +120,7 @@ enum tp_type {
/* list of device capability bits */
#define HAS_INTEGRATED_BUTTON 1
#define USES_COMPACT_REPORT 2
+#define SUPPORTS_FORCETOUCH 4
struct tp_type_params {
uint8_t caps; /* device capability bitmask */
@@ -146,13 +147,13 @@ struct tp_type_params {
.delta = 0,
},
[TYPE4] = {
- .caps = HAS_INTEGRATED_BUTTON,
+ .caps = HAS_INTEGRATED_BUTTON | SUPPORTS_FORCETOUCH,
.button = 31,
.offset = 23 * 2,
.delta = 2,
},
[TYPE_MT2U] = {
- .caps = HAS_INTEGRATED_BUTTON | USES_COMPACT_REPORT,
+ .caps = HAS_INTEGRATED_BUTTON | USES_COMPACT_REPORT | SUPPORTS_FORCETOUCH,
.button = 1,
.offset = 12,
.delta = 0,
@@ -752,7 +753,8 @@ bcm5974_attach(device_t dev)
BCM5974_ABS(sc->sc_evdev, ABS_MT_POSITION_X, sc->sc_params->x);
BCM5974_ABS(sc->sc_evdev, ABS_MT_POSITION_Y, sc->sc_params->y);
/* finger pressure */
- BCM5974_ABS(sc->sc_evdev, ABS_MT_PRESSURE, sc->sc_params->p);
+ if ((sc->sc_params->tp->caps & SUPPORTS_FORCETOUCH) != 0)
+ BCM5974_ABS(sc->sc_evdev, ABS_MT_PRESSURE, sc->sc_params->p);
/* finger touch area */
BCM5974_ABS(sc->sc_evdev, ABS_MT_TOUCH_MAJOR, sc->sc_params->w);
BCM5974_ABS(sc->sc_evdev, ABS_MT_TOUCH_MINOR, sc->sc_params->w);