Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christian Hewitt and committed by
Mauro Carvalho Chehab
fa992b33 37307897

+95
+1
drivers/media/rc/keymaps/Makefile
··· 117 117 rc-videomate-s350.o \ 118 118 rc-videomate-tv-pvr.o \ 119 119 rc-wetek-hub.o \ 120 + rc-wetek-play2.o \ 120 121 rc-winfast.o \ 121 122 rc-winfast-usbii-deluxe.o \ 122 123 rc-su3000.o \
+93
drivers/media/rc/keymaps/rc-wetek-play2.c
··· 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");
+1
include/media/rc-map.h
··· 271 271 #define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" 272 272 #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" 273 273 #define RC_MAP_WETEK_HUB "rc-wetek-hub" 274 + #define RC_MAP_WETEK_PLAY2 "rc-wetek-play2" 274 275 #define RC_MAP_WINFAST "rc-winfast" 275 276 #define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" 276 277 #define RC_MAP_SU3000 "rc-su3000"