From 9b771ac442a640999247314e8cdafd8943611700 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 8 May 2009 18:30:32 -0700 Subject: [PATCH] Input: lifebook - don't send incomplete events When we get a relative packet from trackpoint (when we deal with touchscreen/trackpoint combo) we should not send events for the device corresponding to touchscreen as it confuses evtouch driver (it looks like it keeps previously reported absolute coordinates and the cursor stays in the same place). Reported-by: Marcin Drewka Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/lifebook.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 15ac3205ac05..dcd4236af1e3 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c @@ -159,21 +159,22 @@ static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse) if (!dev2) printk(KERN_WARNING "lifebook.c: got relative packet " "but no relative device set up\n"); - } else if (lifebook_use_6byte_proto) { - input_report_abs(dev1, ABS_X, - ((packet[1] & 0x3f) << 6) | (packet[2] & 0x3f)); - input_report_abs(dev1, ABS_Y, - 4096 - (((packet[4] & 0x3f) << 6) | (packet[5] & 0x3f))); } else { - input_report_abs(dev1, ABS_X, - (packet[1] | ((packet[0] & 0x30) << 4))); - input_report_abs(dev1, ABS_Y, - 1024 - (packet[2] | ((packet[0] & 0xC0) << 2))); + if (lifebook_use_6byte_proto) { + input_report_abs(dev1, ABS_X, + ((packet[1] & 0x3f) << 6) | (packet[2] & 0x3f)); + input_report_abs(dev1, ABS_Y, + 4096 - (((packet[4] & 0x3f) << 6) | (packet[5] & 0x3f))); + } else { + input_report_abs(dev1, ABS_X, + (packet[1] | ((packet[0] & 0x30) << 4))); + input_report_abs(dev1, ABS_Y, + 1024 - (packet[2] | ((packet[0] & 0xC0) << 2))); + } + input_report_key(dev1, BTN_TOUCH, packet[0] & 0x04); + input_sync(dev1); } - input_report_key(dev1, BTN_TOUCH, packet[0] & 0x04); - input_sync(dev1); - if (dev2) { if (relative_packet) { input_report_rel(dev2, REL_X, -- 2.30.2