From patchwork Thu Jan 16 22:56:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 3500901 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6D3049F169 for ; Thu, 16 Jan 2014 22:56:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D4D520179 for ; Thu, 16 Jan 2014 22:56:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6FC402010F for ; Thu, 16 Jan 2014 22:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750974AbaAPW41 (ORCPT ); Thu, 16 Jan 2014 17:56:27 -0500 Received: from mail-we0-f174.google.com ([74.125.82.174]:54483 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750754AbaAPW41 (ORCPT ); Thu, 16 Jan 2014 17:56:27 -0500 Received: by mail-we0-f174.google.com with SMTP id x55so3822743wes.19 for ; Thu, 16 Jan 2014 14:56:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=qpGVklH3gosl2CRJBFxFbJ5qlViJkyFAvStv4QvpVDc=; b=nLo3gsKoKiVmlTeUSYB7/PF4qL7SzNv91egMs42oNt6e8Iqegrr9Z5qwxY9BAigMHY AMlNZYCG1Igi2aeuiasqarTYfduvlDd0KeJDQYW6HyfZ0yOv6W7XSo5TazJYyXxtI0Dw +Wg5d8xR/S1Q1h1XHWBNI+t0KAQ4mmnfTRXpL5jFkRa0hJWPyHRqIwOmDMHOCC6R6UUq iHA+8+8DHjm/kdwI/xG/eOCRigbhH+o6FnYeSUAxxpYGhw0eJMFD07b3M1VIneFaJu+2 vgPT3kEzGDCJ7DbycU3MG/eJ9w3STckvMIid7iqXJwh5nyR7x9H7PHxb2/SPb9nGgxOR qwbw== X-Gm-Message-State: ALoCoQn7XCbp8EhsGxFqM6DXK+dknWV7fs8fnjIeaBW9TsFgfz09PryUHCi+ZXOpTGJfrIqpat6P X-Received: by 10.194.174.4 with SMTP id bo4mr4703568wjc.62.1389912985838; Thu, 16 Jan 2014 14:56:25 -0800 (PST) Received: from radagast.lan (jahogan.plus.com. [212.159.75.221]) by mx.google.com with ESMTPSA id f7sm7636877wjb.7.2014.01.16.14.56.24 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Thu, 16 Jan 2014 14:56:25 -0800 (PST) From: James Hogan To: Sean Young , Mauro Carvalho Chehab Cc: James Hogan , linux-media@vger.kernel.org Subject: [PATCH] media: rc: only turn on LED if keypress generated Date: Thu, 16 Jan 2014 22:56:22 +0000 Message-Id: <1389912982-25956-1-git-send-email-james.hogan@imgtec.com> X-Mailer: git-send-email 1.8.3.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since v3.12, specifically 153a60bb0fac ([media] rc: add feedback led trigger for rc keypresses), an LED trigger is activated on IR keydown whether or not a keypress is generated (i.e. even if there's no matching keycode). However the repeat and keyup logic isn't used unless there is a keypress, which results in non-keypress keydown events turning on the LED and not turning it off again. On the assumption that the intent was for the LED only to light up on valid key presses (you probably don't want it lighting up for the wrong remote control for example), move the led_trigger_event() call inside the keycode check. Signed-off-by: James Hogan Cc: Sean Young Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Acked-by: Sean Young --- Was that the original intent? If not it could be tweaked to set dev->keypressed in either case instead, so that they LED trigger works for unmapped scancodes too. --- drivers/media/rc/rc-main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 46da365..cff9d53 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -649,9 +649,10 @@ static void ir_do_keydown(struct rc_dev *dev, int scancode, "key 0x%04x, scancode 0x%04x\n", dev->input_name, keycode, scancode); input_report_key(dev->input_dev, keycode, 1); + + led_trigger_event(led_feedback, LED_FULL); } - led_trigger_event(led_feedback, LED_FULL); input_sync(dev->input_dev); }