Re: [RFC PATCH 06/06] input/rmi4: F11 - 2D touch interface
From: Benjamin Tissoires <hidden>
Date: 2012-11-27 13:01:42
Also in:
linux-input
Hi Christopher, I did not made a full review, but at least, there is a problem in your rmi_f11_finger_handler function: On Sat, Nov 17, 2012 at 4:58 AM, Christopher Heiny [off-list ref] wrote:
quoted hunk ↗ jump to hunk
rmi_f11.c is a driver for 2D touch sensors using the RMI4 protocol. It supports both touchscreen and touchpad input, in both absolute and relative formats. Support for Type-B multitouch is the default, Type-A support is included for certain legacy sensors. Signed-off-by: Christopher Heiny <redacted> To: Henrik Rydberg <redacted> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Linus Walleij <redacted> Cc: Naveen Kumar Gaddipati <redacted> Cc: Joeri de Gram <redacted> --- drivers/input/rmi4/rmi_f11.c | 2813 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 2813 insertions(+), 0 deletions(-)diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c new file mode 100644 index 0000000..b9a84bc --- /dev/null +++ b/drivers/input/rmi4/rmi_f11.c
[snipped]
+static void rmi_f11_finger_handler(struct f11_data *f11,
+ struct f11_2d_sensor *sensor)
+{
+ const u8 *f_state = sensor->data.f_state;
+ u8 finger_state;
+ u8 finger_pressed_count;
+ u8 i;
+
+ for (i = 0, finger_pressed_count = 0; i < sensor->nbr_fingers; i++) {
+ /* Possible of having 4 fingers per f_statet register */
+ finger_state = (f_state[i / 4] >> (2 * (i % 4))) &
+ FINGER_STATE_MASK;
+ if (finger_state == F11_RESERVED) {
+ pr_err("%s: Invalid finger state[%d]:0x%02x.", __func__,
+ i, finger_state);
+ continue;
+ } else if ((finger_state == F11_PRESENT) ||
+ (finger_state == F11_INACCURATE)) {
+ finger_pressed_count++;
+ }
+
+ if (sensor->data.abs_pos)
+ rmi_f11_abs_pos_report(f11, sensor, finger_state, i);
+
+ if (sensor->data.rel_pos)
+ rmi_f11_rel_pos_report(sensor, i);
+ }
+ input_mt_sync(sensor->input);This should be "input_mt_sync_frame(sensor->input);" otherwise, the synaptics xorg driver won't handle the touchpad correctly. Cheers, Benjamin
+ input_sync(sensor->input); +} +
[snipped]