All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] media: rc: add keymap for pine64 remote
@ 2020-11-27  3:05 Christian Hewitt
  2020-11-27  4:31   ` kernel test robot
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Hewitt @ 2020-11-27  3:05 UTC (permalink / raw)
  To: Sean Young, Mauro Carvalho Chehab, linux-kernel, linux-media
  Cc: Christian Hewitt, Jonas Karlman

From: Jonas Karlman <jonas@kwiboo.se>

Add a keymap for the pine64 IR remote [0]. The mouse key has been mapped to
KEY_EPG to provide a more useful remote.

[0] http://files.pine64.org/doc/Pine%20A64%20Schematic/remote-wit-logo.jpg

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
Changes since v1 [1]:
- reorder code to match the physical layout
- assign KEY_EPG instead of KEY_CONTEXT_MENU

KEY_CONTEXT_MENU duplicates KEY_MENU, and while Seans suggestion of BTN_LEFT
visually matches the key, this duplicates KEY_OK in most GUI's designed for
remote naviagation, e.g. Kodi and Plex. I've chosen to map KEY_EPG as this
is a common tweak in user forums to extend IR remote functionality.

[1] https://patchwork.kernel.org/project/linux-media/patch/AM3PR03MB09661A45FEB90FFC3CB44508AC630@AM3PR03MB0966.eurprd03.prod.outlook.com/

 .../devicetree/bindings/media/rc.yaml         |  1 +
 drivers/media/rc/keymaps/Makefile             |  1 +
 drivers/media/rc/keymaps/rc-pine64.c          | 65 +++++++++++++++++++
 3 files changed, 67 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-pine64.c

diff --git a/Documentation/devicetree/bindings/media/rc.yaml b/Documentation/devicetree/bindings/media/rc.yaml
index 03cf40f91d6c..946441b4e1a5 100644
--- a/Documentation/devicetree/bindings/media/rc.yaml
+++ b/Documentation/devicetree/bindings/media/rc.yaml
@@ -103,6 +103,7 @@ properties:
       - rc-npgtech
       - rc-odroid
       - rc-pctv-sedna
+      - rc-pine64
       - rc-pinnacle-color
       - rc-pinnacle-grey
       - rc-pinnacle-pctv-hd
diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index 1c4d6bec0ae4..b252a1d2ebd6 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -80,6 +80,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
 			rc-npgtech.o \
 			rc-odroid.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..9b2bdbbce04e
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-pine64.c
@@ -0,0 +1,65 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+// Keytable for the Pine64 IR Remote Controller
+// Copyright (c) 2017 Jonas Karlman
+
+#include <media/rc-map.h>
+#include <linux/module.h>
+
+static struct rc_map_table pine64[] = {
+	{ 0x40404d, KEY_POWER },
+	{ 0x40401f, KEY_WWW },
+	{ 0x40400a, KEY_MUTE },
+
+	{ 0x404017, KEY_VOLUMEDOWN },
+	{ 0x404018, KEY_VOLUMEUP },
+
+	{ 0x404010, KEY_LEFT },
+	{ 0x404011, KEY_RIGHT },
+	{ 0x40400b, KEY_UP },
+	{ 0x40400e, KEY_DOWN },
+	{ 0x40400d, KEY_OK },
+
+	{ 0x40401d, KEY_MENU },
+	{ 0x40401a, KEY_HOME },
+
+	{ 0x404045, KEY_BACK },
+
+	{ 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 },
+	{ 0x40400c, KEY_BACKSPACE },
+	{ 0x404000, KEY_NUMERIC_0 },
+	{ 0x404047, KEY_EPG }, // mouse
+};
+
+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");
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] media: rc: add keymap for pine64 remote
  2020-11-27  3:05 [PATCH v2] media: rc: add keymap for pine64 remote Christian Hewitt
@ 2020-11-27  4:31   ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-11-27  4:31 UTC (permalink / raw)
  To: Christian Hewitt, Sean Young, Mauro Carvalho Chehab, linux-kernel
  Cc: kbuild-all, linux-media, Christian Hewitt, Jonas Karlman

[-- Attachment #1: Type: text/plain, Size: 2070 bytes --]

Hi Christian,

I love your patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v5.10-rc5 next-20201126]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Christian-Hewitt/media-rc-add-keymap-for-pine64-remote/20201127-110954
base:   git://linuxtv.org/media_tree.git master
config: mips-randconfig-r005-20201127 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/f91c9e789bb50680477d0af197fc4d3ccb806c3d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Christian-Hewitt/media-rc-add-keymap-for-pine64-remote/20201127-110954
        git checkout f91c9e789bb50680477d0af197fc4d3ccb806c3d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/media/rc/keymaps/rc-pine64.c:47:15: error: 'RC_MAP_PINE64' undeclared here (not in a function); did you mean 'RC_MAP_CINERGY'?
      47 |   .name     = RC_MAP_PINE64,
         |               ^~~~~~~~~~~~~
         |               RC_MAP_CINERGY

vim +47 drivers/media/rc/keymaps/rc-pine64.c

    41	
    42	static struct rc_map_list pine64_map = {
    43		.map = {
    44			.scan     = pine64,
    45			.size     = ARRAY_SIZE(pine64),
    46			.rc_proto = RC_PROTO_NECX,
  > 47			.name     = RC_MAP_PINE64,
    48		}
    49	};
    50	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 22014 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] media: rc: add keymap for pine64 remote
@ 2020-11-27  4:31   ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-11-27  4:31 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2122 bytes --]

Hi Christian,

I love your patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v5.10-rc5 next-20201126]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Christian-Hewitt/media-rc-add-keymap-for-pine64-remote/20201127-110954
base:   git://linuxtv.org/media_tree.git master
config: mips-randconfig-r005-20201127 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/f91c9e789bb50680477d0af197fc4d3ccb806c3d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Christian-Hewitt/media-rc-add-keymap-for-pine64-remote/20201127-110954
        git checkout f91c9e789bb50680477d0af197fc4d3ccb806c3d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/media/rc/keymaps/rc-pine64.c:47:15: error: 'RC_MAP_PINE64' undeclared here (not in a function); did you mean 'RC_MAP_CINERGY'?
      47 |   .name     = RC_MAP_PINE64,
         |               ^~~~~~~~~~~~~
         |               RC_MAP_CINERGY

vim +47 drivers/media/rc/keymaps/rc-pine64.c

    41	
    42	static struct rc_map_list pine64_map = {
    43		.map = {
    44			.scan     = pine64,
    45			.size     = ARRAY_SIZE(pine64),
    46			.rc_proto = RC_PROTO_NECX,
  > 47			.name     = RC_MAP_PINE64,
    48		}
    49	};
    50	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 22014 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-27  4:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27  3:05 [PATCH v2] media: rc: add keymap for pine64 remote Christian Hewitt
2020-11-27  4:31 ` kernel test robot
2020-11-27  4:31   ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.