From patchwork Fri Jul 30 02:17:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 3978 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Fri, 30 Jul 2010 02:18:07 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Thu, 29 Jul 2010 23:25:49 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OefAk-00011p-PQ; Fri, 30 Jul 2010 02:18:07 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758422Ab0G3CSE (ORCPT + 1 other); Thu, 29 Jul 2010 22:18:04 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:52612 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758412Ab0G3CSA (ORCPT ); Thu, 29 Jul 2010 22:18:00 -0400 Received: by bwz1 with SMTP id 1so202388bwz.19 for ; Thu, 29 Jul 2010 19:17:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=rkafwMCbp0IbEmJoNDwM6hHe41gHC79z2owhg8a2+es=; b=QQss7lsRxqSVF2/Y23ITYFB2akQWQtZ9WbOKBGYa259pwb6vf+BpM9NOXjj6y/8qm7 aqrCmkLmRLJf6cN/20cMfQVWRO+c42jQnUFSStQ+OTpcjC3QYOkl8lTj8WKvn6z5riw3 y7FIgVg1O/AQM4gkGrO+d9qTDcYCoT0W5qI5o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=GDBmF6+FJ/lmEokRQjKSdr5mdsysnmJ7nls70JKp5HTJY3LL7tXC/gNdMUTxNw3Ltp NBT9TwDQcprYEKtyibAYYZFp91Fijl2j9LGXm/rNQagaC1FmXeMOTg8aUxVVGHzrZVYH Kjfn+Ca06ycmZ/a+DQo6N2rqlZ7bHosfuFgLg= Received: by 10.204.70.206 with SMTP id e14mr649360bkj.143.1280456278201; Thu, 29 Jul 2010 19:17:58 -0700 (PDT) Received: from localhost.localdomain (IGLD-84-228-148-137.inter.net.il [84.228.148.137]) by mx.google.com with ESMTPS id f10sm1110122bkl.17.2010.07.29.19.17.56 (version=SSLv3 cipher=RC4-MD5); Thu, 29 Jul 2010 19:17:57 -0700 (PDT) From: Maxim Levitsky To: lirc-list@lists.sourceforge.net Cc: Jarod Wilson , linux-input@vger.kernel.org, linux-media@vger.kernel.org, Mauro Carvalho Chehab , Christoph Bartelmus , Maxim Levitsky Subject: [PATCH 11/13] IR: report unknown scancodes the in-kernel decoders found. Date: Fri, 30 Jul 2010 05:17:13 +0300 Message-Id: <1280456235-2024-12-git-send-email-maximlevitsky@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1280456235-2024-1-git-send-email-maximlevitsky@gmail.com> References: <1280456235-2024-1-git-send-email-maximlevitsky@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This way it is possible to use evtest to create keymap for unknown remote. Signed-off-by: Maxim Levitsky --- drivers/media/IR/ir-keytable.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 34b9c07..ba7678a 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c @@ -339,6 +339,8 @@ void ir_repeat(struct input_dev *dev) spin_lock_irqsave(&ir->keylock, flags); + input_event(dev, EV_MSC, MSC_SCAN, ir->last_scancode); + if (!ir->keypressed) goto out; @@ -370,6 +372,8 @@ void ir_keydown(struct input_dev *dev, int scancode, u8 toggle) spin_lock_irqsave(&ir->keylock, flags); + input_event(dev, EV_MSC, MSC_SCAN, scancode); + /* Repeat event? */ if (ir->keypressed && ir->last_scancode == scancode && @@ -383,9 +387,11 @@ void ir_keydown(struct input_dev *dev, int scancode, u8 toggle) ir->last_toggle = toggle; ir->last_keycode = keycode; + if (keycode == KEY_RESERVED) goto out; + /* Register a keypress */ ir->keypressed = true; IR_dprintk(1, "%s: key down event, key 0x%04x, scancode 0x%04x\n", @@ -480,6 +486,8 @@ int __ir_input_register(struct input_dev *input_dev, set_bit(EV_KEY, input_dev->evbit); set_bit(EV_REP, input_dev->evbit); + set_bit(EV_MSC, input_dev->evbit); + set_bit(MSC_SCAN, input_dev->mscbit); if (ir_setkeytable(input_dev, &ir_dev->rc_tab, rc_tab)) { rc = -ENOMEM;