aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2018-03-05 08:32:14 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-03-21 11:10:14 -0400
commit572eca036d71e2bb2822dba633ebda4fd3e6c05a (patch)
treedf1a744f55d95f08b7a639c0974655dfa24d933d
parent1b450f211e009d207402ed546837ad5dbbeac276 (diff)
media: rc: add keymap for iMON RSC remote
Note that the stick on the remote is not supported yet. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/rc/keymaps/Makefile1
-rw-r--r--drivers/media/rc/keymaps/rc-imon-rsc.c81
-rw-r--r--include/media/rc-map.h1
3 files changed, 83 insertions, 0 deletions
diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index 50b319355edf..d6b913a3032d 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -53,6 +53,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
53 rc-hisi-tv-demo.o \ 53 rc-hisi-tv-demo.o \
54 rc-imon-mce.o \ 54 rc-imon-mce.o \
55 rc-imon-pad.o \ 55 rc-imon-pad.o \
56 rc-imon-rsc.o \
56 rc-iodata-bctv7e.o \ 57 rc-iodata-bctv7e.o \
57 rc-it913x-v1.o \ 58 rc-it913x-v1.o \
58 rc-it913x-v2.o \ 59 rc-it913x-v2.o \
diff --git a/drivers/media/rc/keymaps/rc-imon-rsc.c b/drivers/media/rc/keymaps/rc-imon-rsc.c
new file mode 100644
index 000000000000..83e4564aaa22
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-imon-rsc.c
@@ -0,0 +1,81 @@
1// SPDX-License-Identifier: GPL-2.0+
2//
3// Copyright (C) 2018 Sean Young <sean@mess.org>
4
5#include <media/rc-map.h>
6#include <linux/module.h>
7
8//
9// Note that this remote has a stick which its own IR protocol,
10// with 16 directions. This is not supported yet.
11//
12static struct rc_map_table imon_rsc[] = {
13 { 0x801010, KEY_EXIT },
14 { 0x80102f, KEY_POWER },
15 { 0x80104a, KEY_SCREENSAVER }, /* Screensaver */
16 { 0x801049, KEY_TIME }, /* Timer */
17 { 0x801054, KEY_NUMERIC_1 },
18 { 0x801055, KEY_NUMERIC_2 },
19 { 0x801056, KEY_NUMERIC_3 },
20 { 0x801057, KEY_NUMERIC_4 },
21 { 0x801058, KEY_NUMERIC_5 },
22 { 0x801059, KEY_NUMERIC_6 },
23 { 0x80105a, KEY_NUMERIC_7 },
24 { 0x80105b, KEY_NUMERIC_8 },
25 { 0x80105c, KEY_NUMERIC_9 },
26 { 0x801081, KEY_SCREEN }, /* Desktop */
27 { 0x80105d, KEY_NUMERIC_0 },
28 { 0x801082, KEY_MAX },
29 { 0x801048, KEY_ESC },
30 { 0x80104b, KEY_MEDIA }, /* Windows key */
31 { 0x801083, KEY_MENU },
32 { 0x801045, KEY_APPSELECT }, /* app launcher */
33 { 0x801084, KEY_STOP },
34 { 0x801046, KEY_CYCLEWINDOWS },
35 { 0x801085, KEY_BACKSPACE },
36 { 0x801086, KEY_KEYBOARD },
37 { 0x801087, KEY_SPACE },
38 { 0x80101e, KEY_RESERVED }, /* shift tab */
39 { 0x801098, BTN_0 },
40 { 0x80101f, KEY_TAB },
41 { 0x80101b, BTN_LEFT },
42 { 0x80101d, BTN_RIGHT },
43 { 0x801016, BTN_MIDDLE }, /* drag and drop */
44 { 0x801088, KEY_MUTE },
45 { 0x80105e, KEY_VOLUMEDOWN },
46 { 0x80105f, KEY_VOLUMEUP },
47 { 0x80104c, KEY_PLAY },
48 { 0x80104d, KEY_PAUSE },
49 { 0x80104f, KEY_EJECTCD },
50 { 0x801050, KEY_PREVIOUS },
51 { 0x801051, KEY_NEXT },
52 { 0x80104e, KEY_STOP },
53 { 0x801052, KEY_REWIND },
54 { 0x801053, KEY_FASTFORWARD },
55 { 0x801089, KEY_ZOOM } /* full screen */
56};
57
58static struct rc_map_list imon_rsc_map = {
59 .map = {
60 .scan = imon_rsc,
61 .size = ARRAY_SIZE(imon_rsc),
62 .rc_proto = RC_PROTO_NEC,
63 .name = RC_MAP_IMON_RSC,
64 }
65};
66
67static int __init init_rc_map_imon_rsc(void)
68{
69 return rc_map_register(&imon_rsc_map);
70}
71
72static void __exit exit_rc_map_imon_rsc(void)
73{
74 rc_map_unregister(&imon_rsc_map);
75}
76
77module_init(init_rc_map_imon_rsc)
78module_exit(exit_rc_map_imon_rsc)
79
80MODULE_LICENSE("GPL");
81MODULE_AUTHOR("Sean Young <sean@mess.org>");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 7046734b3895..7fc84991bd12 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -211,6 +211,7 @@ struct rc_map *rc_map_get(const char *name);
211#define RC_MAP_HISI_TV_DEMO "rc-hisi-tv-demo" 211#define RC_MAP_HISI_TV_DEMO "rc-hisi-tv-demo"
212#define RC_MAP_IMON_MCE "rc-imon-mce" 212#define RC_MAP_IMON_MCE "rc-imon-mce"
213#define RC_MAP_IMON_PAD "rc-imon-pad" 213#define RC_MAP_IMON_PAD "rc-imon-pad"
214#define RC_MAP_IMON_RSC "rc-imon-rsc"
214#define RC_MAP_IODATA_BCTV7E "rc-iodata-bctv7e" 215#define RC_MAP_IODATA_BCTV7E "rc-iodata-bctv7e"
215#define RC_MAP_IT913X_V1 "rc-it913x-v1" 216#define RC_MAP_IT913X_V1 "rc-it913x-v1"
216#define RC_MAP_IT913X_V2 "rc-it913x-v2" 217#define RC_MAP_IT913X_V2 "rc-it913x-v2"