From patchwork Sun Feb 14 20:36:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 2724 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sun, 14 Feb 2010 20:36:52 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Sun, 14 Feb 2010 18:40:31 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NglD1-0004sk-Kl; Sun, 14 Feb 2010 20:36:52 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753222Ab0BNUga (ORCPT + 1 other); Sun, 14 Feb 2010 15:36:30 -0500 Received: from smtp.mujha-vel.cz ([81.30.225.246]:54695 "EHLO smtp.mujha-vel.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752301Ab0BNUga (ORCPT ); Sun, 14 Feb 2010 15:36:30 -0500 Received: from [217.66.174.142] (helo=localhost.localdomain) by smtp.mujha-vel.cz with esmtp (Exim 4.63) (envelope-from ) id 1NglCd-0008Lg-Tu; Sun, 14 Feb 2010 21:36:28 +0100 From: Jiri Slaby To: mchehab@redhat.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, jirislaby@gmail.com, Dmitry Torokhov , Mauro Carvalho Chehab Subject: [PATCH] V4L: dvb-usb, add extra sync to down-up input events Date: Sun, 14 Feb 2010 21:36:25 +0100 Message-Id: <1266179785-836-1-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 1.6.6.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Cc: Dmitry Torokhov Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Acked-by: Dmitry Torokhov --- drivers/media/dvb/dvb-usb/dib0700_core.c | 1 + drivers/media/dvb/dvb-usb/dvb-usb-remote.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c index 4450214..4f961d2 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_core.c +++ b/drivers/media/dvb/dvb-usb/dib0700_core.c @@ -612,6 +612,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) case REMOTE_KEY_REPEAT: deb_info("key repeated\n"); input_event(d->rc_input_dev, EV_KEY, event, 1); + input_sync(d->rc_input_dev); input_event(d->rc_input_dev, EV_KEY, d->last_event, 0); input_sync(d->rc_input_dev); break; diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c index 6b5ded9..a03ef7e 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c @@ -107,6 +107,7 @@ static void dvb_usb_read_remote_control(struct work_struct *work) case REMOTE_KEY_REPEAT: deb_rc("key repeated\n"); input_event(d->rc_input_dev, EV_KEY, event, 1); + input_sync(d->rc_input_dev); input_event(d->rc_input_dev, EV_KEY, d->last_event, 0); input_sync(d->rc_input_dev); break;