Date: Wed, 18 Sep 2013 12:12:15 -0400 From: Anthony Jenkins <Scoobi_doo@yahoo.com> To: freebsd-mobile@freebsd.org Subject: PATCH: x11-drivers/xf86-input-synaptics & sysutils/hal Message-ID: <5239D0DF.2080409@yahoo.com>
next in thread | raw e-mail | index | archive | help
It's always bugged me how I can't seem to get Xorg to associate xf86-input-synaptics with my synaptics touchpad on my FreeBSD laptops. These patches appear to work. * sysutils/hal: hal currently declares /dev/psm0 to be an "input.mouse" always; I added code to test for the presence of sysctl hw.psm.synaptics.margin_top and, if found, declare the device to be an "input.touchpad" instead. * x11-drivers/xf86-input-synaptics: There is no AutoDevProbe() method in the SynapticsProtocolOperations struct; I added a naive one which returns TRUE iff the InputInfoPtr name is "PS/2 Mouse" and the char device path starts with "/dev/psm". I have the following ports and their dependencies installed for test (WITHOUT_NEW_XORG=yes in /etc/make.conf): * sysutils/hal * x11/xf86-input-mouse * x11/xf86-input-synaptics Tested the following scenarios: * /etc/rc.conf: moused_enable="YES" added, and commented out * /boot/loader.conf: hw.psm.synaptics_support="1" added, and commented out X server appears to DTRT in each scenario, but I don't seem to have the use of my touchpad scroll area without psm(4) synaptics support turned on. Comments/suggestions welcome, including the proper mailing list/people to send this to and how to get this committed. ...and yes, I know Xorg is dumping sysutils/hal :-) [root@laptop /usr/ports]# svn diff --ignore-properties sysutils/hal x11-drivers/xf86-input-synaptics Index: sysutils/hal/files/patch-hald__freebsd__hf-devtree.c =================================================================== --- sysutils/hal/files/patch-hald__freebsd__hf-devtree.c (revision 0) +++ sysutils/hal/files/patch-hald__freebsd__hf-devtree.c (working copy) @@ -0,0 +1,18 @@ +--- ./hald/freebsd/hf-devtree.c.orig 2013-09-18 08:08:06.796722228 -0400 ++++ ./hald/freebsd/hf-devtree.c 2013-09-18 08:08:21.513708377 -0400 +@@ -203,7 +203,14 @@ + char *devname; + + devname = hf_devtree_device_get_name(device); +- hf_device_set_input(device, "mouse", NULL, devname); ++ if (hf_has_sysctl("hw.psm.synaptics.margin_top")) ++ { ++ hf_device_set_input(device, "touchpad", NULL, devname); ++ } ++ else ++ { ++ hf_device_set_input(device, "mouse", NULL, devname); ++ } + g_free(devname); + } + Index: x11-drivers/xf86-input-synaptics/files/patch-src__psmcomm.c =================================================================== --- x11-drivers/xf86-input-synaptics/files/patch-src__psmcomm.c (revision 0) +++ x11-drivers/xf86-input-synaptics/files/patch-src__psmcomm.c (working copy) @@ -0,0 +1,22 @@ +--- ./src/psmcomm.c.orig 2013-05-12 19:18:02.000000000 -0400 ++++ ./src/psmcomm.c 2013-09-18 08:56:55.344635632 -0400 +@@ -165,11 +165,18 @@ + return PS2ReadHwStateProto(pInfo, &psm_proto_operations, comm, hwRet); + } + ++static Bool ++PSMAutoDevProbe(InputInfoPtr pInfo, const char *device) ++{ ++ return pInfo && pInfo->name && !strcmp(pInfo->name, "PS/2 Mouse") && ++ device && !strncmp(device, "/dev/psm", 8); ++} ++ + struct SynapticsProtocolOperations psm_proto_operations = { + NULL, + NULL, + PSMQueryHardware, + PSMReadHwState, +- NULL, ++ PSMAutoDevProbe, + NULL + }; -- Anthony Jenkins
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5239D0DF.2080409>