[PATCH 11/18] Check multi_touch module parameter and enable forcibly

Takashi Iwai tiwai at suse.de
Fri Oct 8 10:22:35 PDT 2010


Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 src/eventcomm.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 5969448..2223bac 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -179,6 +179,27 @@ event_query_info(InputInfoPtr pInfo)
     }
 }
 
+/* enable multi-touch feature via module parameter */
+#define MULTI_TOUCH_SYSFS_PARM	"/sys/module/psmouse/parameters/multi_touch"
+static void enable_multi_touch(void)
+{
+    int fd;
+    char val = '0';
+    fd = open(MULTI_TOUCH_SYSFS_PARM, O_RDONLY);
+    if (fd < 0)
+	return;
+    read(fd, &val, 1);
+    close(fd);
+    if (val == '1' || val == '2')
+	return;
+    fd = open(MULTI_TOUCH_SYSFS_PARM, O_WRONLY);
+    if (fd < 0)
+	return;
+    val = '1';
+    write(fd, &val, 1);
+    close(fd);
+}
+
 static void event_query_multi_touch(LocalDevicePtr local)
 {
     SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
@@ -535,6 +556,7 @@ EventReadDevDimensions(InputInfoPtr pInfo)
     SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
     BOOL *need_grab = (BOOL*)priv->proto_data;
 
+    enable_multi_touch();
     if (event_query_is_touchpad(pInfo->fd, (need_grab) ? *need_grab : TRUE))
 	event_query_axis_ranges(pInfo);
     event_query_info(pInfo);
-- 
1.7.3.1



More information about the xorg-devel mailing list