diff options
author | Vladimir Kondratyev <wulf@FreeBSD.org> | 2019-06-08 21:33:34 +0000 |
---|---|---|
committer | Vladimir Kondratyev <wulf@FreeBSD.org> | 2019-06-08 21:33:34 +0000 |
commit | 8fa46200391063bd5c15a25d9f9b06354fcd4147 (patch) | |
tree | 7102ed1119e30c42da4479b219a772ffa49cf7c0 | |
parent | 452a2db863d0f8ea9aa67e2c8a455bc761e95e0d (diff) | |
download | src-8fa46200391063bd5c15a25d9f9b06354fcd4147.tar.gz src-8fa46200391063bd5c15a25d9f9b06354fcd4147.zip |
psm(4): Fix Elantech trackpoint support.
Sign bits for X and Y motion data were taken from wrong places.
PR: 238291
Reported by: Andrey Kosachenko <andrey.kosachenko@gmail.com>
Tested by: Andrey Kosachenko <andrey.kosachenko@gmail.com>
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=348817
-rw-r--r-- | sys/dev/atkbdc/psm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 6c4947aeeeef..34f29f7c62f8 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -4676,7 +4676,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms, case ELANTECH_PKT_TRACKPOINT: /* 7 6 5 4 3 2 1 0 (LSB) * ------------------------------------------- - * ipacket[0]: 0 0 SX SY 0 M R L + * ipacket[0]: 0 0 SY SX 0 M R L * ipacket[1]: ~SX 0 0 0 0 0 0 0 * ipacket[2]: ~SY 0 0 0 0 0 0 0 * ipacket[3]: 0 0 ~SY ~SX 0 1 1 0 @@ -4687,9 +4687,9 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms, * over 9 bits with SX/SY the relative top bit and * X7..X0 and Y7..Y0 the lower bits. */ - *x = (pb->ipacket[0] & 0x20) ? + *x = (pb->ipacket[0] & MOUSE_PS2_XNEG) ? pb->ipacket[4] - 256 : pb->ipacket[4]; - *y = (pb->ipacket[0] & 0x10) ? + *y = (pb->ipacket[0] & MOUSE_PS2_YNEG) ? pb->ipacket[5] - 256 : pb->ipacket[5]; trackpoint_button = |