[xorg-x11-drv-synaptics/f16] Implement a workaround for elantech touchpads (#795708)

Peter Hutterer whot at fedoraproject.org
Fri Mar 2 01:50:35 UTC 2012


commit 6920f43c9ca37256656b167cea53707e23e3f8c8
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Mar 2 11:52:36 2012 +1000

    Implement a workaround for elantech touchpads (#795708)

 ...ement-a-workaround-for-Elantech-touchpads.patch |   69 ++++++++++++++++++++
 xorg-x11-drv-synaptics.spec                        |    7 ++-
 2 files changed, 75 insertions(+), 1 deletions(-)
---
diff --git a/synaptics-Implement-a-workaround-for-Elantech-touchpads.patch b/synaptics-Implement-a-workaround-for-Elantech-touchpads.patch
new file mode 100644
index 0000000..da1f9ec
--- /dev/null
+++ b/synaptics-Implement-a-workaround-for-Elantech-touchpads.patch
@@ -0,0 +1,69 @@
+diff --git a/src/eventcomm.c b/src/eventcomm.c
+index 6147e41..2556fcb 100644
+--- a/src/eventcomm.c
++++ b/src/eventcomm.c
+@@ -293,6 +293,7 @@ static model_lookup_t model_lookup_table[] = {
+ 	{0x0002, 0x0007, MODEL_SYNAPTICS},
+ 	{0x0002, 0x0008, MODEL_ALPS},
+ 	{0x05ac, PRODUCT_ANY, MODEL_APPLETOUCH},
++	{0x0002, 0x000e, MODEL_ELANTECH},
+ 	{0x0, 0x0, 0x0}
+ };
+ 
+diff --git a/src/synaptics.c b/src/synaptics.c
+index 4784157..719e810 100644
+--- a/src/synaptics.c
++++ b/src/synaptics.c
+@@ -386,6 +386,25 @@ calculate_edge_widths(SynapticsPrivate *priv, int *l, int *r, int *t, int *b)
+     *b = priv->maxy - eheight;
+ }
+ 
++static void
++calculate_tap_hysteresis(SynapticsPrivate *priv, int range,
++                         int *fingerLow, int *fingerHigh, int *fingerPress)
++{
++    if (priv->model == MODEL_ELANTECH) {
++        /* All Elantech touchpads don't need the Z filtering to get the
++         * number of fingers correctly. See Documentation/elantech.txt
++         * in the kernel.
++         */
++        *fingerLow  = priv->minp + 1;
++        *fingerHigh = priv->minp + 1;
++    } else {
++        *fingerLow  = priv->minp + range * (25.0/256);
++        *fingerHigh = priv->minp + range * (30.0/256);
++    }
++
++    *fingerPress = priv->minp + range * 1.000;
++}
++
+ /* Area options support both percent values and absolute values. This is
+  * awkward. The xf86Set* calls will print to the log, but they'll
+  * also print an error if we request a percent value but only have an
+@@ -471,10 +490,9 @@ static void set_default_parameters(InputInfoPtr pInfo)
+ 
+     range = priv->maxp - priv->minp + 1;
+ 
++    calculate_tap_hysteresis(priv, range, &fingerLow, &fingerHigh, &fingerPress);
++
+     /* scaling based on defaults and a pressure of 256 */
+-    fingerLow = priv->minp + range * (25.0/256);
+-    fingerHigh = priv->minp + range * (30.0/256);
+-    fingerPress = priv->minp + range * 1.000;
+     emulateTwoFingerMinZ = priv->minp + range * (282.0/256);
+     edgeMotionMinZ = priv->minp + range * (30.0/256);
+     edgeMotionMaxZ = priv->minp + range * (160.0/256);
+diff --git a/src/synapticsstr.h b/src/synapticsstr.h
+index ba1eb13..d4daeba 100644
+--- a/src/synapticsstr.h
++++ b/src/synapticsstr.h
+@@ -112,7 +112,8 @@ enum TouchpadModel {
+     MODEL_UNKNOWN = 0,
+     MODEL_SYNAPTICS,
+     MODEL_ALPS,
+-    MODEL_APPLETOUCH
++    MODEL_APPLETOUCH,
++    MODEL_ELANTECH
+ };
+ 
+ typedef struct _SynapticsParameters
diff --git a/xorg-x11-drv-synaptics.spec b/xorg-x11-drv-synaptics.spec
index 80e5383..9d120f3 100644
--- a/xorg-x11-drv-synaptics.spec
+++ b/xorg-x11-drv-synaptics.spec
@@ -7,7 +7,7 @@
 Name:           xorg-x11-drv-synaptics
 Summary:        Xorg X11 Synaptics touchpad input driver
 Version:        1.5.0
-Release:        2%{?gitdate:.%{gitdate}}%{?dist}
+Release:        3%{?gitdate:.%{gitdate}}%{?dist}
 URL:            http://www.x.org
 License:        MIT
 Group:          User Interface/X Hardware Support
@@ -21,6 +21,8 @@ Source1:        50-synaptics.conf
 Source2:        make-git-snapshot.sh
 Source3:        70-touchpad-quirks.rules
 
+Patch01:        synaptics-Implement-a-workaround-for-Elantech-touchpads.patch
+
 ExcludeArch:    s390 s390x
 
 BuildRequires:  libtool pkgconfig
@@ -133,6 +135,9 @@ Development files for the Synaptics TouchPad for X.Org.
 
 
 %changelog
+* Fri Mar 02 2012 Peter Hutterer <peter.hutterer at redhat.com> 1.5.0-3
+- Implement a workaround for elantech touchpads (#795708)
+
 * Wed Oct 12 2011 Peter Hutterer <peter.hutterer at redhat.com> 1.5.0-2
 - Add libXtst dependency to enable syndaemon build with the RECORD
   extension (#745289)


More information about the scm-commits mailing list