GNU Linux-libre 6.8.7-gnu
[releases.git] / 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");
94 MODULE_DESCRIPTION("WeTek Play 2 STB remote controller keytable");