From patchwork Wed Dec 29 22:48:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mariusz Bialonczyk X-Patchwork-Id: 440121 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBUMBElX000490 for ; Thu, 30 Dec 2010 22:12:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754034Ab0L2Ws4 (ORCPT ); Wed, 29 Dec 2010 17:48:56 -0500 Received: from skyboo.net ([82.160.187.4]:36688 "EHLO skyboo.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753937Ab0L2Wsz (ORCPT ); Wed, 29 Dec 2010 17:48:55 -0500 Received: from [2001:470:1f0b:1af:f000::2] by skyboo.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1PY4pB-0002dA-31; Wed, 29 Dec 2010 23:48:53 +0100 Message-ID: <4D1BBACB.9020502@skyboo.net> Date: Wed, 29 Dec 2010 23:48:43 +0100 From: =?UTF-8?B?TWFyaXVzeiBCaWHFgm/FhGN6eWs=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101211 Icedove/3.0.11 MIME-Version: 1.0 To: Mauro Carvalho Chehab CC: linux-media@vger.kernel.org References: <4D17816B.2050500@skyboo.net> <4D187D96.5060303@redhat.com> In-Reply-To: <4D187D96.5060303@redhat.com> X-SA-Exim-Connect-IP: 2001:470:1f0b:1af:f000::2 X-SA-Exim-Mail-From: manio@skyboo.net X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on draco.skyboo.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.1 Subject: [PATCH] ir-nec-decoder: fix repeat key issue X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:26:47 +0000) X-SA-Exim-Scanned: Yes (on skyboo.net) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 30 Dec 2010 22:12:00 +0000 (UTC) diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c index 5d15c31..7b58b4a 100644 --- a/drivers/media/rc/ir-nec-decoder.c +++ b/drivers/media/rc/ir-nec-decoder.c @@ -88,9 +88,13 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev) data->state = STATE_BIT_PULSE; return 0; } else if (eq_margin(ev.duration, NEC_REPEAT_SPACE, NEC_UNIT / 2)) { - rc_repeat(dev); - IR_dprintk(1, "Repeat last key\n"); - data->state = STATE_TRAILER_PULSE; + if (!dev->keypressed) { + IR_dprintk(1, "Discarding last key repeat: event after key up\n"); + } else { + rc_repeat(dev); + IR_dprintk(1, "Repeat last key\n"); + data->state = STATE_TRAILER_PULSE; + } return 0; }