From cab5e018dd814a3c77b615727a9552396dc9b547 Mon Sep 17 00:00:00 2001 From: philip Date: Wed, 29 Sep 2004 23:49:57 +0000 Subject: Introduce a tunable to disable support for Synaptics touchpads. A number of people have reported problems (stickyness, aiming difficulty) which is proving difficult to fix, so this will default to disable until sometime after 5.3R. To enable Synaptics support, set the 'hw.psm.synaptics_support=1' tunable. MT5 candidate. Approved by: njl --- sys/dev/atkbdc/psm.c | 12 +++++++++++- sys/isa/psm.c | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 5c6eb88..c38a114 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -233,6 +233,10 @@ static devclass_t psm_devclass; /* other flags (flags) */ #define PSM_FLAGS_FINGERDOWN 0x0001 /* VersaPad finger down */ +/* Tunables */ +static int synaptics_support = 0; +TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support); + /* for backward compatibility */ #define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t) #define OLD_MOUSE_GETMODE _IOR('M', 2, old_mousemode_t) @@ -1716,7 +1720,7 @@ psmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td case MOUSE_SYN_GETHWINFO: s = spltty(); - if (sc->hw.model == MOUSE_MODEL_SYNAPTICS) + if (synaptics_support && sc->hw.model == MOUSE_MODEL_SYNAPTICS) *(synapticshw_t *)addr = sc->synhw; else error = EINVAL; @@ -2518,6 +2522,9 @@ psmsoftintr(void *arg) * Byte 2,5,6 == Byte 1,2,3 of "Guest" */ + if (!synaptics_support) + break; + /* Sanity check for out of sync packets. */ if ((pb->ipacket[0] & 0xc8) != 0x80 || (pb->ipacket[3] & 0xc8) != 0xc0) @@ -3108,6 +3115,9 @@ enable_synaptics(struct psm_softc *sc) int status[3]; KBDC kbdc; + if (!synaptics_support) + return (FALSE); + kbdc = sc->kbdc; disable_aux_dev(kbdc); diff --git a/sys/isa/psm.c b/sys/isa/psm.c index 5c6eb88..c38a114 100644 --- a/sys/isa/psm.c +++ b/sys/isa/psm.c @@ -233,6 +233,10 @@ static devclass_t psm_devclass; /* other flags (flags) */ #define PSM_FLAGS_FINGERDOWN 0x0001 /* VersaPad finger down */ +/* Tunables */ +static int synaptics_support = 0; +TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support); + /* for backward compatibility */ #define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t) #define OLD_MOUSE_GETMODE _IOR('M', 2, old_mousemode_t) @@ -1716,7 +1720,7 @@ psmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td case MOUSE_SYN_GETHWINFO: s = spltty(); - if (sc->hw.model == MOUSE_MODEL_SYNAPTICS) + if (synaptics_support && sc->hw.model == MOUSE_MODEL_SYNAPTICS) *(synapticshw_t *)addr = sc->synhw; else error = EINVAL; @@ -2518,6 +2522,9 @@ psmsoftintr(void *arg) * Byte 2,5,6 == Byte 1,2,3 of "Guest" */ + if (!synaptics_support) + break; + /* Sanity check for out of sync packets. */ if ((pb->ipacket[0] & 0xc8) != 0x80 || (pb->ipacket[3] & 0xc8) != 0xc0) @@ -3108,6 +3115,9 @@ enable_synaptics(struct psm_softc *sc) int status[3]; KBDC kbdc; + if (!synaptics_support) + return (FALSE); + kbdc = sc->kbdc; disable_aux_dev(kbdc); -- cgit v1.1