aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/atkbdc/psm.c
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2019-04-20 21:00:44 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2019-04-20 21:00:44 +0000
commit232e4318b0a349d63ecb4208c9f8e2e14d57004b (patch)
tree7ef13e6ed362bdc44705f29b69308bb6b8dae09c /sys/dev/atkbdc/psm.c
parent80b4b86eb3c69c4a14ef8fcb657628852a2d6e1e (diff)
downloadsrc-232e4318b0a349d63ecb4208c9f8e2e14d57004b.tar.gz
src-232e4318b0a349d63ecb4208c9f8e2e14d57004b.zip
psm(4): Add support for 4 and 5 finger touches in synaptics driver
While 4-th and 5-th finger positions are not exported through PS/2 interface, total number of touches is reported by MT trackpads. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=346455
Diffstat (limited to 'sys/dev/atkbdc/psm.c')
-rw-r--r--sys/dev/atkbdc/psm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index 87d40f101915..10f6a0a0e10d 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -1830,7 +1830,7 @@ psm_register_synaptics(device_t dev)
if (sc->synhw.capClickPad && sc->synhw.topButtonPad)
evdev_support_prop(evdev_a, INPUT_PROP_TOPBUTTONPAD);
evdev_support_key(evdev_a, BTN_TOUCH);
- evdev_support_nfingers(evdev_a, 3);
+ evdev_support_nfingers(evdev_a, sc->synhw.capReportsV ? 5 : 3);
psm_support_abs_bulk(evdev_a, synaptics_absinfo_st);
if (sc->synhw.capAdvancedGestures || sc->synhw.capReportsV)
psm_support_abs_bulk(evdev_a, synaptics_absinfo_mt);
@@ -3212,6 +3212,7 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
{
static int touchpad_buttons;
static int guest_buttons;
+ static int ew_finger_count;
static finger_t f[PSM_FINGERS];
int w, id, nfingers, ewcode, extended_buttons, clickpad_pressed;
@@ -3372,6 +3373,9 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
(pb->ipacket[1] & 0x01)) + 8,
.flags = PSM_FINGER_FUZZY,
};
+ break;
+ case 2:
+ ew_finger_count = pb->ipacket[1] & 0x0f;
default:
break;
}
@@ -3379,6 +3383,11 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms,
goto SYNAPTICS_END;
case 1:
+ if (sc->synhw.capReportsV && ew_finger_count > 3) {
+ nfingers = ew_finger_count;
+ break;
+ }
+ /* FALLTHROUGH */
case 0:
nfingers = w + 2;
break;