From patchwork Fri Jan 13 14:22:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9515721 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 1648B601DA for ; Fri, 13 Jan 2017 14:22:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 070BF28732 for ; Fri, 13 Jan 2017 14:22:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC96A28736; Fri, 13 Jan 2017 14:22:31 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 3499328732 for ; Fri, 13 Jan 2017 14:22:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751814AbdAMOWY (ORCPT ); Fri, 13 Jan 2017 09:22:24 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36529 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751739AbdAMOWW (ORCPT ); Fri, 13 Jan 2017 09:22:22 -0500 Received: by mail-wm0-f66.google.com with SMTP id r126so12028045wmr.3 for ; Fri, 13 Jan 2017 06:22:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Stoq1WatyCmwy9Op3G31SXWDhsZoeQ2HRbaIM9JLFkY=; b=HFGOoSaFJxrPeL1Uq4fxebwDV8219WBjHpkiQRAaf4o4z+IL+PuSfJc4QivR0d2j/9 z8J7Owj+ao5P6WKYUr4QB+aRhes/dMe2Qvi1WJFPfk6tEqoVtis11XXrJKUfhUNL+OSk GooW2jbrGdaQFal6bb2WR1veUfMbUsu3U0QrZrjhZ1x/63D4lDGj+1a7k4JIA5kQ5aV2 z/7dILqu0atlgbq05vvKLxERP3b5W/VcBFRg3+/rSWsOjCI5AXrw2ZgTdX4KLTC8a112 hx2oa6s0021c0mePqGjDwf+uj/IKkS4xliO0UFJc45elazL/PMLvzQaZ1gDizL2rwXWY Q4rA== 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=Stoq1WatyCmwy9Op3G31SXWDhsZoeQ2HRbaIM9JLFkY=; b=l8de0aO+/ZGAOx4N2ua7GAcm7dUypzOQnhtEN1cux/IOl6DIYSAA0IBl9TFWgA03We Y2p4GkteO/psrNWpYyXkvR6x4cXgKwqBDvewMOlB31nJmDNSw9FzZzrzKnoxTNlstlsg PO1cAms23Pg2QadQhdMUh+VdvBzlWxhZ/7HVrx5Wsiq7CiYU42stPi+eAUeZy19IRkKQ sbxKmARorDgp5HtCRUPB6PvVWSWIfVvrICQdle2IlaCmM2eVf3ku3tVtDAvEVuEQwAGd FETSzNzmrrrRfYm8uMVdkugf+5XoUijN0+yqwQ013jUKPklkdcDMFFulMu1sCrapwDR5 IYCA== X-Gm-Message-State: AIkVDXKWgsRZN+YHAztYiBX8KH5hAsWzetj+H1ThhbHOPVH4nX3aLkpH1nDojJAjVNlUTQ== X-Received: by 10.28.91.16 with SMTP id p16mr2412873wmb.111.1484317340589; Fri, 13 Jan 2017 06:22:20 -0800 (PST) Received: from blackbox.darklights.net (p5DE3863D.dip0.t-ipconnect.de. [93.227.134.61]) by smtp.googlemail.com with ESMTPSA id y127sm4595122wmg.12.2017.01.13.06.22.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 06:22:19 -0800 (PST) From: Martin Blumenstingl To: linux-media@vger.kernel.org Cc: mchehab@kernel.org, Martin Blumenstingl Subject: [PATCH] media: rc/keymaps: add a keytable for the GeekBox remote control Date: Fri, 13 Jan 2017 15:22:12 +0100 Message-Id: <20170113142212.13317-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.11.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 The GeekBox ships with a 12 button remote control which seems to use the NEC protocol. The button keycodes were captured with the "ir-keytable" tool (ir-keytable -p $PROTOCOL -t; human_button_pusher). Signed-off-by: Martin Blumenstingl --- drivers/media/rc/keymaps/Makefile | 1 + drivers/media/rc/keymaps/rc-geekbox.c | 55 +++++++++++++++++++++++++++++++++++ include/media/rc-map.h | 1 + 3 files changed, 57 insertions(+) create mode 100644 drivers/media/rc/keymaps/rc-geekbox.c diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index d7b13fae1267..4578b3454c0b 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile @@ -41,6 +41,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-flyvideo.o \ rc-fusionhdtv-mce.o \ rc-gadmei-rm008z.o \ + rc-geekbox.o \ rc-genius-tvgo-a11mce.o \ rc-gotview7135.o \ rc-imon-mce.o \ diff --git a/drivers/media/rc/keymaps/rc-geekbox.c b/drivers/media/rc/keymaps/rc-geekbox.c new file mode 100644 index 000000000000..affc4c481888 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-geekbox.c @@ -0,0 +1,55 @@ +/* + * Keytable for the GeekBox remote controller + * + * Copyright (C) 2017 Martin Blumenstingl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include + +static struct rc_map_table geekbox[] = { + { 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 }, + { 0x5c, KEY_SCREEN }, +}; + +static struct rc_map_list geekbox_map = { + .map = { + .scan = geekbox, + .size = ARRAY_SIZE(geekbox), + .rc_type = RC_TYPE_NEC, + .name = RC_MAP_GEEKBOX, + } +}; + +static int __init init_rc_map_geekbox(void) +{ + return rc_map_register(&geekbox_map); +} + +static void __exit exit_rc_map_geekbox(void) +{ + rc_map_unregister(&geekbox_map); +} + +module_init(init_rc_map_geekbox) +module_exit(exit_rc_map_geekbox) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Martin Blumenstingl "); diff --git a/include/media/rc-map.h b/include/media/rc-map.h index e1cc14cba391..3db3b63be279 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h @@ -219,6 +219,7 @@ struct rc_map *rc_map_get(const char *name); #define RC_MAP_FLYVIDEO "rc-flyvideo" #define RC_MAP_FUSIONHDTV_MCE "rc-fusionhdtv-mce" #define RC_MAP_GADMEI_RM008Z "rc-gadmei-rm008z" +#define RC_MAP_GEEKBOX "rc-geekbox" #define RC_MAP_GENIUS_TVGO_A11MCE "rc-genius-tvgo-a11mce" #define RC_MAP_GOTVIEW7135 "rc-gotview7135" #define RC_MAP_HAUPPAUGE_NEW "rc-hauppauge"