Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Jun 2019 21:33:34 +0000 (UTC)
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r348817 - head/sys/dev/atkbdc
Message-ID:  <201906082133.x58LXYFf067631@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: wulf
Date: Sat Jun  8 21:33:34 2019
New Revision: 348817
URL: https://svnweb.freebsd.org/changeset/base/348817

Log:
  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

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==============================================================================
--- head/sys/dev/atkbdc/psm.c	Sat Jun  8 20:28:04 2019	(r348816)
+++ head/sys/dev/atkbdc/psm.c	Sat Jun  8 21:33:34 2019	(r348817)
@@ -4676,7 +4676,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m
 	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, m
 		 * 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 =



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906082133.x58LXYFf067631>