Subject: Re: kern/28990: synaptics driver - my pointing stick now doesn't work
To: None <rtr@netbsd.org>
From: Steve Woodford <scw@netbsd.org>
List: netbsd-bugs
Date: 01/17/2005 11:40:13
--Boundary-00=_dQ66Bfe+ynsDkXW
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Please apply the attached patch.

With this patch, Synaptics Touchpad support will be enabled only if 
"options PMS_SYNAPTICS_TOUCHPAD" is specified in the kernel config file.

Cheers, Steve


--Boundary-00=_dQ66Bfe+ynsDkXW
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="pms-patch.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="pms-patch.diff"

Index: files.pckbport
===================================================================
RCS file: /cvsroot/src/sys/dev/pckbport/files.pckbport,v
retrieving revision 1.2
diff -u -r1.2 files.pckbport
--- files.pckbport	24 Dec 2004 18:33:06 -0000	1.2
+++ files.pckbport	17 Jan 2005 11:33:39 -0000
@@ -10,7 +10,8 @@
 file	dev/pckbport/wskbdmap_mfii.c	pckbd
 defparam PCKBD_LAYOUT
 
+defflag	opt_pms.h			PMS_SYNAPTICS_TOUCHPAD
 device	pms: wsmousedev
 attach	pms at pckbport
 file	dev/pckbport/pms.c		pms
-file	dev/pckbport/synaptics.c	pms
+file	dev/pckbport/synaptics.c	pms & pms_synaptics_touchpad
Index: pms.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pckbport/pms.c,v
retrieving revision 1.3
diff -u -r1.3 pms.c
--- pms.c	24 Dec 2004 18:33:06 -0000	1.3
+++ pms.c	17 Jan 2005 11:33:39 -0000
@@ -25,6 +25,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_pms.h"
+
 #include <sys/cdefs.h>
 __KERNEL_RCSID(0, "$NetBSD: pms.c,v 1.3 2004/12/24 18:33:06 christos Exp $");
 
@@ -38,7 +40,9 @@
 #include <machine/bus.h>
 
 #include <dev/pckbport/pckbportvar.h>
+#ifdef PMS_SYNAPTICS_TOUCHPAD
 #include <dev/pckbport/synapticsvar.h>
+#endif
 
 #include <dev/pckbport/pmsreg.h>
 #include <dev/pckbport/pmsvar.h>
@@ -192,14 +196,16 @@
 	sc->buttons = 0;
 	sc->protocol = PMS_UNKNOWN;
 
+#ifdef PMS_SYNAPTICS_TOUCHPAD
 	/* Probe for synaptics touchpad. */
 	if (pms_synaptics_probe_init(sc) == 0) {
 		sc->protocol = PMS_SYNAPTICS;
-	} else {
+	} else
+#endif
 		/* Install generic handler. */
 		pckbport_set_inputhandler(sc->sc_kbctag, sc->sc_kbcslot,
 		    pmsinput, sc, sc->sc_dev.dv_xname);
-	}
+
 	a.accessops = &pms_accessops;
 	a.accesscookie = sc;
 
@@ -237,8 +243,10 @@
 
 	pckbport_slot_enable(sc->sc_kbctag, sc->sc_kbcslot, 1);
 
+#ifdef PMS_SYNAPTICS_TOUCHPAD
 	if (sc->protocol == PMS_SYNAPTICS)
 		pms_synaptics_enable(sc);
+#endif
 
 	cmd[0] = PMS_DEV_ENABLE;
 	res = pckbport_enqueue_cmd(sc->sc_kbctag, sc->sc_kbcslot, cmd,
@@ -339,8 +347,10 @@
 		}
 		break;
 	case PWR_RESUME:
+#ifdef PMS_SYNAPTICS_TOUCHPAD
 		if (sc->protocol == PMS_SYNAPTICS)
 			pms_synaptics_resume(sc);
+#endif
 		if (sc->sc_enabled && sc->sc_suspended) {
 			/* recheck protocol & init mouse */
 			sc->protocol = PMS_UNKNOWN;
@@ -426,10 +436,12 @@
 			DPRINTF(("%s: reset error %d\n", sc->sc_dev.dv_xname, 
 			    res));
 
+#ifdef PMS_SYNAPTICS_TOUCHPAD
 		/* For the synaptics case, leave the protocol alone. */
-		if (sc->protocol != PMS_SYNAPTICS) {
+		if (sc->protocol != PMS_SYNAPTICS)
+#endif
 			sc->protocol = PMS_UNKNOWN;
-		}
+
 		pms_enable(sc);
 		if (sc->protocol != save_protocol) {
 #if defined(PMSDEBUG) || defined(DIAGNOSTIC)
Index: pmsvar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pckbport/pmsvar.h,v
retrieving revision 1.1
diff -u -r1.1 pmsvar.h
--- pmsvar.h	24 Dec 2004 18:33:06 -0000	1.1
+++ pmsvar.h	17 Jan 2005 11:33:39 -0000
@@ -62,9 +62,11 @@
 	struct device *sc_wsmousedev;
 	struct proc *sc_event_thread;
 
+#ifdef PMS_SYNAPTICS_TOUCHPAD
 	union {
 		struct synaptics_softc synaptics;
 	} u;
+#endif
 };
 
 #endif
Index: synaptics.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pckbport/synaptics.c,v
retrieving revision 1.3
diff -u -r1.3 synaptics.c
--- synaptics.c	2 Jan 2005 22:37:12 -0000	1.3
+++ synaptics.c	17 Jan 2005 11:33:41 -0000
@@ -46,6 +46,8 @@
  *	- Support pass-through mode (whatever that is; my docs are too old).
  */
 
+#include "opt_pms.h"
+
 #include <sys/cdefs.h>
 
 #include <sys/param.h>

--Boundary-00=_dQ66Bfe+ynsDkXW--