[Midnightbsd-cvs] src [8563] trunk/sys/dev/atkbdc/psm.c: support detection of Synaptics touchpad v7.5 and above.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Mon Sep 19 11:21:10 EDT 2016


Revision: 8563
          http://svnweb.midnightbsd.org/src/?rev=8563
Author:   laffer1
Date:     2016-09-19 11:21:10 -0400 (Mon, 19 Sep 2016)
Log Message:
-----------
support detection of Synaptics touchpad v7.5 and above.

Modified Paths:
--------------
    trunk/sys/dev/atkbdc/psm.c

Modified: trunk/sys/dev/atkbdc/psm.c
===================================================================
--- trunk/sys/dev/atkbdc/psm.c	2016-09-19 15:20:37 UTC (rev 8562)
+++ trunk/sys/dev/atkbdc/psm.c	2016-09-19 15:21:10 UTC (rev 8563)
@@ -239,6 +239,10 @@
 #define SYNAPTICS_QUEUE_CURSOR(x)					\
 	(x + SYNAPTICS_PACKETQUEUE) % SYNAPTICS_PACKETQUEUE
 
+#define	SYNAPTICS_VERSION_GE(synhw, major, minor)			\
+    ((synhw).infoMajor > (major) ||					\
+     ((synhw).infoMajor == (major) && (synhw).infoMinor >= (minor)))
+
 typedef struct synapticsaction {
 	synapticspacket_t	queue[SYNAPTICS_PACKETQUEUE];
 	int			queue_len;
@@ -867,7 +871,9 @@
 	if (sc->hw.model == MOUSE_MODEL_SYNAPTICS) {
 		mouse_ext_command(sc->kbdc, 1);
 		get_mouse_status(sc->kbdc, stat, 0, 3);
-		if (stat[1] == 0x47 && stat[2] == 0x40) {
+		if ((SYNAPTICS_VERSION_GE(sc->synhw, 7, 5) ||
+		     stat[1] == 0x47) &&
+		    stat[2] == 0x40) {
 			/* Set the mode byte -- request wmode where
 			 * available */
 			if (sc->synhw.capExtended)
@@ -4381,7 +4387,7 @@
 		return (FALSE);
 	if (get_mouse_status(kbdc, status, 0, 3) != 3)
 		return (FALSE);
-	if (status[1] != 0x47) {
+	if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != 0x47) {
 		printf("  Failed to read extended capability bits\n");
 		return (FALSE);
 	}
@@ -4437,7 +4443,7 @@
 		return (FALSE);
 	if (get_mouse_status(kbdc, status, 0, 3) != 3)
 		return (FALSE);
-	if (status[1] != 0x47) {
+	if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != 0x47) {
 		printf("  Failed to read mode byte\n");
 		return (FALSE);
 	}



More information about the Midnightbsd-cvs mailing list