When the device is a touchpad additional capabilities need to
be set and reported.

Signed-off-by: Andrew Duggan <[email protected]>
Acked-by: Christopher Heiny <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Benjamin Tissoires <[email protected]>
Cc: Linux Walleij <[email protected]>
Cc: David Herrmann <[email protected]>
Cc: Jiri Kosina <[email protected]>

---
 drivers/input/rmi4/rmi_f11.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c
index 8709abe..07044d79 100644
--- a/drivers/input/rmi4/rmi_f11.c
+++ b/drivers/input/rmi4/rmi_f11.c
@@ -688,6 +688,9 @@ static void rmi_f11_abs_pos_report(struct f11_data *f11,
        /* MT sync between fingers */
        if (sensor->type_a)
                input_mt_sync(sensor->input);
+
+       if (sensor->sensor_type == rmi_f11_sensor_touchpad)
+               input_mt_report_pointer_emulation(sensor->input, true);
 }
 
 static void rmi_f11_finger_handler(struct f11_data *f11,
@@ -717,7 +720,7 @@ static void rmi_f11_finger_handler(struct f11_data *f11,
                if (sensor->data.rel_pos)
                        rmi_f11_rel_pos_report(sensor, i);
        }
-       input_mt_sync(sensor->input);
+       input_report_key(sensor->input, BTN_TOUCH, finger_pressed_count);
        input_sync(sensor->input);
 }
 
@@ -1137,6 +1140,9 @@ static void f11_set_abs_params(struct rmi_function *fn, 
struct f11_data *f11)
        dev_dbg(&fn->dev, "Set ranges X=[%d..%d] Y=[%d..%d].",
                        x_min, x_max, y_min, y_max);
 
+       input_set_abs_params(input, ABS_X, x_min, x_max, 0, 0);
+       input_set_abs_params(input, ABS_Y, y_min, y_max, 0, 0);
+
        input_set_abs_params(input, ABS_MT_PRESSURE, 0,
                        DEFAULT_MAX_ABS_MT_PRESSURE, 0, 0);
        input_set_abs_params(input, ABS_MT_TOUCH_MAJOR,
@@ -1374,6 +1380,15 @@ static int rmi_f11_register_devices(struct rmi_function 
*fn)
                set_bit(BTN_RIGHT, input_dev_mouse->keybit);
        }
 
+       if (sensor->sensor_type == rmi_f11_sensor_touchpad) {
+               set_bit(BTN_TOOL_FINGER, input_dev->keybit);
+               set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
+               set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
+               set_bit(BTN_TOOL_QUADTAP, input_dev->keybit);
+               set_bit(BTN_TOOL_QUINTTAP, input_dev->keybit);
+       }
+
+
        return 0;
 
 error_unregister:
-- 
1.8.3.2

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

Reply via email to