From patchwork Sat Apr 29 10:52:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?RGF2aWQgSMODwqRyZGVtYW4=?= X-Patchwork-Id: 9705753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CE0A3602BE for ; Sat, 29 Apr 2017 10:52:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C00C324151 for ; Sat, 29 Apr 2017 10:52:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2B602623D; Sat, 29 Apr 2017 10:52:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44C7A24151 for ; Sat, 29 Apr 2017 10:52:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1035255AbdD2KwP (ORCPT ); Sat, 29 Apr 2017 06:52:15 -0400 Received: from vader.hardeman.nu ([95.142.160.32]:35858 "EHLO hardeman.nu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1035182AbdD2KwO (ORCPT ); Sat, 29 Apr 2017 06:52:14 -0400 Received: from hardeman.nu (zeus.hardeman.nu [IPv6:fd27:2a41:8fcb:2::a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by vader.hardeman.nu (Postfix) with ESMTPSA id CE3D3A6F; Sat, 29 Apr 2017 12:52:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hardeman.nu; s=hardeman-201703; t=1493463133; bh=7mUz1uM4cTBU1WzkcQDitYra0vgoOBhfhyHVk4hozok=; h=Subject:From:To:Cc:Date:From; b=VQtbOOYdlawd2fz59DCdUzZq55Hyqde7xAoHJ+2ekRaaRBFUq/LA1Rc5s/0y+6nbB RbSAyQoRwOpq42oQ/tRjS8I3jEEefYMDqyVRU6+VDhbtBUVFnktqbYqVKKvME693uV 2FRxlBkDN93KH1THFrxeGQcFaj59zL+4p1u0QG1mNGdw5dSDZxRCailQfJMkXtSMWa au6tTFkAR/zgEvW4Xvj18Py5EKKJG4OhdJDi9J92pVYlc6gz4tazA2wINl0NeJ+09M pog+k4CypEDguK9QldaJa29o6WK4Hk4R9cGJ67hev7n6y7V7/NZDjMl0c/T0+JQK++ e4mSkomma8m5g== Received: (nullmailer pid 25482 invoked by uid 1000); Sat, 29 Apr 2017 10:52:12 -0000 Subject: [PATCH] [RFC] rc-core: report protocol information to userspace From: David =?utf-8?b?SMOkcmRlbWFu?= To: linux-media@vger.kernel.org Cc: mchehab@s-opensource.com, sean@mess.org Date: Sat, 29 Apr 2017 12:52:12 +0200 Message-ID: <149346313232.25459.10475301883786006034.stgit@zeus.hardeman.nu> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Whether we decide to go for any new keytable ioctl():s or not in rc-core, we should provide the protocol information of keypresses to userspace. Note that this means that the RC_TYPE_* definitions become part of the userspace <-> kernel API/ABI (meaning a full patch should maybe move those defines under include/uapi). This would also need to be ack:ed by the input maintainers. --- drivers/media/rc/rc-main.c | 1 + include/uapi/linux/input-event-codes.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index e0f9b322ab02..a38c1f3569ee 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -773,6 +773,7 @@ static void ir_do_keydown(struct rc_dev *dev, enum rc_type protocol, if (new_event && dev->keypressed) ir_do_keyup(dev, false); + input_event(dev->input_dev, EV_MSC, MSC_PROTOCOL, protocol); input_event(dev->input_dev, EV_MSC, MSC_SCAN, scancode); if (new_event && keycode != KEY_RESERVED) { diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 3af60ee69053..1a8c3554cbcb 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -794,6 +794,7 @@ #define MSC_RAW 0x03 #define MSC_SCAN 0x04 #define MSC_TIMESTAMP 0x05 +#define MSC_PROTOCOL 0x06 #define MSC_MAX 0x07 #define MSC_CNT (MSC_MAX+1)