public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: mimio, add extra sync to down-up input events
@ 2010-02-14 20:37 Jiri Slaby
  2010-02-15 15:41 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2010-02-14 20:37 UTC (permalink / raw)
  To: gregkh
  Cc: linux-kernel, jirislaby, devel, Phil Hannent, mwilder,
	Dmitry Torokhov

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@suse.cz>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: devel@driverdev.osuosl.org
Cc: Phil Hannent <phil@hannent.co.uk>
Cc: <mwilder@cs.nmsu.edu>
Cc: Dmitry Torokhov <dtor@mail.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: mimio, add extra sync to down-up input events
  2010-02-14 20:37 [PATCH] staging: mimio, add extra sync to down-up input events Jiri Slaby
@ 2010-02-15 15:41 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2010-02-15 15:41 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: linux-kernel, jirislaby, devel, Phil Hannent, mwilder,
	Dmitry Torokhov

On Sun, Feb 14, 2010 at 09:37:01PM +0100, Jiri Slaby wrote:
> 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@suse.cz>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: devel@driverdev.osuosl.org
> Cc: Phil Hannent <phil@hannent.co.uk>
> Cc: <mwilder@cs.nmsu.edu>
> Cc: Dmitry Torokhov <dtor@mail.ru>
> ---
>  drivers/staging/mimio/mimio.c |    6 ++++++

Heh, I just deleted this driver from the staging tree, and it's gone in
linux-next, as the company now has a libusb version that works
cross-platform without any kernel changes needed.

So thanks for the patch, but it is no longer needed :)

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-15 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-14 20:37 [PATCH] staging: mimio, add extra sync to down-up input events Jiri Slaby
2010-02-15 15:41 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox