[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1266179821-900-1-git-send-email-jslaby@suse.cz>
Date: Sun, 14 Feb 2010 21:37:01 +0100
From: Jiri Slaby <jslaby@...e.cz>
To: gregkh@...e.de
Cc: linux-kernel@...r.kernel.org, jirislaby@...il.com,
devel@...verdev.osuosl.org, Phil Hannent <phil@...nent.co.uk>,
<mwilder@...nmsu.edu>, Dmitry Torokhov <dtor@...l.ru>
Subject: [PATCH] staging: mimio, add extra sync to down-up input events
Userspace is allowed to coalesce events between SYNCs. And since the code
emits UP right after DOWN for the same key, it may be missed
(up+down=nothing). Add an extra sync in between UP and DOWN events to disable
the coalesce.
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
Cc: Greg Kroah-Hartman <gregkh@...e.de>
Cc: devel@...verdev.osuosl.org
Cc: Phil Hannent <phil@...nent.co.uk>
Cc: <mwilder@...nmsu.edu>
Cc: Dmitry Torokhov <dtor@...l.ru>
---
drivers/staging/mimio/mimio.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/mimio/mimio.c b/drivers/staging/mimio/mimio.c
index 2cfef4a..08a5400 100644
--- a/drivers/staging/mimio/mimio.c
+++ b/drivers/staging/mimio/mimio.c
@@ -730,6 +730,7 @@ static void mimio_rx_handler(struct mimio *mimio,
dev_dbg(dev, "mem-reset.\n");
/* input_regs(mimio->idev, regs); */
input_event(mimio->idev, EV_KEY, BTN_0, 1);
+ input_sync(mimio->idev);
input_event(mimio->idev, EV_KEY, BTN_0, 0);
input_sync(mimio->idev);
mimio->pktbuf.p += 7;
@@ -750,6 +751,7 @@ static void mimio_rx_handler(struct mimio *mimio,
dev_dbg(&mimio->idev->dev, "new-page.\n");
/* input_regs(mimio->idev, regs); */
input_event(mimio->idev, EV_KEY, BTN_1, 1);
+ input_sync(mimio->idev);
input_event(mimio->idev, EV_KEY, BTN_1, 0);
input_sync(mimio->idev);
break;
@@ -757,6 +759,7 @@ static void mimio_rx_handler(struct mimio *mimio,
dev_dbg(&mimio->idev->dev, "tag-page.\n");
/* input_regs(mimio->idev, regs); */
input_event(mimio->idev, EV_KEY, BTN_2, 1);
+ input_sync(mimio->idev);
input_event(mimio->idev, EV_KEY, BTN_2, 0);
input_sync(mimio->idev);
break;
@@ -764,6 +767,7 @@ static void mimio_rx_handler(struct mimio *mimio,
dev_dbg(&mimio->idev->dev, "print-page.\n");
/* input_regs(mimio->idev, regs);*/
input_event(mimio->idev, EV_KEY, BTN_3, 1);
+ input_sync(mimio->idev);
input_event(mimio->idev, EV_KEY, BTN_3, 0);
input_sync(mimio->idev);
break;
@@ -772,6 +776,7 @@ static void mimio_rx_handler(struct mimio *mimio,
"maximize-window.\n");
/* input_regs(mimio->idev, regs); */
input_event(mimio->idev, EV_KEY, BTN_4, 1);
+ input_sync(mimio->idev);
input_event(mimio->idev, EV_KEY, BTN_4, 0);
input_sync(mimio->idev);
break;
@@ -779,6 +784,7 @@ static void mimio_rx_handler(struct mimio *mimio,
dev_dbg(&mimio->idev->dev, "find-ctl-panel.\n");
/* input_regs(mimio->idev, regs); */
input_event(mimio->idev, EV_KEY, BTN_5, 1);
+ input_sync(mimio->idev);
input_event(mimio->idev, EV_KEY, BTN_5, 0);
input_sync(mimio->idev);
break;
--
1.6.6.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists