[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-input-synaptics: Changes to 'upstream-unstable'



 configure.ac                   |    2 
 include/synaptics-properties.h |    2 
 include/synaptics.h            |   39 
 src/alpscomm.c                 |   97 -
 src/eventcomm.c                |  663 +++++-----
 src/eventcomm.h                |    8 
 src/properties.c               |  583 +++++----
 src/ps2comm.c                  |  534 ++++----
 src/ps2comm.h                  |   21 
 src/psmcomm.c                  |   71 -
 src/synaptics.c                | 2569 +++++++++++++++++++++--------------------
 src/synapticsstr.h             |  361 ++---
 src/synproto.c                 |   42 
 src/synproto.h                 |   54 
 test/eventcomm-test.c          |   86 -
 test/fake-symbols.c            |  176 +-
 test/fake-symbols.h            |  169 +-
 tools/synclient.c              |  588 ++++-----
 tools/syndaemon.c              |  604 ++++-----
 19 files changed, 3413 insertions(+), 3256 deletions(-)

New commits:
commit e0f5688994baa85a8c658120681575cdd0ba2a58
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri May 11 10:30:21 2012 +1000

    synaptics 1.6.1
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index e5b92f9..565daf2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-        [1.6.0],
+        [1.6.1],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 7f2d9d88204c62de3cb63b48001b9e2408d3a20d
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri May 11 10:54:47 2012 +1000

    tools: coasting speed is not capped at 20, cap it at 255
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 0352c67fa2a7224b5a3bf03a934b3c7af42b4f51)

diff --git a/tools/synclient.c b/tools/synclient.c
index 7ec6923..f08a275 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -130,7 +130,7 @@ static struct Parameter params[] = {
     {"PalmDetect",            PT_BOOL,   0, 1,     SYNAPTICS_PROP_PALM_DETECT,	8,	0},
     {"PalmMinWidth",          PT_INT,    0, 15,    SYNAPTICS_PROP_PALM_DIMENSIONS,	32,	0},
     {"PalmMinZ",              PT_INT,    0, 255,   SYNAPTICS_PROP_PALM_DIMENSIONS,	32,	1},
-    {"CoastingSpeed",         PT_DOUBLE, 0, 20,    SYNAPTICS_PROP_COASTING_SPEED,	0 /* float*/,	0},
+    {"CoastingSpeed",         PT_DOUBLE, 0, 255,    SYNAPTICS_PROP_COASTING_SPEED,	0 /* float*/,	0},
     {"CoastingFriction",      PT_DOUBLE, 0, 255,   SYNAPTICS_PROP_COASTING_SPEED,	0 /* float*/,	1},
     {"PressureMotionMinZ",    PT_INT,    1, 255,   SYNAPTICS_PROP_PRESSURE_MOTION,	32,	0},
     {"PressureMotionMaxZ",    PT_INT,    1, 255,   SYNAPTICS_PROP_PRESSURE_MOTION,	32,	1},

commit ace20a02c371478f6a9d224dfd31ea219d91fc46
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed May 9 14:26:40 2012 +1000

    Fix coasting speed trigger
    
    CoastingSpeed is defined as scrolls/s. The previous code just used
    delta/seconds which depended on the device coordinate range and exceeded the
    default CoastingSpeed at almost any scroll event.
    
    Divide the estimated delta by the scroll distance to get the accurate
    scrolls/s number. Since that now changes the contents of what's in
    coast_speed_y, change the users of that too.
    
    http://bugzilla.redhat.com/813686
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 0de4445ff8e75aab208faf6383e76045934c6720)

diff --git a/src/synaptics.c b/src/synaptics.c
index ee627b3..30d79c5 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2456,7 +2456,7 @@ start_coasting(SynapticsPrivate * priv, struct SynapticsHwState *hw,
             double dy =
                 estimate_delta(HIST(0).y, HIST(1).y, HIST(2).y, HIST(3).y);
             if (pkt_time > 0) {
-                double scrolls_per_sec = dy / pkt_time;
+                double scrolls_per_sec = (dy / abs(para->scroll_dist_vert)) / pkt_time;
 
                 if (fabs(scrolls_per_sec) >= para->coasting_speed) {
                     priv->scroll.coast_speed_y = scrolls_per_sec;
@@ -2468,7 +2468,7 @@ start_coasting(SynapticsPrivate * priv, struct SynapticsHwState *hw,
             double dx =
                 estimate_delta(HIST(0).x, HIST(1).x, HIST(2).x, HIST(3).x);
             if (pkt_time > 0) {
-                double scrolls_per_sec = dx / pkt_time;
+                double scrolls_per_sec = (dx / abs(para->scroll_dist_vert)) / pkt_time;
 
                 if (fabs(scrolls_per_sec) >= para->coasting_speed) {
                     priv->scroll.coast_speed_x = scrolls_per_sec;
@@ -2480,7 +2480,7 @@ start_coasting(SynapticsPrivate * priv, struct SynapticsHwState *hw,
             double da = estimate_delta_circ(priv);
 
             if (pkt_time > 0) {
-                double scrolls_per_sec = da / pkt_time;
+                double scrolls_per_sec = (da / para->scroll_dist_circ) / pkt_time;
 
                 if (fabs(scrolls_per_sec) >= para->coasting_speed) {
                     if (vert) {
@@ -2738,10 +2738,9 @@ HandleScrolling(SynapticsPrivate * priv, struct SynapticsHwState *hw,
 
     if (priv->scroll.coast_speed_y) {
         double dtime = (hw->millis - priv->scroll.last_millis) / 1000.0;
-        double ddy =
-            para->coasting_friction * dtime * abs(para->scroll_dist_vert);
+        double ddy = para->coasting_friction * dtime;
 
-        priv->scroll.delta_y += priv->scroll.coast_speed_y * dtime;
+        priv->scroll.delta_y += priv->scroll.coast_speed_y * dtime * para->scroll_dist_vert;
         delay = MIN(delay, POLL_MS);
         if (abs(priv->scroll.coast_speed_y) < ddy) {
             priv->scroll.coast_speed_y = 0;
@@ -2755,9 +2754,8 @@ HandleScrolling(SynapticsPrivate * priv, struct SynapticsHwState *hw,
 
     if (priv->scroll.coast_speed_x) {
         double dtime = (hw->millis - priv->scroll.last_millis) / 1000.0;
-        double ddx =
-            para->coasting_friction * dtime * abs(para->scroll_dist_horiz);
-        priv->scroll.delta_x += priv->scroll.coast_speed_x * dtime;
+        double ddx = para->coasting_friction * dtime;
+        priv->scroll.delta_x += priv->scroll.coast_speed_x * dtime * para->scroll_dist_vert;
         delay = MIN(delay, POLL_MS);
         if (abs(priv->scroll.coast_speed_x) < ddx) {
             priv->scroll.coast_speed_x = 0;
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 57ed4ba..dd6a09b 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -168,7 +168,7 @@ typedef struct _SynapticsParameters {
     Bool palm_detect;           /* Enable Palm Detection */
     int palm_min_width;         /* Palm detection width */
     int palm_min_z;             /* Palm detection depth */
-    double coasting_speed;      /* Coasting threshold scrolling speed */
+    double coasting_speed;      /* Coasting threshold scrolling speed in scrolls/s */
     double coasting_friction;   /* Number of scrolls per second per second to change coasting speed */
     int press_motion_min_z;     /* finger pressure at which minimum pressure motion factor is applied */
     int press_motion_max_z;     /* finger pressure at which maximum pressure motion factor is applied */
@@ -216,8 +216,8 @@ struct _SynapticsPrivateRec {
         double delta_y;         /* accumulated vert scroll delta */
         double last_a;          /* last angle-scroll position */
         CARD32 last_millis;     /* time last scroll event posted */
-        double coast_speed_x;   /* Horizontal coasting speed */
-        double coast_speed_y;   /* Vertical coasting speed */
+        double coast_speed_x;   /* Horizontal coasting speed in scrolls/s */
+        double coast_speed_y;   /* Vertical coasting speed in scrolls/s */
         double coast_delta_x;   /* Accumulated horizontal coast delta */
         double coast_delta_y;   /* Accumulated vertical coast delta */
         int packets_this_scroll;        /* Events received for this scroll */

commit 04d24116db59872d4cd00f38a0d1c87957fe4914
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed May 9 12:23:46 2012 +1000

    Don't check for soft buttons if a button is already down
    
    Moving into a different soft button's area during drag-n-drop would trigger
    a click of that button.
    
    We only have the current button state and we mess with it, so the conditions
    for a possible clickpad soft-button event are:
    - hw->left is down now
    - none of left|right|middle were down before. since we change hw->left to
      hw->right/left we need to check all three
    
    If hw->left is down but one of the other buttons was already down, copy that
    button state and continue.
    
    http://bugzilla.redhat.com/819348
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
    (cherry picked from commit a1d6784d790f081f8a6ea3a10d3cfa578aa10d5b)

diff --git a/src/synaptics.c b/src/synaptics.c
index 809a275..ee627b3 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2956,14 +2956,23 @@ update_hw_button_state(const InputInfoPtr pInfo, struct SynapticsHwState *hw,
 
     /* If this is a clickpad and the user clicks in a soft button area, press
      * the soft button instead. */
-    if (para->clickpad && hw->left && !hw->right && !hw->middle) {
-        if (is_inside_rightbutton_area(para, hw->x, hw->y)) {
-            hw->left = 0;
-            hw->right = 1;
-        }
-        else if (is_inside_middlebutton_area(para, hw->x, hw->y)) {
-            hw->left = 0;
-            hw->middle = 1;
+    if (para->clickpad) {
+        /* hw->left is down, but no other buttons were already down */
+        if (!old->left && !old->right && !old->middle &&
+            hw->left && !hw->right && !hw->middle) {
+                if (is_inside_rightbutton_area(para, hw->x, hw->y)) {
+                    hw->left = 0;
+                    hw->right = 1;
+                }
+                else if (is_inside_middlebutton_area(para, hw->x, hw->y)) {
+                    hw->left = 0;
+                    hw->middle = 1;
+                }
+        }
+        else if (hw->left) {
+            hw->left = old->left;
+            hw->right = old->right;
+            hw->middle = old->middle;
         }
     }
 

commit 4e8ddb3a6f1ba1f7642f0a23d6f22a8c40d68cf0
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu May 3 12:00:50 2012 +1000

    whitespace fix
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/src/ps2comm.h b/src/ps2comm.h
index 6f1a96a..2be55e4 100644
--- a/src/ps2comm.h
+++ b/src/ps2comm.h
@@ -27,7 +27,7 @@
 #include "xf86_OSproc.h"
 
 /* acknowledge for commands and parameter */
-#define PS2_ACK 			0xFA
+#define PS2_ACK				0xFA
 #define PS2_ERROR			0xFC
 
 /* standard PS/2 commands */
@@ -56,7 +56,7 @@
 #define SYN_BIT_W_MODE			(1 << 0)
 
 /* synaptics model ID bits */
-#define SYN_MODEL_ROT180(synhw) 	((synhw)->model_id & (1 << 23))
+#define SYN_MODEL_ROT180(synhw)		((synhw)->model_id & (1 << 23))
 #define SYN_MODEL_PORTRAIT(synhw)	((synhw)->model_id & (1 << 22))
 #define SYN_MODEL_SENSOR(synhw)		(((synhw)->model_id >> 16) & 0x3f)
 #define SYN_MODEL_HARDWARE(synhw)	(((synhw)->model_id >> 9) & 0x7f)

commit d1eebac72e4a5cc7a67efead13fbd32f9cd1fbd9
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu May 3 14:21:24 2012 +1000

    tools: undo indentation in synclient's parameter list
    
    more more readable this way
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/tools/synclient.c b/tools/synclient.c
index 6ff3aa6..7ec6923 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -73,129 +73,87 @@ struct Parameter {
 };
 
 static struct Parameter params[] = {
-    {"LeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 0},
-    {"RightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 1},
-    {"TopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 2},
-    {"BottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_EDGES, 32, 3},
-    {"FingerLow", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 0},
-    {"FingerHigh", PT_INT, 0, 255, SYNAPTICS_PROP_FINGER, 32, 1},
-    {"FingerPress", PT_INT, 0, 256, SYNAPTICS_PROP_FINGER, 32, 2},
-    {"MaxTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_TIME, 32, 0},
-    {"MaxTapMove", PT_INT, 0, 2000, SYNAPTICS_PROP_TAP_MOVE, 32, 0},
-    {"MaxDoubleTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 1},
-    {"SingleTapTimeout", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 0},
-    {"ClickTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS, 32, 2},
-    {"FastTaps", PT_BOOL, 0, 1, SYNAPTICS_PROP_TAP_FAST, 8, 0},
-    {"EmulateMidButtonTime", PT_INT, 0, 1000, SYNAPTICS_PROP_MIDDLE_TIMEOUT, 32,
-     0},
-    {"EmulateTwoFingerMinZ", PT_INT, 0, 1000, SYNAPTICS_PROP_TWOFINGER_PRESSURE,
-     32, 0},
-    {"EmulateTwoFingerMinW", PT_INT, 0, 15, SYNAPTICS_PROP_TWOFINGER_WIDTH, 32,
-     0},
-    {"VertScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32,
-     0},
-    {"HorizScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE,
-     32, 1},
-    {"VertEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 0},
-    {"HorizEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 1},
-    {"CornerCoasting", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 2},
-    {"VertTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8,
-     0},
-    {"HorizTwoFingerScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_TWOFINGER, 8,
-     1},
-    {"MinSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 0},
-    {"MaxSpeed", PT_DOUBLE, 0, 255.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 1},
-    {"AccelFactor", PT_DOUBLE, 0, 1.0, SYNAPTICS_PROP_SPEED, 0, /*float */ 2},
-    {"TrackstickSpeed", PT_DOUBLE, 0, 200.0, SYNAPTICS_PROP_SPEED, 0, /*float */
-     3},
-    {"EdgeMotionMinZ", PT_INT, 1, 255, SYNAPTICS_PROP_EDGEMOTION_PRESSURE, 32,
-     0},
-    {"EdgeMotionMaxZ", PT_INT, 1, 255, SYNAPTICS_PROP_EDGEMOTION_PRESSURE, 32,
-     1},
-    {"EdgeMotionMinSpeed", PT_INT, 0, 1000, SYNAPTICS_PROP_EDGEMOTION_SPEED, 32,
-     0},
-    {"EdgeMotionMaxSpeed", PT_INT, 0, 1000, SYNAPTICS_PROP_EDGEMOTION_SPEED, 32,
-     1},
-    {"EdgeMotionUseAlways", PT_BOOL, 0, 1, SYNAPTICS_PROP_EDGEMOTION, 8, 0},
-    {"UpDownScrolling", PT_BOOL, 0, 1, SYNAPTICS_PROP_BUTTONSCROLLING, 8, 0},
-    {"LeftRightScrolling", PT_BOOL, 0, 1, SYNAPTICS_PROP_BUTTONSCROLLING, 8, 1},
-    {"UpDownScrollRepeat", PT_BOOL, 0, 1, SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT,
-     8, 0},
-    {"LeftRightScrollRepeat", PT_BOOL, 0, 1,
-     SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT, 8, 1},
-    {"ScrollButtonRepeat", PT_INT, SBR_MIN, SBR_MAX,
-     SYNAPTICS_PROP_BUTTONSCROLLING_TIME, 32, 0},
-    {"TouchpadOff", PT_INT, 0, 2, SYNAPTICS_PROP_OFF, 8, 0},
-    {"LockedDrags", PT_BOOL, 0, 1, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 0},
-    {"LockedDragTimeout", PT_INT, 0, 30000, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT,
-     32, 0},
-    {"RTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8,
-     0},
-    {"RBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8,
-     1},
-    {"LTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8,
-     2},
-    {"LBCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8,
-     3},
-    {"TapButton1", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 4},
-    {"TapButton2", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 5},
-    {"TapButton3", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 6},
-    {"ClickFinger1", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8,
-     0},
-    {"ClickFinger2", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8,
-     1},
-    {"ClickFinger3", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION, 8,
-     2},
-    {"CircularScrolling", PT_BOOL, 0, 1, SYNAPTICS_PROP_CIRCULAR_SCROLLING, 8,
-     0},
-    {"CircScrollDelta", PT_DOUBLE, .01, 3,
-     SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST, 0 /* float */ , 0},
-    {"CircScrollTrigger", PT_INT, 0, 8,
-     SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 0},
-    {"CircularPad", PT_BOOL, 0, 1, SYNAPTICS_PROP_CIRCULAR_PAD, 8, 0},
-    {"PalmDetect", PT_BOOL, 0, 1, SYNAPTICS_PROP_PALM_DETECT, 8, 0},
-    {"PalmMinWidth", PT_INT, 0, 15, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 0},
-    {"PalmMinZ", PT_INT, 0, 255, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 1},
-    {"CoastingSpeed", PT_DOUBLE, 0, 20, SYNAPTICS_PROP_COASTING_SPEED,
-     0 /* float */ , 0},
-    {"CoastingFriction", PT_DOUBLE, 0, 255, SYNAPTICS_PROP_COASTING_SPEED,
-     0 /* float */ , 1},
-    {"PressureMotionMinZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32,
-     0},
-    {"PressureMotionMaxZ", PT_INT, 1, 255, SYNAPTICS_PROP_PRESSURE_MOTION, 32,
-     1},
-    {"PressureMotionMinFactor", PT_DOUBLE, 0, 10.0,
-     SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float */ , 0},
-    {"PressureMotionMaxFactor", PT_DOUBLE, 0, 10.0,
-     SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 0 /*float */ , 1},
-    {"GrabEventDevice", PT_BOOL, 0, 1, SYNAPTICS_PROP_GRAB, 8, 0},
-    {"TapAndDragGesture", PT_BOOL, 0, 1, SYNAPTICS_PROP_GESTURES, 8, 0},
-    {"AreaLeftEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 0},
-    {"AreaRightEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 1},
-    {"AreaTopEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 2},
-    {"AreaBottomEdge", PT_INT, 0, 10000, SYNAPTICS_PROP_AREA, 32, 3},
-    {"HorizHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32,
-     0},
-    {"VertHysteresis", PT_INT, 0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32,
-     1},
-    {"ClickPad", PT_BOOL, 0, 1, SYNAPTICS_PROP_CLICKPAD, 8, 0},
-    {"RightButtonAreaLeft", PT_INT, INT_MIN, INT_MAX,
-     SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 0},
-    {"RightButtonAreaRight", PT_INT, INT_MIN, INT_MAX,
-     SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 1},
-    {"RightButtonAreaTop", PT_INT, INT_MIN, INT_MAX,
-     SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 2},
-    {"RightButtonAreaBottom", PT_INT, INT_MIN, INT_MAX,
-     SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 3},
-    {"MiddleButtonAreaLeft", PT_INT, INT_MIN, INT_MAX,
-     SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 4},
-    {"MiddleButtonAreaRight", PT_INT, INT_MIN, INT_MAX,
-     SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 5},
-    {"MiddleButtonAreaTop", PT_INT, INT_MIN, INT_MAX,
-     SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 6},
-    {"MiddleButtonAreaBottom", PT_INT, INT_MIN, INT_MAX,
-     SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 7},
-    {NULL, 0, 0, 0, 0}
+    {"LeftEdge",              PT_INT,    0, 10000, SYNAPTICS_PROP_EDGES,	32,	0},
+    {"RightEdge",             PT_INT,    0, 10000, SYNAPTICS_PROP_EDGES,	32,	1},
+    {"TopEdge",               PT_INT,    0, 10000, SYNAPTICS_PROP_EDGES,	32,	2},
+    {"BottomEdge",            PT_INT,    0, 10000, SYNAPTICS_PROP_EDGES,	32,	3},
+    {"FingerLow",             PT_INT,    0, 255,   SYNAPTICS_PROP_FINGER,	32,	0},
+    {"FingerHigh",            PT_INT,    0, 255,   SYNAPTICS_PROP_FINGER,	32,	1},
+    {"FingerPress",           PT_INT,    0, 256,   SYNAPTICS_PROP_FINGER,	32,	2},
+    {"MaxTapTime",            PT_INT,    0, 1000,  SYNAPTICS_PROP_TAP_TIME,	32,	0},
+    {"MaxTapMove",            PT_INT,    0, 2000,  SYNAPTICS_PROP_TAP_MOVE,	32,	0},
+    {"MaxDoubleTapTime",      PT_INT,    0, 1000,  SYNAPTICS_PROP_TAP_DURATIONS,32,	1},
+    {"SingleTapTimeout",      PT_INT,    0, 1000,  SYNAPTICS_PROP_TAP_DURATIONS,32,	0},
+    {"ClickTime",             PT_INT,    0, 1000,  SYNAPTICS_PROP_TAP_DURATIONS,32,	2},
+    {"FastTaps",              PT_BOOL,   0, 1,     SYNAPTICS_PROP_TAP_FAST,	8,	0},
+    {"EmulateMidButtonTime",  PT_INT,    0, 1000,  SYNAPTICS_PROP_MIDDLE_TIMEOUT,32,	0},
+    {"EmulateTwoFingerMinZ",  PT_INT,    0, 1000,  SYNAPTICS_PROP_TWOFINGER_PRESSURE,	32,	0},
+    {"EmulateTwoFingerMinW",  PT_INT,    0, 15,    SYNAPTICS_PROP_TWOFINGER_WIDTH,	32,	0},
+    {"VertScrollDelta",       PT_INT,    -1000, 1000,  SYNAPTICS_PROP_SCROLL_DISTANCE,	32,	0},
+    {"HorizScrollDelta",      PT_INT,    -1000, 1000,  SYNAPTICS_PROP_SCROLL_DISTANCE,	32,	1},
+    {"VertEdgeScroll",        PT_BOOL,   0, 1,     SYNAPTICS_PROP_SCROLL_EDGE,	8,	0},
+    {"HorizEdgeScroll",       PT_BOOL,   0, 1,     SYNAPTICS_PROP_SCROLL_EDGE,	8,	1},
+    {"CornerCoasting",        PT_BOOL,   0, 1,     SYNAPTICS_PROP_SCROLL_EDGE,	8,	2},
+    {"VertTwoFingerScroll",   PT_BOOL,   0, 1,     SYNAPTICS_PROP_SCROLL_TWOFINGER,	8,	0},
+    {"HorizTwoFingerScroll",  PT_BOOL,   0, 1,     SYNAPTICS_PROP_SCROLL_TWOFINGER,	8,	1},
+    {"MinSpeed",              PT_DOUBLE, 0, 255.0,   SYNAPTICS_PROP_SPEED,	0, /*float */	0},
+    {"MaxSpeed",              PT_DOUBLE, 0, 255.0,   SYNAPTICS_PROP_SPEED,	0, /*float */	1},
+    {"AccelFactor",           PT_DOUBLE, 0, 1.0,   SYNAPTICS_PROP_SPEED,	0, /*float */	2},
+    {"TrackstickSpeed",       PT_DOUBLE, 0, 200.0, SYNAPTICS_PROP_SPEED,	0, /*float */ 3},
+    {"EdgeMotionMinZ",        PT_INT,    1, 255,   SYNAPTICS_PROP_EDGEMOTION_PRESSURE,  32,	0},
+    {"EdgeMotionMaxZ",        PT_INT,    1, 255,   SYNAPTICS_PROP_EDGEMOTION_PRESSURE,  32,	1},
+    {"EdgeMotionMinSpeed",    PT_INT,    0, 1000,  SYNAPTICS_PROP_EDGEMOTION_SPEED,     32,	0},
+    {"EdgeMotionMaxSpeed",    PT_INT,    0, 1000,  SYNAPTICS_PROP_EDGEMOTION_SPEED,     32,	1},
+    {"EdgeMotionUseAlways",   PT_BOOL,   0, 1,     SYNAPTICS_PROP_EDGEMOTION,   8,	0},
+    {"UpDownScrolling",       PT_BOOL,   0, 1,     SYNAPTICS_PROP_BUTTONSCROLLING,  8,	0},
+    {"LeftRightScrolling",    PT_BOOL,   0, 1,     SYNAPTICS_PROP_BUTTONSCROLLING,  8,	1},
+    {"UpDownScrollRepeat",    PT_BOOL,   0, 1,     SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT,   8,	0},
+    {"LeftRightScrollRepeat", PT_BOOL,   0, 1,     SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT,   8,	1},
+    {"ScrollButtonRepeat",    PT_INT,    SBR_MIN , SBR_MAX, SYNAPTICS_PROP_BUTTONSCROLLING_TIME, 32,	0},
+    {"TouchpadOff",           PT_INT,    0, 2,     SYNAPTICS_PROP_OFF,		8,	0},
+    {"LockedDrags",           PT_BOOL,   0, 1,     SYNAPTICS_PROP_LOCKED_DRAGS,	8,	0},
+    {"LockedDragTimeout",     PT_INT,    0, 30000, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT,	32,	0},
+    {"RTCornerButton",        PT_INT,    0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION,	8,	0},
+    {"RBCornerButton",        PT_INT,    0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION,	8,	1},
+    {"LTCornerButton",        PT_INT,    0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION,	8,	2},
+    {"LBCornerButton",        PT_INT,    0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION,	8,	3},
+    {"TapButton1",            PT_INT,    0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION,	8,	4},
+    {"TapButton2",            PT_INT,    0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION,	8,	5},
+    {"TapButton3",            PT_INT,    0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION,	8,	6},
+    {"ClickFinger1",          PT_INT,    0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION,	8,	0},
+    {"ClickFinger2",          PT_INT,    0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION,	8,	1},
+    {"ClickFinger3",          PT_INT,    0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_CLICK_ACTION,	8,	2},
+    {"CircularScrolling",     PT_BOOL,   0, 1,     SYNAPTICS_PROP_CIRCULAR_SCROLLING,	8,	0},
+    {"CircScrollDelta",       PT_DOUBLE, .01, 3,   SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST,	0 /* float */,	0},
+    {"CircScrollTrigger",     PT_INT,    0, 8,     SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER,	8,	0},
+    {"CircularPad",           PT_BOOL,   0, 1,     SYNAPTICS_PROP_CIRCULAR_PAD,	8,	0},
+    {"PalmDetect",            PT_BOOL,   0, 1,     SYNAPTICS_PROP_PALM_DETECT,	8,	0},
+    {"PalmMinWidth",          PT_INT,    0, 15,    SYNAPTICS_PROP_PALM_DIMENSIONS,	32,	0},
+    {"PalmMinZ",              PT_INT,    0, 255,   SYNAPTICS_PROP_PALM_DIMENSIONS,	32,	1},
+    {"CoastingSpeed",         PT_DOUBLE, 0, 20,    SYNAPTICS_PROP_COASTING_SPEED,	0 /* float*/,	0},
+    {"CoastingFriction",      PT_DOUBLE, 0, 255,   SYNAPTICS_PROP_COASTING_SPEED,	0 /* float*/,	1},
+    {"PressureMotionMinZ",    PT_INT,    1, 255,   SYNAPTICS_PROP_PRESSURE_MOTION,	32,	0},
+    {"PressureMotionMaxZ",    PT_INT,    1, 255,   SYNAPTICS_PROP_PRESSURE_MOTION,	32,	1},
+    {"PressureMotionMinFactor", PT_DOUBLE, 0, 10.0,SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR,	0 /*float*/,	0},
+    {"PressureMotionMaxFactor", PT_DOUBLE, 0, 10.0,SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR,	0 /*float*/,	1},
+    {"GrabEventDevice",       PT_BOOL,   0, 1,     SYNAPTICS_PROP_GRAB,	8,	0},
+    {"TapAndDragGesture",     PT_BOOL,   0, 1,     SYNAPTICS_PROP_GESTURES,	8,	0},
+    {"AreaLeftEdge",          PT_INT,    0, 10000, SYNAPTICS_PROP_AREA,	32,	0},
+    {"AreaRightEdge",         PT_INT,    0, 10000, SYNAPTICS_PROP_AREA,	32,	1},
+    {"AreaTopEdge",           PT_INT,    0, 10000, SYNAPTICS_PROP_AREA,	32,	2},
+    {"AreaBottomEdge",        PT_INT,    0, 10000, SYNAPTICS_PROP_AREA,	32,	3},
+    {"HorizHysteresis",       PT_INT,    0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32,	0},
+    {"VertHysteresis",        PT_INT,    0, 10000, SYNAPTICS_PROP_NOISE_CANCELLATION, 32,	1},
+    {"ClickPad",              PT_BOOL,   0, 1,     SYNAPTICS_PROP_CLICKPAD,	8,	0},
+    {"RightButtonAreaLeft",   PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	0},
+    {"RightButtonAreaRight",  PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	1},
+    {"RightButtonAreaTop",    PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	2},
+    {"RightButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	3},
+    {"MiddleButtonAreaLeft",  PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	4},
+    {"MiddleButtonAreaRight", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	5},
+    {"MiddleButtonAreaTop",   PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	6},
+    {"MiddleButtonAreaBottom", PT_INT, INT_MIN, INT_MAX, SYNAPTICS_PROP_SOFTBUTTON_AREAS,	32,	7},
+    { NULL, 0, 0, 0, 0 }
 };
 
 static double

commit 0434d7776640861d0c8c19a02c2445d2f61627f8
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu May 3 11:49:31 2012 +1000

    Indent consistently
    
    x-indent-all.sh from xorg/util/modular as of
    c2d630fab65dbe3409af3947f6f442782ddb026f
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/include/synaptics-properties.h b/include/synaptics-properties.h
index 8c20a0c..ad7a502 100644
--- a/include/synaptics-properties.h
+++ b/include/synaptics-properties.h
@@ -164,4 +164,4 @@
 /* 32 Bit Integer, 2 values, horizontal hysteresis, vertical hysteresis */
 #define SYNAPTICS_PROP_NOISE_CANCELLATION "Synaptics Noise Cancellation"
 
-#endif /* _SYNAPTICS_PROPERTIES_H_ */
+#endif                          /* _SYNAPTICS_PROPERTIES_H_ */
diff --git a/include/synaptics.h b/include/synaptics.h
index eee9c6e..3d4832f 100644
--- a/include/synaptics.h
+++ b/include/synaptics.h
@@ -29,36 +29,35 @@
  *			Used by driver and the shared memory configurator
  *****************************************************************************/
 typedef enum {
-    RT_TAP = 0,				    /* Right top corner */
-    RB_TAP,				    /* Right bottom corner */
-    LT_TAP,				    /* Left top corner */
-    LB_TAP,				    /* Left bottom corner */
-    F1_TAP,				    /* Non-corner tap, one finger */
-    F2_TAP,				    /* Non-corner tap, two fingers */
-    F3_TAP,				    /* Non-corner tap, three fingers */
+    RT_TAP = 0,                 /* Right top corner */
+    RB_TAP,                     /* Right bottom corner */
+    LT_TAP,                     /* Left top corner */
+    LB_TAP,                     /* Left bottom corner */
+    F1_TAP,                     /* Non-corner tap, one finger */
+    F2_TAP,                     /* Non-corner tap, two fingers */
+    F3_TAP,                     /* Non-corner tap, three fingers */
     MAX_TAP
 } TapEvent;
 
 typedef enum {
-    F1_CLICK1 = 0,			    /* Click left, one finger */
-    F2_CLICK1,				    /* Click left, two fingers */
-    F3_CLICK1,				    /* Click left, three fingers */
+    F1_CLICK1 = 0,              /* Click left, one finger */
+    F2_CLICK1,                  /* Click left, two fingers */
+    F3_CLICK1,                  /* Click left, three fingers */
     MAX_CLICK
 } ClickFingerEvent;
 
-#define SYN_MAX_BUTTONS 12		    /* Max number of mouse buttons */
+#define SYN_MAX_BUTTONS 12      /* Max number of mouse buttons */
 
 #define SHM_SYNAPTICS 23947
-typedef struct _SynapticsSHM
-{
-    int version;			    /* Driver version */
+typedef struct _SynapticsSHM {
+    int version;                /* Driver version */
 
     /* Current device state */
-    int x, y;				    /* actual x, y coordinates */
-    int z;				    /* pressure value */
-    int numFingers;			    /* number of fingers */
-    int fingerWidth;			    /* finger width value */
-    int left, right, up, down;		    /* left/right/up/down buttons */
+    int x, y;                   /* actual x, y coordinates */
+    int z;                      /* pressure value */
+    int numFingers;             /* number of fingers */
+    int fingerWidth;            /* finger width value */
+    int left, right, up, down;  /* left/right/up/down buttons */
     Bool multi[8];
     Bool middle;
 } SynapticsSHM;
@@ -69,4 +68,4 @@ typedef struct _SynapticsSHM
 #define SBR_MIN 10
 #define SBR_MAX 1000
 
-#endif /* _SYNAPTICS_H_ */
+#endif                          /* _SYNAPTICS_H_ */
diff --git a/src/alpscomm.c b/src/alpscomm.c
index 8988e6b..0bf0447 100644
--- a/src/alpscomm.c
+++ b/src/alpscomm.c
@@ -39,14 +39,14 @@
 #include "ps2comm.h"
 #include <xf86.h>
 
-
 /* Wait for the channel to go silent, which means we're in sync */
 static void
 ALPS_sync(int fd)
 {
     byte buffer[64];
+
     while (xf86WaitForInput(fd, 250000) > 0) {
-	xf86ReadSerial(fd, &buffer, 64);
+        xf86ReadSerial(fd, &buffer, 64);
     }
 }
 
@@ -98,7 +98,7 @@ ALPS_packet_ok(struct CommData *comm)
 {
     /* ALPS absolute mode packets start with 0b11111mrl */
     if ((comm->protoBuf[0] & 0xf8) == 0xf8)
-	return TRUE;
+        return TRUE;
     return FALSE;
 }
 
@@ -108,24 +108,23 @@ ALPS_get_packet(struct CommData *comm, InputInfoPtr pInfo)
     int c;
 
     while ((c = XisbRead(comm->buffer)) >= 0) {
-	unsigned char u = (unsigned char)c;
-
-	comm->protoBuf[comm->protoBufTail++] = u;
-
-	if (comm->protoBufTail == 3) { /* PS/2 packet received? */
-	    if ((comm->protoBuf[0] & 0xc8) == 0x08) {
-		comm->protoBufTail = 0;
-		return TRUE;
-	    }
-	}
-
-	if (comm->protoBufTail >= 6) { /* Full packet received */
-	    comm->protoBufTail = 0;
-	    if (ALPS_packet_ok(comm))
-		return TRUE;
-	    while ((c = XisbRead(comm->buffer)) >= 0)
-		;		   /* If packet is invalid, re-sync */
-	}
+        unsigned char u = (unsigned char) c;
+
+        comm->protoBuf[comm->protoBufTail++] = u;
+
+        if (comm->protoBufTail == 3) {  /* PS/2 packet received? */
+            if ((comm->protoBuf[0] & 0xc8) == 0x08) {
+                comm->protoBufTail = 0;
+                return TRUE;
+            }
+        }
+
+        if (comm->protoBufTail >= 6) {  /* Full packet received */
+            comm->protoBufTail = 0;
+            if (ALPS_packet_ok(comm))
+                return TRUE;
+            while ((c = XisbRead(comm->buffer)) >= 0);  /* If packet is invalid, re-sync */
+        }
     }
 
     return FALSE;
@@ -157,48 +156,50 @@ ALPS_process_packet(unsigned char *packet, struct SynapticsHwState *hw)
 
     hw->millis = GetTimeInMillis();
 
-    x = (packet[1] & 0x7f) | ((packet[2] & 0x78) << (7-3));
-    y = (packet[4] & 0x7f) | ((packet[3] & 0x70) << (7-4));
+    x = (packet[1] & 0x7f) | ((packet[2] & 0x78) << (7 - 3));
+    y = (packet[4] & 0x7f) | ((packet[3] & 0x70) << (7 - 4));
     z = packet[5];
 
-    if (z == 127) {    /* DualPoint stick is relative, not absolute */
-	hw->left  = packet[3] & 1;
-	hw->right = (packet[3] >> 1) & 1;
-	return;
+    if (z == 127) {             /* DualPoint stick is relative, not absolute */
+        hw->left = packet[3] & 1;
+        hw->right = (packet[3] >> 1) & 1;
+        return;
     }
 
     /* Handle normal packets */
     hw->x = hw->y = hw->z = hw->numFingers = hw->fingerWidth = 0;
     hw->left = hw->right = hw->up = hw->down = hw->middle = FALSE;
     for (i = 0; i < 8; i++)
-	hw->multi[i] = FALSE;
+        hw->multi[i] = FALSE;
 
     if (z > 0) {
-	hw->x = x;
-	hw->y = y;
+        hw->x = x;
+        hw->y = y;
     }
     hw->z = z;
     hw->numFingers = (z > 0) ? 1 : 0;
     hw->fingerWidth = 5;
 
-    left  |= (packet[2]     ) & 1;
-    left  |= (packet[3]     ) & 1;
+    left |= (packet[2]) & 1;
+    left |= (packet[3]) & 1;
     right |= (packet[3] >> 1) & 1;
     if (packet[0] == 0xff) {
-	int back    = (packet[3] >> 2) & 1;
-	int forward = (packet[2] >> 2) & 1;
-	if (back && forward) {
-	    middle = 1;
-	    back = 0;
-	    forward = 0;
-	}
-	hw->down = back;
-	hw->up = forward;
-    } else {
-	left   |= (packet[0]     ) & 1;
-	right  |= (packet[0] >> 1) & 1;
-	middle |= (packet[0] >> 2) & 1;
-	middle |= (packet[3] >> 2) & 1;
+        int back = (packet[3] >> 2) & 1;
+        int forward = (packet[2] >> 2) & 1;
+
+        if (back && forward) {
+            middle = 1;
+            back = 0;
+            forward = 0;
+        }
+        hw->down = back;
+        hw->up = forward;
+    }
+    else {
+        left |= (packet[0]) & 1;
+        right |= (packet[0] >> 1) & 1;
+        middle |= (packet[0] >> 2) & 1;
+        middle |= (packet[3] >> 2) & 1;
     }
 
     hw->left = left;
@@ -208,13 +209,13 @@ ALPS_process_packet(unsigned char *packet, struct SynapticsHwState *hw)
 
 static Bool
 ALPSReadHwState(InputInfoPtr pInfo,
-		struct CommData *comm, struct SynapticsHwState *hwRet)
+                struct CommData *comm, struct SynapticsHwState *hwRet)
 {
     unsigned char *buf = comm->protoBuf;
     struct SynapticsHwState *hw = comm->hwState;
 
     if (!ALPS_get_packet(comm, pInfo))
-	return FALSE;
+        return FALSE;
 
     ALPS_process_packet(buf, hw);
 
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 4ef8ad6..89a8a3a 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -63,8 +63,7 @@
 /**
  * Protocol-specific data.
  */
-struct eventcomm_proto_data
-{
+struct eventcomm_proto_data {
     /**
      * Do we need to grab the event device?
      * Note that in the current flow, this variable is always false and
@@ -99,9 +98,10 @@ EventProtoDataAlloc(void)
 
 #ifdef HAVE_MULTITOUCH
 static int
-last_mt_vals_slot(const SynapticsPrivate *priv)
+last_mt_vals_slot(const SynapticsPrivate * priv)
 {
-    struct eventcomm_proto_data *proto_data = (struct eventcomm_proto_data*)priv->proto_data;
+    struct eventcomm_proto_data *proto_data =
+        (struct eventcomm_proto_data *) priv->proto_data;
     int value = proto_data->cur_slot - proto_data->mtdev->caps.slot.minimum;
 
     return value < priv->num_slots ? value : -1;
@@ -110,14 +110,14 @@ last_mt_vals_slot(const SynapticsPrivate *priv)
 static void
 UninitializeTouch(InputInfoPtr pInfo)
 {
-    SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
-    struct eventcomm_proto_data *proto_data = (struct eventcomm_proto_data*)priv->proto_data;
+    SynapticsPrivate *priv = (SynapticsPrivate *) pInfo->private;
+    struct eventcomm_proto_data *proto_data =
+        (struct eventcomm_proto_data *) priv->proto_data;
 
     if (!priv->has_touch)
         return;
 
-    if (proto_data->last_mt_vals)
-    {
+    if (proto_data->last_mt_vals) {
         int i;
 
         for (i = 0; i < priv->num_slots; i++)
@@ -134,16 +134,16 @@ UninitializeTouch(InputInfoPtr pInfo)
 static void
 InitializeTouch(InputInfoPtr pInfo)
 {
-    SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
-    struct eventcomm_proto_data *proto_data = (struct eventcomm_proto_data*)priv->proto_data;
+    SynapticsPrivate *priv = (SynapticsPrivate *) pInfo->private;
+    struct eventcomm_proto_data *proto_data =
+        (struct eventcomm_proto_data *) priv->proto_data;
     int i;
 
     if (!priv->has_touch)
         return;
 
     proto_data->mtdev = mtdev_new_open(pInfo->fd);
-    if (!proto_data->mtdev)
-    {
+    if (!proto_data->mtdev) {
         xf86IDrvMsg(pInfo, X_WARNING,
                     "failed to create mtdev instance, ignoring touch events\n");
         return;
@@ -152,23 +152,19 @@ InitializeTouch(InputInfoPtr pInfo)
     proto_data->cur_slot = proto_data->mtdev->caps.slot.value;
     proto_data->num_touches = 0;
 
-    proto_data->last_mt_vals = calloc(priv->num_slots,
-                                      sizeof(ValuatorMask *));
-    if (!proto_data->last_mt_vals)
-    {
+    proto_data->last_mt_vals = calloc(priv->num_slots, sizeof(ValuatorMask *));
+    if (!proto_data->last_mt_vals) {
         xf86IDrvMsg(pInfo, X_WARNING,
                     "failed to allocate MT last values mask array\n");
         UninitializeTouch(pInfo);
         return;
     }
 
-    for (i = 0; i < priv->num_slots; i++)
-    {
+    for (i = 0; i < priv->num_slots; i++) {
         int j;
 
         proto_data->last_mt_vals[i] = valuator_mask_new(4 + priv->num_mt_axes);
-        if (!proto_data->last_mt_vals[i])
-        {
+        if (!proto_data->last_mt_vals[i]) {
             xf86IDrvMsg(pInfo, X_WARNING,
                         "failed to allocate MT last values mask\n");
             UninitializeTouch(pInfo);
@@ -186,20 +182,22 @@ InitializeTouch(InputInfoPtr pInfo)
 #endif
 
 static Bool
-EventDeviceOnHook(InputInfoPtr pInfo, SynapticsParameters *para)
+EventDeviceOnHook(InputInfoPtr pInfo, SynapticsParameters * para)
 {
-    SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
-    struct eventcomm_proto_data *proto_data = (struct eventcomm_proto_data*)priv->proto_data;
+    SynapticsPrivate *priv = (SynapticsPrivate *) pInfo->private;
+    struct eventcomm_proto_data *proto_data =
+        (struct eventcomm_proto_data *) priv->proto_data;
 
     if (para->grab_event_device) {
-	/* Try to grab the event device so that data don't leak to /dev/input/mice */
-	int ret;
-	SYSCALL(ret = ioctl(pInfo->fd, EVIOCGRAB, (pointer)1));
-	if (ret < 0) {
-	    xf86IDrvMsg(pInfo, X_WARNING, "can't grab event device, errno=%d\n",
-			errno);
-	    return FALSE;
-	}
+        /* Try to grab the event device so that data don't leak to /dev/input/mice */
+        int ret;
+
+        SYSCALL(ret = ioctl(pInfo->fd, EVIOCGRAB, (pointer) 1));
+        if (ret < 0) {
+            xf86IDrvMsg(pInfo, X_WARNING, "can't grab event device, errno=%d\n",
+                        errno);
+            return FALSE;
+        }
     }
 
     proto_data->need_grab = FALSE;
@@ -239,13 +237,12 @@ static Bool
 event_query_is_touchpad(int fd, BOOL test_grab)
 {
     int ret = FALSE, rc;
-    unsigned long evbits[NBITS(EV_MAX)] = {0};
-    unsigned long absbits[NBITS(ABS_MAX)] = {0};
-    unsigned long keybits[NBITS(KEY_MAX)] = {0};
+    unsigned long evbits[NBITS(EV_MAX)] = { 0 };
+    unsigned long absbits[NBITS(ABS_MAX)] = { 0 };
+    unsigned long keybits[NBITS(KEY_MAX)] = { 0 };
 
-    if (test_grab)
-    {
-        SYSCALL(rc = ioctl(fd, EVIOCGRAB, (pointer)1));
+    if (test_grab) {
+        SYSCALL(rc = ioctl(fd, EVIOCGRAB, (pointer) 1));
         if (rc < 0)
             return FALSE;
     }
@@ -254,54 +251,53 @@ event_query_is_touchpad(int fd, BOOL test_grab)
 
     SYSCALL(rc = ioctl(fd, EVIOCGBIT(0, sizeof(evbits)), evbits));
     if (rc < 0)
-	goto unwind;
+        goto unwind;
     if (!TEST_BIT(EV_SYN, evbits) ||
-	!TEST_BIT(EV_ABS, evbits) ||
-	!TEST_BIT(EV_KEY, evbits))
-	goto unwind;
+        !TEST_BIT(EV_ABS, evbits) || !TEST_BIT(EV_KEY, evbits))
+        goto unwind;
 
     SYSCALL(rc = ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbits)), absbits));
     if (rc < 0)
-	goto unwind;
-    if (!TEST_BIT(ABS_X, absbits) ||
-	!TEST_BIT(ABS_Y, absbits))
-	goto unwind;
+        goto unwind;
+    if (!TEST_BIT(ABS_X, absbits) || !TEST_BIT(ABS_Y, absbits))
+        goto unwind;
 
     SYSCALL(rc = ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits));
     if (rc < 0)
-	goto unwind;
+        goto unwind;
 
     /* we expect touchpad either report raw pressure or touches */
     if (!TEST_BIT(ABS_PRESSURE, absbits) && !TEST_BIT(BTN_TOUCH, keybits))
-	goto unwind;
+        goto unwind;
     /* all Synaptics-like touchpad report BTN_TOOL_FINGER */
     if (!TEST_BIT(BTN_TOOL_FINGER, keybits))
-	goto unwind;
+        goto unwind;
     if (TEST_BIT(BTN_TOOL_PEN, keybits))
-	goto unwind;			    /* Don't match wacom tablets */
+        goto unwind;            /* Don't match wacom tablets */
 
     ret = TRUE;
 
-unwind:
+ unwind:
     if (test_grab)
-        SYSCALL(ioctl(fd, EVIOCGRAB, (pointer)0));
+        SYSCALL(ioctl(fd, EVIOCGRAB, (pointer) 0));
 
     return (ret == TRUE);
 }
 
 typedef struct {
-	short vendor;
-	short product;
-	enum TouchpadModel model;
+    short vendor;
+    short product;
+    enum TouchpadModel model;
 } model_lookup_t;
+
 #define PRODUCT_ANY 0x0000
 
 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}
+    {0x0002, 0x0007, MODEL_SYNAPTICS},
+    {0x0002, 0x0008, MODEL_ALPS},
+    {0x05ac, PRODUCT_ANY, MODEL_APPLETOUCH},
+    {0x0002, 0x000e, MODEL_ELANTECH},
+    {0x0, 0x0, 0x0}
 };
 
 /**
@@ -315,7 +311,8 @@ static model_lookup_t model_lookup_table[] = {
  * @return TRUE on success or FALSE otherwise.
  */
 static Bool
-event_query_model(int fd, enum TouchpadModel *model_out, unsigned short *vendor_id, unsigned short *product_id)
+event_query_model(int fd, enum TouchpadModel *model_out,
+                  unsigned short *vendor_id, unsigned short *product_id)
 {
     struct input_id id;
     int rc;
@@ -325,9 +322,11 @@ event_query_model(int fd, enum TouchpadModel *model_out, unsigned short *vendor_
     if (rc < 0)
         return FALSE;
 
-    for(model_lookup = model_lookup_table; model_lookup->vendor; model_lookup++) {
-        if(model_lookup->vendor == id.vendor &&
-           (model_lookup->product == id.product|| model_lookup->product == PRODUCT_ANY))
+    for (model_lookup = model_lookup_table; model_lookup->vendor;
+         model_lookup++) {
+        if (model_lookup->vendor == id.vendor &&
+            (model_lookup->product == id.product ||
+             model_lookup->product == PRODUCT_ANY))
             *model_out = model_lookup->model;
     }
 
@@ -356,71 +355,68 @@ event_get_abs(InputInfoPtr pInfo, int fd, int code,
               int *min, int *max, int *fuzz, int *res)
 {
     int rc;
-    struct input_absinfo abs =  {0};
+    struct input_absinfo abs = { 0 };
 
     SYSCALL(rc = ioctl(fd, EVIOCGABS(code), &abs));
     if (rc < 0) {
-	xf86IDrvMsg(pInfo, X_ERROR, "%s EVIOCGABS error on %d (%s)\n",
-		    __func__, code, strerror(errno));
-	return errno;
+        xf86IDrvMsg(pInfo, X_ERROR, "%s EVIOCGABS error on %d (%s)\n",


Reply to: