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
This commit is contained in:
parent
452a2db863
commit
8fa4620039
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=348817
@ -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 =
|
||||
|
Loading…
Reference in New Issue
Block a user