From patchwork Sun Oct 27 20:07:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11214329 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 184031709 for ; Sun, 27 Oct 2019 20:08:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E80782070B for ; Sun, 27 Oct 2019 20:08:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="reu+6hVA"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cuMhl+y5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E80782070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=weux9NRKZaWKKkSrDQEJIypnII1Q8gyP7BGElQpb8SU=; b=reu+6hVAHhSmKq Q3yVDc0KXLNapSH8LwCjLEiB8hR1PL7LYt6BL5peUEI4HBF0EiYYoJt5278ky6NiQdtVYVxRoFjoi iyc5W972js5ABHemokAsyX797bFUGYv/PgKnjQNwsDRuYGkt/xHBOgBGLmopkNfe7iWImpYjL/aF3 grGZ86bAEcPJ9GEANZvw7ScNjyCKHjeSA6A3hY5WKV64AWdGkI/HPhqFEp2yrAai3vnhjkeNkvosD zWEoNwArkNxs1smBiXhK7dbHNgiwINBkeXeqwA+owYhzPpFcaAXGfaQV3L9OFFP8MEfs9eoJPz40x QfLyQBbx4TDqmwspxDiA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iOopu-0002EJ-FL; Sun, 27 Oct 2019 20:08:26 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iOopm-00026F-0E for linux-arm-kernel@lists.infradead.org; Sun, 27 Oct 2019 20:08:19 +0000 Received: by mail-wr1-x444.google.com with SMTP id l10so7730094wrb.2 for ; Sun, 27 Oct 2019 13:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JHjDVXlYQwiAoE4cglFinqNu/fI+itGzM4QPPTRFWo4=; b=cuMhl+y55PcWVBj2ZHyOxom1igexqesx9kTqIJhKtJmv3uuwRL+HpvzQaGaAi8NdzT gUlxVTVav/TtS6qSkYbA1Pwyx2sVGSTvKn9/1t5Rv7Z8jiwVld9zRt66ZFC51NOfiH18 L+koAKB3f51wK4UTk3kp7qQx7vf2bL/jUQZhZAg9E+McoCydYu7Fo5fHxjRS5/ONOaZy 6TUmAm5ffe/zM/mEmOpgmR6/h1aYadqzpTzPCVtfLG9kHzWocfxtnYRVDVTD1tA9jm3p drTBCo3NpRkrI/0Gne/+XEQXahJbKCPZ6OHsKD0cZkudAwft6NPiO84X645fxZuQFzBl tPhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JHjDVXlYQwiAoE4cglFinqNu/fI+itGzM4QPPTRFWo4=; b=WyeaOjokfF8xMco8FmX7aSOur3hpIfKH5kqECrtkWIrbEr17OXXj2d5s+azY9E8Dyk k1odTRRbUmHDzQwv/h0Gxubm3fO0eZcU4/6Xk3IUMIOmJvyu8k++6fiLiacEE8XKvfTe 9joE5mLjJQJ4EhYLonBGWUawzvcwBw7QVekKjakhYM2NeZwJKWpK3JpZHfxsydYFC4wG VpcCEwo9uwQPyjPI7GoElmrd8S/wZu6dyhfMDQcd5jjNsmc7UVVa0lNdDTCotZuBRXZK ZmPOpHQdW9ZgkxPs1UcMv1V8zd2MyKNPHNn1UbX7Mr8HyC3rA0X1sqmKqI6xfhISm8p8 iR/g== X-Gm-Message-State: APjAAAX8fOv0jpc/cMJfklu0Gexs5SIY+/X7ROf4xvp7OFT5wNkn4PD7 YF5NDctE6YCZtqjFdJ5Bmrhgggm4SqM= X-Google-Smtp-Source: APXvYqwgPBWIxa4P7QHII4JbTrHsXiMvgd3gfQ3jNcNJrOx2CLIPOBo3FeNpmRirLkIIvwu0LVnAaA== X-Received: by 2002:adf:a4cf:: with SMTP id h15mr11978115wrb.222.1572206893835; Sun, 27 Oct 2019 13:08:13 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0::4e2b:d7ca]) by smtp.gmail.com with ESMTPSA id o11sm8539538wmh.28.2019.10.27.13.08.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Oct 2019 13:08:12 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Mauro Carvalho Chehab , Rob Herring , Maxime Ripard , Sean Young , Christian Hewitt Subject: [PATCH 1/2] media: rc: add keymap for Beelink GS1 remote control Date: Sun, 27 Oct 2019 21:07:37 +0100 Message-Id: <20191027200738.24802-1-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191027_130818_040046_C93F4F59 X-CRM114-Status: GOOD ( 15.09 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (peron.clem[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Beelink GS1 Andoid TV Box ships with a simple NEC remote. Signed-off-by: Clément Péron --- .../devicetree/bindings/media/rc.yaml | 1 + drivers/media/rc/keymaps/Makefile | 1 + drivers/media/rc/keymaps/rc-beelink-gs1.c | 84 +++++++++++++++++++ include/media/rc-map.h | 1 + 4 files changed, 87 insertions(+) create mode 100644 drivers/media/rc/keymaps/rc-beelink-gs1.c diff --git a/Documentation/devicetree/bindings/media/rc.yaml b/Documentation/devicetree/bindings/media/rc.yaml index 3d5c154fd230..ceb283f7888a 100644 --- a/Documentation/devicetree/bindings/media/rc.yaml +++ b/Documentation/devicetree/bindings/media/rc.yaml @@ -39,6 +39,7 @@ properties: - rc-avermedia-rm-ks - rc-avertv-303 - rc-azurewave-ad-tu700 + - rc-beelink-gs1 - rc-behold - rc-behold-columbus - rc-budget-ci-old diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index 4ab4af062abf..63261ef6380a 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile @@ -17,6 +17,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-avermedia-rm-ks.o \ rc-avertv-303.o \ rc-azurewave-ad-tu700.o \ + rc-beelink-gs1.o \ rc-behold.o \ rc-behold-columbus.o \ rc-budget-ci-old.o \ diff --git a/drivers/media/rc/keymaps/rc-beelink-gs1.c b/drivers/media/rc/keymaps/rc-beelink-gs1.c new file mode 100644 index 000000000000..cedbd5d20bc7 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-beelink-gs1.c @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2019 Clément Péron + +#include +#include + +/* + * Keymap for the Beelink GS1 remote control + */ + +static struct rc_map_table beelink_gs1_table[] = { + /* + * TV Keys (Power, Learn and Volume) + * { 0x40400d, KEY_TV }, + * { 0x80f1, KEY_TV }, + * { 0x80f3, KEY_TV }, + * { 0x80f4, KEY_TV }, + */ + + { 0x8051, KEY_POWER }, + { 0x804d, KEY_MUTE }, + { 0x8040, KEY_CONFIG }, + + { 0x8026, KEY_UP }, + { 0x8028, KEY_DOWN }, + { 0x8025, KEY_LEFT }, + { 0x8027, KEY_RIGHT }, + { 0x800d, KEY_OK }, + + { 0x8053, KEY_HOME }, + { 0x80bc, KEY_MEDIA }, + { 0x801b, KEY_BACK }, + { 0x8049, KEY_MENU }, + + { 0x804e, KEY_VOLUMEUP }, + { 0x8056, KEY_VOLUMEDOWN }, + + { 0x8054, KEY_SUBTITLE }, /* Web */ + { 0x8052, KEY_EPG }, /* Media */ + + { 0x8041, KEY_CHANNELUP }, + { 0x8042, KEY_CHANNELDOWN }, + + { 0x8031, KEY_1 }, + { 0x8032, KEY_2 }, + { 0x8033, KEY_3 }, + + { 0x8034, KEY_4 }, + { 0x8035, KEY_5 }, + { 0x8036, KEY_6 }, + + { 0x8037, KEY_7 }, + { 0x8038, KEY_8 }, + { 0x8039, KEY_9 }, + + { 0x8044, KEY_DELETE }, + { 0x8030, KEY_0 }, + { 0x8058, KEY_MODE }, /* # Input Method */ +}; + +static struct rc_map_list beelink_gs1_map = { + .map = { + .scan = beelink_gs1_table, + .size = ARRAY_SIZE(beelink_gs1_table), + .rc_proto = RC_PROTO_NEC, + .name = RC_MAP_BEELINK_GS1, + } +}; + +static int __init init_rc_map_beelink_gs1(void) +{ + return rc_map_register(&beelink_gs1_map); +} + +static void __exit exit_rc_map_beelink_gs1(void) +{ + rc_map_unregister(&beelink_gs1_map); +} + +module_init(init_rc_map_beelink_gs1) +module_exit(exit_rc_map_beelink_gs1) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Clément Péron "); diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 0a8669daeaaa..f99575a0d29c 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h @@ -168,6 +168,7 @@ struct rc_map *rc_map_get(const char *name); #define RC_MAP_AVERMEDIA_RM_KS "rc-avermedia-rm-ks" #define RC_MAP_AVERTV_303 "rc-avertv-303" #define RC_MAP_AZUREWAVE_AD_TU700 "rc-azurewave-ad-tu700" +#define RC_MAP_BEELINK_GS1 "rc-beelink-gs1" #define RC_MAP_BEHOLD "rc-behold" #define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus" #define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old"