ABS_X, ABS_Y and ABS_PRESSURE were defined for all the devices, even
if not needed. Fix this by configuring each device depending on its
capabilities.

Signed-off-by: Gabriele Mazzotta <gabriele....@gmail.com>
---
 drivers/input/mouse/synaptics.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index a7a0e73..ff47084 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -1188,11 +1188,6 @@ static void set_input_params(struct psmouse *psmouse,
 
        /* Absolute mode */
        __set_bit(EV_ABS, dev->evbit);
-       set_abs_position_params(dev, priv, ABS_X, ABS_Y);
-       input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
-
-       if (cr48_profile_sensor)
-               input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
 
        if (SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c)) {
                set_abs_position_params(dev, priv, ABS_MT_POSITION_X,
@@ -1200,26 +1195,32 @@ static void set_input_params(struct psmouse *psmouse,
                /* Image sensors can report per-contact pressure */
                input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
                input_mt_init_slots(dev, 2, INPUT_MT_POINTER | INPUT_MT_TRACK);
-
                /* Image sensors can signal 4 and 5 finger clicks */
                __set_bit(BTN_TOOL_QUADTAP, dev->keybit);
                __set_bit(BTN_TOOL_QUINTTAP, dev->keybit);
-       } else if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)) {
+       } else if (cr48_profile_sensor) {
                set_abs_position_params(dev, priv, ABS_MT_POSITION_X,
                                        ABS_MT_POSITION_Y);
+               input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
                /*
                 * Profile sensor in CR-48 tracks contacts reasonably well,
                 * other non-image sensors with AGM use semi-mt.
                 */
+               input_mt_init_slots(dev, 2, INPUT_MT_POINTER | INPUT_MT_TRACK);
+       } else if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)) {
+               set_abs_position_params(dev, priv, ABS_MT_POSITION_X,
+                                       ABS_MT_POSITION_Y);
+               input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
+               input_set_abs_params(dev, ABS_TOOL_WIDTH, 0, 15, 0, 0);
                input_mt_init_slots(dev, 2,
-                                   INPUT_MT_POINTER |
-                                   (cr48_profile_sensor ?
-                                       INPUT_MT_TRACK : INPUT_MT_SEMI_MT));
+                                   INPUT_MT_POINTER | INPUT_MT_SEMI_MT);
+       } else {
+               set_abs_position_params(dev, priv, ABS_X, ABS_Y);
+               input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
+               if (SYN_CAP_PALMDETECT(priv->capabilities))
+                       input_set_abs_params(dev, ABS_TOOL_WIDTH, 0, 15, 0, 0);
        }
 
-       if (SYN_CAP_PALMDETECT(priv->capabilities))
-               input_set_abs_params(dev, ABS_TOOL_WIDTH, 0, 15, 0, 0);
-
        __set_bit(BTN_TOUCH, dev->keybit);
        __set_bit(BTN_TOOL_FINGER, dev->keybit);
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to