From patchwork Mon Feb 1 20:59:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Hewitt X-Patchwork-Id: 12060063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6360CC43381 for ; Mon, 1 Feb 2021 21:00:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E4E764ECC for ; Mon, 1 Feb 2021 21:00:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232201AbhBAVAi (ORCPT ); Mon, 1 Feb 2021 16:00:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229879AbhBAVAh (ORCPT ); Mon, 1 Feb 2021 16:00:37 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC7AAC061573; Mon, 1 Feb 2021 12:59:56 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id a16so670635wmm.0; Mon, 01 Feb 2021 12:59:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=2V/28VzWHyvh+HY7OGmImro30pfLz2Wvu7X6nZgDwNM=; b=rwFl9CxoyA5tCMaE4vHRwQ3LUWNduEYts0jWOSH8jEdzscTRxtFHm5Jf4gKwpRRkIl JtZGcI/lEFyVKbZRuV+xYed1uCbOZD9cmntnspCJLudSYtwUabmnNYqg/pbFJDZmhiXf 2lP5e5aGVmz5fLEujwKi05jU4d2ajSpr7u7ddnVL5Vonyot7HQUnxZpGhKwFg1dAM0UX DsqV3wqlx764dbxhuKHWplb4/WmCNLPHoiiT7BNbV1Aae1MfchyM+yDhZL1euOwrXqdP WLRTFUJd3g3Hq8YJVv1C1h5r1+2FElUlviwYY3dzV7Ozdxh5ISHvtAg8o+Xq9qMlKAW/ 9gfA== 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; bh=2V/28VzWHyvh+HY7OGmImro30pfLz2Wvu7X6nZgDwNM=; b=S6+XqHvm06rtODgn1hOpCf4xqqA7lknmc1/KgruOxwIYP27t8rEB0VBlqM/e/RRiBA 4GTNmfpvQ7695oFOtBfVH7gxLngzF/uzdN0yH+w5DtxDAcviGOdpqeqRf2SwVGAG408A HoO0dr6JmBuGMa63FoQzOJIUGOHNM/TE4sDjNhqi6eMHv7QcQpVT5LMRsSoiQHBNEsIi qnaKEOmJnhEhJZxxp3zZF950BDcXlQPjQeHulowDUcTOs7IP+ke5MfAcgdQeXtRMIjZF YNbtq6p4VSiIMdRFVVAWWXG2TL4TJyRzaOYRl2I5xRbzJAvbu7vLTh1NEEaI0axczBc3 Ju7A== X-Gm-Message-State: AOAM5333rT7vlwUg37Z/aLBublwrrDeejdX+MpqtB2knPzGv+Ylga4bg j3p/RHz17+NFP2VndFRi13o= X-Google-Smtp-Source: ABdhPJzPsyWs4JsB7ODJD2GzaojvMrd81mXinjihlGqfup82NVVMV2KE0AZldyywJOQGGdkDMwV7Gw== X-Received: by 2002:a1c:9ad5:: with SMTP id c204mr629117wme.65.1612213195419; Mon, 01 Feb 2021 12:59:55 -0800 (PST) Received: from localhost.localdomain ([87.200.95.144]) by smtp.gmail.com with ESMTPSA id d10sm3450617wrn.88.2021.02.01.12.59.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 12:59:54 -0800 (PST) From: Christian Hewitt To: Sean Young , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Christian Hewitt Subject: [PATCH] media: rc: add keymap for minix-neo remote Date: Mon, 1 Feb 2021 20:59:51 +0000 Message-Id: <20210201205951.938-1-christianshewitt@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add a keymap and bindings for the simple IR (NEC) remote used with Minix 'NEO' branded Android STB devices. Signed-off-by: Christian Hewitt --- .../devicetree/bindings/media/rc.yaml | 1 + drivers/media/rc/keymaps/Makefile | 1 + drivers/media/rc/keymaps/rc-minix-neo.c | 55 +++++++++++++++++++ include/media/rc-map.h | 1 + 4 files changed, 58 insertions(+) create mode 100644 drivers/media/rc/keymaps/rc-minix-neo.c diff --git a/Documentation/devicetree/bindings/media/rc.yaml b/Documentation/devicetree/bindings/media/rc.yaml index 946441b4e1a5..cbffdd6a470d 100644 --- a/Documentation/devicetree/bindings/media/rc.yaml +++ b/Documentation/devicetree/bindings/media/rc.yaml @@ -93,6 +93,7 @@ properties: - rc-medion-x10 - rc-medion-x10-digitainer - rc-medion-x10-or2x + - rc-minix-neo - rc-msi-digivox-ii - rc-msi-digivox-iii - rc-msi-tvanywhere diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index b252a1d2ebd6..b7f53f44c5c8 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile @@ -70,6 +70,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-medion-x10.o \ rc-medion-x10-digitainer.o \ rc-medion-x10-or2x.o \ + rc-minix-neo.o \ rc-msi-digivox-ii.o \ rc-msi-digivox-iii.o \ rc-msi-tvanywhere.o \ diff --git a/drivers/media/rc/keymaps/rc-minix-neo.c b/drivers/media/rc/keymaps/rc-minix-neo.c new file mode 100644 index 000000000000..9165af548ff1 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-minix-neo.c @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: GPL-2.0+ +// +// Copyright (C) 2021 Christian Hewitt + +#include +#include + +// +// Keytable for the Minix NEO remote control +// + +static struct rc_map_table minix_neo[] = { + + { 0x118, KEY_POWER }, + + { 0x146, KEY_UP }, + { 0x116, KEY_DOWN }, + { 0x147, KEY_LEFT }, + { 0x115, KEY_RIGHT }, + { 0x155, KEY_ENTER }, + + { 0x110, KEY_VOLUMEDOWN }, + { 0x140, KEY_BACK }, + { 0x114, KEY_VOLUMEUP }, + + { 0x10d, KEY_HOME }, + { 0x104, KEY_MENU }, + { 0x112, KEY_CONFIG }, + +}; + +static struct rc_map_list minix_neo_map = { + .map = { + .scan = minix_neo, + .size = ARRAY_SIZE(minix_neo), + .rc_proto = RC_PROTO_NEC, + .name = RC_MAP_MINIX_NEO, + } +}; + +static int __init init_rc_map_minix_neo(void) +{ + return rc_map_register(&minix_neo_map); +} + +static void __exit exit_rc_map_minix_neo(void) +{ + rc_map_unregister(&minix_neo_map); +} + +module_init(init_rc_map_minix_neo) +module_exit(exit_rc_map_minix_neo) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Christian Hewitt