diff options
author | Christian Hewitt <christianshewitt@gmail.com> | 2019-08-15 10:59:16 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-08-21 17:39:54 -0400 |
commit | fa992b335aa778db112e91aac19c45e4d914a1f4 (patch) | |
tree | 74d9ba55cde74c362c575737e4b6e5b15dd6fff1 | |
parent | 373078971272e9dfcb5f80e309f148a88e36dba8 (diff) |
media: rc: add keymap for WeTeK Play 2 remote
The WeTek Play 2 Android STB ships with an unusual remote where the
main up/down/left/right/enter controls are surrounded with an outer
ring of additional keys which are listed in clockwise order.
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r-- | drivers/media/rc/keymaps/Makefile | 1 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/rc-wetek-play2.c | 93 | ||||
-rw-r--r-- | include/media/rc-map.h | 1 |
3 files changed, 95 insertions, 0 deletions
diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index 6d744aca74a2..d316a9966716 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile | |||
@@ -117,6 +117,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ | |||
117 | rc-videomate-s350.o \ | 117 | rc-videomate-s350.o \ |
118 | rc-videomate-tv-pvr.o \ | 118 | rc-videomate-tv-pvr.o \ |
119 | rc-wetek-hub.o \ | 119 | rc-wetek-hub.o \ |
120 | rc-wetek-play2.o \ | ||
120 | rc-winfast.o \ | 121 | rc-winfast.o \ |
121 | rc-winfast-usbii-deluxe.o \ | 122 | rc-winfast-usbii-deluxe.o \ |
122 | rc-su3000.o \ | 123 | rc-su3000.o \ |
diff --git a/drivers/media/rc/keymaps/rc-wetek-play2.c b/drivers/media/rc/keymaps/rc-wetek-play2.c new file mode 100644 index 000000000000..bbbb11fa3c11 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-wetek-play2.c | |||
@@ -0,0 +1,93 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
2 | // | ||
3 | // Copyright (C) 2019 Christian Hewitt <christianshewitt@gmail.com> | ||
4 | |||
5 | #include <media/rc-map.h> | ||
6 | #include <linux/module.h> | ||
7 | |||
8 | // | ||
9 | // Keytable for the WeTek Play 2 STB remote control | ||
10 | // | ||
11 | |||
12 | static struct rc_map_table wetek_play2[] = { | ||
13 | { 0x5e5f02, KEY_POWER }, | ||
14 | { 0x5e5f46, KEY_SLEEP }, // tv | ||
15 | { 0x5e5f10, KEY_MUTE }, | ||
16 | |||
17 | { 0x5e5f22, KEY_1 }, | ||
18 | { 0x5e5f23, KEY_2 }, | ||
19 | { 0x5e5f24, KEY_3 }, | ||
20 | |||
21 | { 0x5e5f25, KEY_4 }, | ||
22 | { 0x5e5f26, KEY_5 }, | ||
23 | { 0x5e5f27, KEY_6 }, | ||
24 | |||
25 | { 0x5e5f28, KEY_7 }, | ||
26 | { 0x5e5f29, KEY_8 }, | ||
27 | { 0x5e5f30, KEY_9 }, | ||
28 | |||
29 | { 0x5e5f71, KEY_BACK }, | ||
30 | { 0x5e5f21, KEY_0 }, | ||
31 | { 0x5e5f72, KEY_CAPSLOCK }, | ||
32 | |||
33 | // outer ring clockwide from top | ||
34 | { 0x5e5f03, KEY_HOME }, | ||
35 | { 0x5e5f61, KEY_BACK }, | ||
36 | { 0x5e5f77, KEY_CONFIG }, // mouse | ||
37 | { 0x5e5f83, KEY_EPG }, | ||
38 | { 0x5e5f84, KEY_SCREEN }, // square | ||
39 | { 0x5e5f48, KEY_MENU }, | ||
40 | |||
41 | // inner ring | ||
42 | { 0x5e5f50, KEY_UP }, | ||
43 | { 0x5e5f4b, KEY_DOWN }, | ||
44 | { 0x5e5f4c, KEY_LEFT }, | ||
45 | { 0x5e5f4d, KEY_RIGHT }, | ||
46 | { 0x5e5f47, KEY_OK }, | ||
47 | |||
48 | { 0x5e5f44, KEY_VOLUMEUP }, | ||
49 | { 0x5e5f43, KEY_VOLUMEDOWN }, | ||
50 | { 0x5e5f4f, KEY_FAVORITES }, | ||
51 | { 0x5e5f82, KEY_SUBTITLE }, // txt | ||
52 | { 0x5e5f41, KEY_PAGEUP }, | ||
53 | { 0x5e5f42, KEY_PAGEDOWN }, | ||
54 | |||
55 | { 0x5e5f73, KEY_RED }, | ||
56 | { 0x5e5f74, KEY_GREEN }, | ||
57 | { 0x5e5f75, KEY_YELLOW }, | ||
58 | { 0x5e5f76, KEY_BLUE }, | ||
59 | |||
60 | { 0x5e5f67, KEY_PREVIOUSSONG }, | ||
61 | { 0x5e5f79, KEY_REWIND }, | ||
62 | { 0x5e5f80, KEY_FASTFORWARD }, | ||
63 | { 0x5e5f81, KEY_NEXTSONG }, | ||
64 | |||
65 | { 0x5e5f04, KEY_RECORD }, | ||
66 | { 0x5e5f2c, KEY_PLAYPAUSE }, | ||
67 | { 0x5e5f2b, KEY_STOP }, | ||
68 | }; | ||
69 | |||
70 | static struct rc_map_list wetek_play2_map = { | ||
71 | .map = { | ||
72 | .scan = wetek_play2, | ||
73 | .size = ARRAY_SIZE(wetek_play2), | ||
74 | .rc_proto = RC_PROTO_NECX, | ||
75 | .name = RC_MAP_WETEK_PLAY2, | ||
76 | } | ||
77 | }; | ||
78 | |||
79 | static int __init init_rc_map_wetek_play2(void) | ||
80 | { | ||
81 | return rc_map_register(&wetek_play2_map); | ||
82 | } | ||
83 | |||
84 | static void __exit exit_rc_map_wetek_play2(void) | ||
85 | { | ||
86 | rc_map_unregister(&wetek_play2_map); | ||
87 | } | ||
88 | |||
89 | module_init(init_rc_map_wetek_play2) | ||
90 | module_exit(exit_rc_map_wetek_play2) | ||
91 | |||
92 | MODULE_LICENSE("GPL"); | ||
93 | MODULE_AUTHOR("Christian Hewitt <christianshewitt@gmail.com"); | ||
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 032e989418ac..9eab8f5088dc 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
@@ -271,6 +271,7 @@ struct rc_map *rc_map_get(const char *name); | |||
271 | #define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" | 271 | #define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" |
272 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" | 272 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" |
273 | #define RC_MAP_WETEK_HUB "rc-wetek-hub" | 273 | #define RC_MAP_WETEK_HUB "rc-wetek-hub" |
274 | #define RC_MAP_WETEK_PLAY2 "rc-wetek-play2" | ||
274 | #define RC_MAP_WINFAST "rc-winfast" | 275 | #define RC_MAP_WINFAST "rc-winfast" |
275 | #define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" | 276 | #define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" |
276 | #define RC_MAP_SU3000 "rc-su3000" | 277 | #define RC_MAP_SU3000 "rc-su3000" |