From patchwork Mon Feb 18 21:59:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 10818915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF7636CB for ; Mon, 18 Feb 2019 21:59:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD3832B63D for ; Mon, 18 Feb 2019 21:59:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D04A32B63B; Mon, 18 Feb 2019 21:59:43 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 EC4A92B63B for ; Mon, 18 Feb 2019 21:59:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731233AbfBRV7l convert rfc822-to-8bit (ORCPT ); Mon, 18 Feb 2019 16:59:41 -0500 Received: from mail-oln040092068088.outbound.protection.outlook.com ([40.92.68.88]:47112 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731178AbfBRV7j (ORCPT ); Mon, 18 Feb 2019 16:59:39 -0500 Received: from VE1EUR02FT036.eop-EUR02.prod.protection.outlook.com (10.152.12.54) by VE1EUR02HT080.eop-EUR02.prod.protection.outlook.com (10.152.13.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1580.10; Mon, 18 Feb 2019 21:59:36 +0000 Received: from AM3PR03MB0966.eurprd03.prod.outlook.com (10.152.12.51) by VE1EUR02FT036.mail.protection.outlook.com (10.152.13.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.10 via Frontend Transport; Mon, 18 Feb 2019 21:59:36 +0000 Received: from AM3PR03MB0966.eurprd03.prod.outlook.com ([fe80::8011:1f4d:3804:e5f3]) by AM3PR03MB0966.eurprd03.prod.outlook.com ([fe80::8011:1f4d:3804:e5f3%10]) with mapi id 15.20.1622.018; Mon, 18 Feb 2019 21:59:36 +0000 From: Jonas Karlman To: "linux-media@vger.kernel.org" CC: Mauro Carvalho Chehab , Sean Young , "linux-kernel@vger.kernel.org" , Jonas Karlman Subject: [PATCH 1/3] [media] rc/keymaps: add keytable for Pine64 IR Remote Controller Thread-Topic: [PATCH 1/3] [media] rc/keymaps: add keytable for Pine64 IR Remote Controller Thread-Index: AQHUx9U8H3wCPt1wSEKj5vg9/61RJw== Date: Mon, 18 Feb 2019 21:59:36 +0000 Message-ID: References: <20190218215915.2782-1-jonas@kwiboo.se> In-Reply-To: <20190218215915.2782-1-jonas@kwiboo.se> Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P189CA0034.EURP189.PROD.OUTLOOK.COM (2603:10a6:206:15::47) To AM3PR03MB0966.eurprd03.prod.outlook.com (2a01:111:e400:884c::23) x-incomingtopheadermarker: OriginalChecksum:4F62B4110C22785338389040E444E344EBBECBAE9D95FC2EF31C87345B12A619;UpperCasedChecksum:9B05FDBCC47EDAAE94CBA4C021F022DE869153EA06BD484376DE64F5174EA214;SizeAsReceived:8538;Count:64 x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-tmn: [ONA2JunIWJ7bnuv8Th2KjKWajxtCapI8] x-microsoft-original-message-id: <20190218215915.2782-2-jonas@kwiboo.se> x-ms-publictraffictype: Email x-incomingheadercount: 64 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(20181119070)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045);SRVR:VE1EUR02HT080; x-ms-traffictypediagnostic: VE1EUR02HT080: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(4566010)(82015058);SRVR:VE1EUR02HT080;BCL:0;PCL:0;RULEID:;SRVR:VE1EUR02HT080; x-microsoft-antispam-message-info: qvNSoI5HSId4CEXxHhc/s28IcUFa9gWSFb94YbtdUTC5nqSExQzV3R3kq0rX1qxi MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 54485d23-c432-40fe-8436-6091d627118c X-MS-Exchange-CrossTenant-Network-Message-Id: 4739ca8f-6441-4616-6ac9-08d695ec5ee8 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 54485d23-c432-40fe-8436-6091d627118c X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2019 21:59:35.4933 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT080 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 This RC map is based on remote key schema at [1], the mouse button key did not have an obvious target and was mapped to KEY_CONTEXT_MENU. [1] http://files.pine64.org/doc/Pine%20A64%20Schematic/remote-wit-logo.jpg Signed-off-by: Jonas Karlman --- drivers/media/rc/keymaps/Makefile | 1 + drivers/media/rc/keymaps/rc-pine64.c | 59 ++++++++++++++++++++++++++++ include/media/rc-map.h | 1 + 3 files changed, 61 insertions(+) create mode 100644 drivers/media/rc/keymaps/rc-pine64.c diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index 5b1399af6b3a..0ea52f65bb03 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile @@ -76,6 +76,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-norwood.o \ rc-npgtech.o \ rc-pctv-sedna.o \ + rc-pine64.o \ rc-pinnacle-color.o \ rc-pinnacle-grey.o \ rc-pinnacle-pctv-hd.o \ diff --git a/drivers/media/rc/keymaps/rc-pine64.c b/drivers/media/rc/keymaps/rc-pine64.c new file mode 100644 index 000000000000..94e5624f63f4 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-pine64.c @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Keytable for Pine64 IR Remote Controller +// Copyright (c) 2017 Jonas Karlman + +#include +#include + +static struct rc_map_table pine64[] = { + { 0x404000, KEY_NUMERIC_0 }, + { 0x404001, KEY_NUMERIC_1 }, + { 0x404002, KEY_NUMERIC_2 }, + { 0x404003, KEY_NUMERIC_3 }, + { 0x404004, KEY_NUMERIC_4 }, + { 0x404005, KEY_NUMERIC_5 }, + { 0x404006, KEY_NUMERIC_6 }, + { 0x404007, KEY_NUMERIC_7 }, + { 0x404008, KEY_NUMERIC_8 }, + { 0x404009, KEY_NUMERIC_9 }, + { 0x40400a, KEY_MUTE }, + { 0x40400b, KEY_UP }, + { 0x40400c, KEY_BACKSPACE }, + { 0x40400d, KEY_OK }, + { 0x40400e, KEY_DOWN }, + { 0x404010, KEY_LEFT }, + { 0x404011, KEY_RIGHT }, + { 0x404017, KEY_VOLUMEDOWN }, + { 0x404018, KEY_VOLUMEUP }, + { 0x40401a, KEY_HOME }, + { 0x40401d, KEY_MENU }, + { 0x40401f, KEY_WWW }, + { 0x404045, KEY_BACK }, + { 0x404047, KEY_CONTEXT_MENU }, + { 0x40404d, KEY_POWER }, +}; + +static struct rc_map_list pine64_map = { + .map = { + .scan = pine64, + .size = ARRAY_SIZE(pine64), + .rc_proto = RC_PROTO_NECX, + .name = RC_MAP_PINE64, + } +}; + +static int __init init_rc_map_pine64(void) +{ + return rc_map_register(&pine64_map); +} + +static void __exit exit_rc_map_pine64(void) +{ + rc_map_unregister(&pine64_map); +} + +module_init(init_rc_map_pine64) +module_exit(exit_rc_map_pine64) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Jonas Karlman"); diff --git a/include/media/rc-map.h b/include/media/rc-map.h index d621acadfbf3..52b554aa784d 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h @@ -236,6 +236,7 @@ struct rc_map *rc_map_get(const char *name); #define RC_MAP_NORWOOD "rc-norwood" #define RC_MAP_NPGTECH "rc-npgtech" #define RC_MAP_PCTV_SEDNA "rc-pctv-sedna" +#define RC_MAP_PINE64 "rc-pine64" #define RC_MAP_PINNACLE_COLOR "rc-pinnacle-color" #define RC_MAP_PINNACLE_GREY "rc-pinnacle-grey" #define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd" From patchwork Mon Feb 18 21:59:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 10818919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E8126CB for ; Mon, 18 Feb 2019 21:59:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CE462B63B for ; Mon, 18 Feb 2019 21:59:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60C622B641; Mon, 18 Feb 2019 21:59:59 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 F0E112B63B for ; Mon, 18 Feb 2019 21:59:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731276AbfBRV7r convert rfc822-to-8bit (ORCPT ); Mon, 18 Feb 2019 16:59:47 -0500 Received: from mail-oln040092068019.outbound.protection.outlook.com ([40.92.68.19]:34816 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731179AbfBRV7l (ORCPT ); Mon, 18 Feb 2019 16:59:41 -0500 Received: from VE1EUR02FT036.eop-EUR02.prod.protection.outlook.com (10.152.12.52) by VE1EUR02HT048.eop-EUR02.prod.protection.outlook.com (10.152.13.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1580.10; Mon, 18 Feb 2019 21:59:37 +0000 Received: from AM3PR03MB0966.eurprd03.prod.outlook.com (10.152.12.51) by VE1EUR02FT036.mail.protection.outlook.com (10.152.13.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.10 via Frontend Transport; Mon, 18 Feb 2019 21:59:37 +0000 Received: from AM3PR03MB0966.eurprd03.prod.outlook.com ([fe80::8011:1f4d:3804:e5f3]) by AM3PR03MB0966.eurprd03.prod.outlook.com ([fe80::8011:1f4d:3804:e5f3%10]) with mapi id 15.20.1622.018; Mon, 18 Feb 2019 21:59:37 +0000 From: Jonas Karlman To: "linux-media@vger.kernel.org" CC: Mauro Carvalho Chehab , Sean Young , "linux-kernel@vger.kernel.org" , Jonas Karlman Subject: [PATCH 2/3] [media] rc/keymaps: add keytable for ODROID IR Remote Controller Thread-Topic: [PATCH 2/3] [media] rc/keymaps: add keytable for ODROID IR Remote Controller Thread-Index: AQHUx9U9/i+QwFIu3kuz3MVaVQ5Qnw== Date: Mon, 18 Feb 2019 21:59:36 +0000 Message-ID: References: <20190218215915.2782-1-jonas@kwiboo.se> In-Reply-To: <20190218215915.2782-1-jonas@kwiboo.se> Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P189CA0034.EURP189.PROD.OUTLOOK.COM (2603:10a6:206:15::47) To AM3PR03MB0966.eurprd03.prod.outlook.com (2a01:111:e400:884c::23) x-incomingtopheadermarker: OriginalChecksum:357AD7A698A4CF7AD55A955019C2F2872048713ED7907486DAE5926129FBD6FD;UpperCasedChecksum:4BCAA5337DFD86A57D4DA9F8EF0C2D8A1F13FF45E156BE0F55E3784ED3B4D29B;SizeAsReceived:8538;Count:64 x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-tmn: [eswB4rJC+sV6BCswO3NIOK0pEXQtLG2W] x-microsoft-original-message-id: <20190218215915.2782-3-jonas@kwiboo.se> x-ms-publictraffictype: Email x-incomingheadercount: 64 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322404)(2017031323274)(2017031324274)(1601125500)(1603101475)(1701031045);SRVR:VE1EUR02HT048; x-ms-traffictypediagnostic: VE1EUR02HT048: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(4566010)(82015058);SRVR:VE1EUR02HT048;BCL:0;PCL:0;RULEID:;SRVR:VE1EUR02HT048; x-microsoft-antispam-message-info: vvpHI8mw6wH/MamuoAYyc5AyByAZvox4nEFXaoVUfaK6x8uYREJT2pbe9Mif1yQO MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 54485d23-c432-40fe-8436-6091d627118c X-MS-Exchange-CrossTenant-Network-Message-Id: c252d290-2f34-46b2-d5e4-08d695ec5f5f X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 54485d23-c432-40fe-8436-6091d627118c X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2019 21:59:36.2749 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT048 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 This RC map is based on remote key schema at [1] [1] https://wiki.odroid.com/accessory/connectivity/ir_remote_controller Signed-off-by: Jonas Karlman --- drivers/media/rc/keymaps/Makefile | 1 + drivers/media/rc/keymaps/rc-odroid.c | 46 ++++++++++++++++++++++++++++ include/media/rc-map.h | 1 + 3 files changed, 48 insertions(+) create mode 100644 drivers/media/rc/keymaps/rc-odroid.c diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index 0ea52f65bb03..591a6ab25895 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile @@ -75,6 +75,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-nec-terratec-cinergy-xs.o \ rc-norwood.o \ rc-npgtech.o \ + rc-odroid.o \ rc-pctv-sedna.o \ rc-pine64.o \ rc-pinnacle-color.o \ diff --git a/drivers/media/rc/keymaps/rc-odroid.c b/drivers/media/rc/keymaps/rc-odroid.c new file mode 100644 index 000000000000..2eb4b6f7f403 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-odroid.c @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Keytable for ODROID IR Remote Controller +// Copyright (c) 2017 Jonas Karlman + +#include +#include + +static struct rc_map_table odroid[] = { + { 0xb280, KEY_VOLUMEUP }, + { 0xb281, KEY_VOLUMEDOWN }, + { 0xb282, KEY_HOME }, + { 0xb288, KEY_MUTE }, + { 0xb299, KEY_LEFT }, + { 0xb29a, KEY_BACK }, + { 0xb2c1, KEY_RIGHT }, + { 0xb2c5, KEY_MENU }, + { 0xb2ca, KEY_UP }, + { 0xb2ce, KEY_OK }, + { 0xb2d2, KEY_DOWN }, + { 0xb2dc, KEY_POWER }, +}; + +static struct rc_map_list odroid_map = { + .map = { + .scan = odroid, + .size = ARRAY_SIZE(odroid), + .rc_proto = RC_PROTO_NEC, + .name = RC_MAP_ODROID, + } +}; + +static int __init init_rc_map_odroid(void) +{ + return rc_map_register(&odroid_map); +} + +static void __exit exit_rc_map_odroid(void) +{ + rc_map_unregister(&odroid_map); +} + +module_init(init_rc_map_odroid) +module_exit(exit_rc_map_odroid) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Jonas Karlman"); diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 52b554aa784d..6d2f4da07807 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h @@ -235,6 +235,7 @@ struct rc_map *rc_map_get(const char *name); #define RC_MAP_NEC_TERRATEC_CINERGY_XS "rc-nec-terratec-cinergy-xs" #define RC_MAP_NORWOOD "rc-norwood" #define RC_MAP_NPGTECH "rc-npgtech" +#define RC_MAP_ODROID "rc-odroid" #define RC_MAP_PCTV_SEDNA "rc-pctv-sedna" #define RC_MAP_PINE64 "rc-pine64" #define RC_MAP_PINNACLE_COLOR "rc-pinnacle-color" From patchwork Mon Feb 18 21:59:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 10818917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1302C6CB for ; Mon, 18 Feb 2019 21:59:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1E102B63B for ; Mon, 18 Feb 2019 21:59:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E34842B641; Mon, 18 Feb 2019 21:59:56 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 707992B63B for ; Mon, 18 Feb 2019 21:59:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731291AbfBRV7r convert rfc822-to-8bit (ORCPT ); Mon, 18 Feb 2019 16:59:47 -0500 Received: from mail-oln040092067037.outbound.protection.outlook.com ([40.92.67.37]:42336 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731180AbfBRV7l (ORCPT ); Mon, 18 Feb 2019 16:59:41 -0500 Received: from VE1EUR02FT036.eop-EUR02.prod.protection.outlook.com (10.152.12.57) by VE1EUR02HT198.eop-EUR02.prod.protection.outlook.com (10.152.13.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1580.10; Mon, 18 Feb 2019 21:59:38 +0000 Received: from AM3PR03MB0966.eurprd03.prod.outlook.com (10.152.12.51) by VE1EUR02FT036.mail.protection.outlook.com (10.152.13.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.10 via Frontend Transport; Mon, 18 Feb 2019 21:59:37 +0000 Received: from AM3PR03MB0966.eurprd03.prod.outlook.com ([fe80::8011:1f4d:3804:e5f3]) by AM3PR03MB0966.eurprd03.prod.outlook.com ([fe80::8011:1f4d:3804:e5f3%10]) with mapi id 15.20.1622.018; Mon, 18 Feb 2019 21:59:37 +0000 From: Jonas Karlman To: "linux-media@vger.kernel.org" CC: Mauro Carvalho Chehab , Sean Young , "linux-kernel@vger.kernel.org" , Jonas Karlman Subject: [PATCH 3/3] [media] rc/keymaps: add keytable for Khadas IR Remote Controller Thread-Topic: [PATCH 3/3] [media] rc/keymaps: add keytable for Khadas IR Remote Controller Thread-Index: AQHUx9U9SlIP3cAbvU2gDJwFK8tikg== Date: Mon, 18 Feb 2019 21:59:37 +0000 Message-ID: References: <20190218215915.2782-1-jonas@kwiboo.se> In-Reply-To: <20190218215915.2782-1-jonas@kwiboo.se> Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P189CA0034.EURP189.PROD.OUTLOOK.COM (2603:10a6:206:15::47) To AM3PR03MB0966.eurprd03.prod.outlook.com (2a01:111:e400:884c::23) x-incomingtopheadermarker: OriginalChecksum:667E64F9963CDDE5295112FBE3B1104E97C85E940A1C963AB07C0AA7339E397A;UpperCasedChecksum:F74164071DE9B40BB8C59177B1A33A916AF9E25FA3087CFA042F5C1C9909AF38;SizeAsReceived:8553;Count:64 x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-tmn: [NJDBw00T8u8Q5FFzspkuMsLiw4LaEGio] x-microsoft-original-message-id: <20190218215915.2782-4-jonas@kwiboo.se> x-ms-publictraffictype: Email x-incomingheadercount: 64 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(20181119070)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322404)(2017031323274)(2017031324274)(1601125500)(1603101475)(1701031045);SRVR:VE1EUR02HT198; x-ms-traffictypediagnostic: VE1EUR02HT198: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(4566010)(82015058);SRVR:VE1EUR02HT198;BCL:0;PCL:0;RULEID:;SRVR:VE1EUR02HT198; x-microsoft-antispam-message-info: NP+86YAvJnOD9qkFWJ819TCFtA4yNR0kFM+f7/dTeDuOzMvakFK1VrZBRPJr8f3T MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 54485d23-c432-40fe-8436-6091d627118c X-MS-Exchange-CrossTenant-Network-Message-Id: bd89d5a7-0e69-4e23-253c-08d695ec5fd1 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 54485d23-c432-40fe-8436-6091d627118c X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2019 21:59:37.0175 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT198 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 The mouse button key did not have an obvious target and was mapped to KEY_CONTEXT_MENU. Signed-off-by: Jonas Karlman --- drivers/media/rc/keymaps/Makefile | 1 + drivers/media/rc/keymaps/rc-khadas.c | 46 ++++++++++++++++++++++++++++ include/media/rc-map.h | 1 + 3 files changed, 48 insertions(+) create mode 100644 drivers/media/rc/keymaps/rc-khadas.c diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index 591a6ab25895..f3e9c0ccb6e9 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile @@ -58,6 +58,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-it913x-v1.o \ rc-it913x-v2.o \ rc-kaiomy.o \ + rc-khadas.o \ rc-kworld-315u.o \ rc-kworld-pc150u.o \ rc-kworld-plus-tv-analog.o \ diff --git a/drivers/media/rc/keymaps/rc-khadas.c b/drivers/media/rc/keymaps/rc-khadas.c new file mode 100644 index 000000000000..e88c66903c8c --- /dev/null +++ b/drivers/media/rc/keymaps/rc-khadas.c @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Keytable for Khadas IR Remote Controller +// Copyright (c) 2018 Jonas Karlman + +#include +#include + +static struct rc_map_table khadas[] = { + { 0x01, KEY_BACK }, + { 0x02, KEY_DOWN }, + { 0x03, KEY_UP }, + { 0x07, KEY_OK }, + { 0x0b, KEY_VOLUMEUP }, + { 0x0e, KEY_LEFT }, + { 0x13, KEY_MENU }, + { 0x14, KEY_POWER }, + { 0x1a, KEY_RIGHT }, + { 0x48, KEY_HOME }, + { 0x58, KEY_VOLUMEDOWN }, + { 0x5b, KEY_CONTEXT_MENU }, +}; + +static struct rc_map_list khadas_map = { + .map = { + .scan = khadas, + .size = ARRAY_SIZE(khadas), + .rc_proto = RC_PROTO_NEC, + .name = RC_MAP_KHADAS, + } +}; + +static int __init init_rc_map_khadas(void) +{ + return rc_map_register(&khadas_map); +} + +static void __exit exit_rc_map_khadas(void) +{ + rc_map_unregister(&khadas_map); +} + +module_init(init_rc_map_khadas) +module_exit(exit_rc_map_khadas) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Jonas Karlman"); diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 6d2f4da07807..d15585f6b1eb 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h @@ -218,6 +218,7 @@ struct rc_map *rc_map_get(const char *name); #define RC_MAP_IT913X_V1 "rc-it913x-v1" #define RC_MAP_IT913X_V2 "rc-it913x-v2" #define RC_MAP_KAIOMY "rc-kaiomy" +#define RC_MAP_KHADAS "rc-khadas" #define RC_MAP_KWORLD_315U "rc-kworld-315u" #define RC_MAP_KWORLD_PC150U "rc-kworld-pc150u" #define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog"