kern/139272: [patch] [psm] disable synaptics mouse taps
David Horn
dhorn2000 at gmail.com
Thu Oct 1 08:10:01 UTC 2009
>Number: 139272
>Category: kern
>Synopsis: [patch] [psm] disable synaptics mouse taps
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Oct 01 08:10:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: David Horn
>Release: 8.0 RC r197621
>Organization:
>Environment:
FreeBSD xxxxxxx 8.0-RC1 FreeBSD 8.0-RC1 #21 r197621M: Thu Oct 1 02:39:15 EDT 2009 dhorn at xxxxxxxxxxxx:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
The attached patch adds support for disabling or enabling mouse taps on synaptics touch pads (when running in generic mouse mode) using a loader tunable.
On my particular machine, disabling mouse taps is required since the location of the touchpad makes accidental touches of the mouse pad inevitable.
>How-To-Repeat:
>Fix:
See patch
Patch attached with submission follows:
Index: share/man/man4/psm.4
===================================================================
--- share/man/man4/psm.4 (revision 197621)
+++ share/man/man4/psm.4 (working copy)
@@ -359,6 +359,33 @@
This will enable
.Nm
to handle packets from guest devices (sticks) and extra buttons.
+
+If you wish to disable Synaptics touchpad tap events (mouse taps),
+set
+.Va hw.psm.force_tap_events
+to
+.Em 2
+at boot time. This only affects Generic
+.Nm
+mouse support
+(i.e. not when Extended Synaptics support is enabled)
+
+Boot-time
+.Nm
+device debugging is available using the
+.Va debug.psm.loglevel
+tunable.
+
+These tunables can be set in /boot/loader.conf as /etc/sysctl.conf
+executes too late in the boot process. (e.g. hw.psm.force_tap_events="2")
+.Sh SYSCTL VARIABLES
+Once Extended Synaptics support is enabled, many additional sysctl variables
+become available to customize the behavior of the touchpad. See sysctl -d
+.Va hw.psm
+after booting with Extended support enabled.
+Debug logging can be controlled using the
+.Va debug.psm.loglevel
+knob.
.Sh IOCTLS
There are a few
.Xr ioctl 2
Index: sys/dev/atkbdc/psm.c
===================================================================
--- sys/dev/atkbdc/psm.c (revision 197621)
+++ sys/dev/atkbdc/psm.c (working copy)
@@ -346,6 +346,9 @@
static int synaptics_support = 0;
TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support);
+static int force_tap_events = 0;
+TUNABLE_INT("hw.psm.force_tap_events", &force_tap_events);
+
static int verbose = PSM_DEBUG;
TUNABLE_INT("debug.psm.loglevel", &verbose);
@@ -509,10 +512,24 @@
enable_aux_dev(KBDC kbdc)
{
int res;
-
+ int cval = 0x00;
+
res = send_aux_command(kbdc, PSMC_ENABLE_DEV);
VLOG(2, (LOG_DEBUG, "psm: ENABLE_DEV return code:%04x\n", res));
-
+
+ /* and set synaptics touchpad tap mode only if tunable is set
+ - value of 1 will force tap events
+ - value of 2 will force no tap events
+ - value of 0 will not change currect state
+ This only works under standard mouse emulation mode,
+ ignored in enhanced synaptics mode */
+ if (force_tap_events > 0) {
+ if (force_tap_events == 2)
+ cval |= 0x04;
+ mouse_ext_command(kbdc, cval);
+ set_mouse_sampling_rate(kbdc, 20);
+ VLOG(2, (LOG_DEBUG, "psm: set force_tap_events command byte value to:%02x \n", cval));
+ }
return (res == PSM_ACK);
}
@@ -2267,6 +2284,8 @@
static int tap_timeout = PSM_TAP_TIMEOUT;
SYSCTL_INT(_hw_psm, OID_AUTO, tap_timeout, CTLFLAG_RW, &tap_timeout, 0,
"Tap timeout for touchpads");
+SYSCTL_INT(_hw_psm, OID_AUTO, force_tap_events, CTLFLAG_RW, &force_tap_events, 0,
+ "Force tap events 0=no change 1=force events on 2=force events off");
static void
psmintr(void *arg)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list