xref: /linux/drivers/media/rc/keymaps/rc-dreambox.c (revision a23e1966932464e1c5226cb9ac4ce1d5fc10ba22)
1a17b738cSEmanuel Strobel // SPDX-License-Identifier: GPL-2.0+
2a17b738cSEmanuel Strobel /*
3a17b738cSEmanuel Strobel  * Copyright (c) 2021 Emanuel Strobel <emanuel.strobel@yahoo.com>
4a17b738cSEmanuel Strobel  */
5a17b738cSEmanuel Strobel 
6a17b738cSEmanuel Strobel #include <media/rc-map.h>
7a17b738cSEmanuel Strobel #include <linux/module.h>
8a17b738cSEmanuel Strobel 
9a17b738cSEmanuel Strobel /*
10a17b738cSEmanuel Strobel  * Keytable for Dreambox RC10/RC0 and RC20/RC-BT remote controls
11a17b738cSEmanuel Strobel  *
12a17b738cSEmanuel Strobel  * Keys that are not IR addressable:
13a17b738cSEmanuel Strobel  *
14a17b738cSEmanuel Strobel  * // DREAM switches to STB control mode
15a17b738cSEmanuel Strobel  * // TV switches to TV control mode
16a17b738cSEmanuel Strobel  * // MODE toggles STB/TV/BT control modes
17a17b738cSEmanuel Strobel  *
18a17b738cSEmanuel Strobel  */
19a17b738cSEmanuel Strobel 
20a17b738cSEmanuel Strobel static struct rc_map_table dreambox[] = {
21a17b738cSEmanuel Strobel 	/* Dreambox RC10/RC0/RCU-BT remote */
22a17b738cSEmanuel Strobel 	{ 0x3200, KEY_POWER },
23a17b738cSEmanuel Strobel 
24a17b738cSEmanuel Strobel 	// DREAM
25a17b738cSEmanuel Strobel 	{ 0x3290, KEY_HELP },
26a17b738cSEmanuel Strobel 	// TV
27a17b738cSEmanuel Strobel 
28a17b738cSEmanuel Strobel 	{ 0x3201, KEY_1 },
29a17b738cSEmanuel Strobel 	{ 0x3202, KEY_2 },
30a17b738cSEmanuel Strobel 	{ 0x3203, KEY_3 },
31a17b738cSEmanuel Strobel 	{ 0x3204, KEY_4 },
32a17b738cSEmanuel Strobel 	{ 0x3205, KEY_5 },
33a17b738cSEmanuel Strobel 	{ 0x3206, KEY_6 },
34a17b738cSEmanuel Strobel 	{ 0x3207, KEY_7 },
35a17b738cSEmanuel Strobel 	{ 0x3208, KEY_8 },
36a17b738cSEmanuel Strobel 	{ 0x3209, KEY_9 },
37a17b738cSEmanuel Strobel 	{ 0x320a, KEY_PREVIOUS },
38a17b738cSEmanuel Strobel 	{ 0x320b, KEY_0 },
39a17b738cSEmanuel Strobel 	{ 0x320c, KEY_NEXT },
40a17b738cSEmanuel Strobel 
41a17b738cSEmanuel Strobel 	{ 0x321f, KEY_RED },
42a17b738cSEmanuel Strobel 	{ 0x3220, KEY_GREEN },
43a17b738cSEmanuel Strobel 	{ 0x3221, KEY_YELLOW },
44a17b738cSEmanuel Strobel 	{ 0x3222, KEY_BLUE },
45a17b738cSEmanuel Strobel 
46a17b738cSEmanuel Strobel 	{ 0x3210, KEY_INFO },
47a17b738cSEmanuel Strobel 	{ 0x3212, KEY_MENU },
48a17b738cSEmanuel Strobel 	{ 0x320e, KEY_AUDIO },
49a17b738cSEmanuel Strobel 	{ 0x3218, KEY_PVR },
50a17b738cSEmanuel Strobel 
51a17b738cSEmanuel Strobel 	{ 0x3213, KEY_LEFT },
52a17b738cSEmanuel Strobel 	{ 0x3211, KEY_UP },
53a17b738cSEmanuel Strobel 	{ 0x3215, KEY_RIGHT },
54a17b738cSEmanuel Strobel 	{ 0x3217, KEY_DOWN },
55a17b738cSEmanuel Strobel 	{ 0x3214, KEY_OK },
56a17b738cSEmanuel Strobel 
57a17b738cSEmanuel Strobel 	{ 0x3219, KEY_VOLUMEUP },
58a17b738cSEmanuel Strobel 	{ 0x321c, KEY_VOLUMEDOWN },
59a17b738cSEmanuel Strobel 
60a17b738cSEmanuel Strobel 	{ 0x321d, KEY_ESC }, // EXIT
61a17b738cSEmanuel Strobel 	{ 0x321a, KEY_MUTE },
62a17b738cSEmanuel Strobel 
63a17b738cSEmanuel Strobel 	{ 0x321b, KEY_PAGEUP },
64a17b738cSEmanuel Strobel 	{ 0x321e, KEY_PAGEDOWN },
65a17b738cSEmanuel Strobel 
66a17b738cSEmanuel Strobel 	{ 0x3223, KEY_PREVIOUSSONG },
67a17b738cSEmanuel Strobel 	{ 0x3224, KEY_PLAYPAUSE },
68a17b738cSEmanuel Strobel 	{ 0x3225, KEY_STOP },
69a17b738cSEmanuel Strobel 	{ 0x3226, KEY_NEXTSONG },
70a17b738cSEmanuel Strobel 
71a17b738cSEmanuel Strobel 	{ 0x3227, KEY_TV },
72a17b738cSEmanuel Strobel 	{ 0x3228, KEY_RADIO },
73a17b738cSEmanuel Strobel 	{ 0x3229, KEY_TEXT },
74a17b738cSEmanuel Strobel 	{ 0x322a, KEY_RECORD },
75a17b738cSEmanuel Strobel 
76a17b738cSEmanuel Strobel 	/* Dreambox RC20/RC-BT */
77a17b738cSEmanuel Strobel 	{ 0x3407, KEY_MUTE },
78a17b738cSEmanuel Strobel 	// MODE
79a17b738cSEmanuel Strobel 	{ 0x3401, KEY_POWER },
80a17b738cSEmanuel Strobel 
81a17b738cSEmanuel Strobel 	{ 0x3432, KEY_PREVIOUSSONG },
82a17b738cSEmanuel Strobel 	{ 0x3433, KEY_PLAYPAUSE },
83a17b738cSEmanuel Strobel 	{ 0x3435, KEY_NEXTSONG },
84a17b738cSEmanuel Strobel 
85a17b738cSEmanuel Strobel 	{ 0x3436, KEY_RECORD },
86a17b738cSEmanuel Strobel 	{ 0x3434, KEY_STOP },
87a17b738cSEmanuel Strobel 	{ 0x3425, KEY_TEXT },
88a17b738cSEmanuel Strobel 
89a17b738cSEmanuel Strobel 	{ 0x341f, KEY_RED },
90a17b738cSEmanuel Strobel 	{ 0x3420, KEY_GREEN },
91a17b738cSEmanuel Strobel 	{ 0x3421, KEY_YELLOW },
92a17b738cSEmanuel Strobel 	{ 0x3422, KEY_BLUE },
93a17b738cSEmanuel Strobel 
94a17b738cSEmanuel Strobel 	{ 0x341b, KEY_INFO },
95a17b738cSEmanuel Strobel 	{ 0x341c, KEY_MENU },
96a17b738cSEmanuel Strobel 	{ 0x3430, KEY_AUDIO },
97a17b738cSEmanuel Strobel 	{ 0x3431, KEY_PVR },
98a17b738cSEmanuel Strobel 
99a17b738cSEmanuel Strobel 	{ 0x3414, KEY_LEFT },
100a17b738cSEmanuel Strobel 	{ 0x3411, KEY_UP },
101a17b738cSEmanuel Strobel 	{ 0x3416, KEY_RIGHT },
102a17b738cSEmanuel Strobel 	{ 0x3419, KEY_DOWN },
103a17b738cSEmanuel Strobel 	{ 0x3415, KEY_OK },
104a17b738cSEmanuel Strobel 
105a17b738cSEmanuel Strobel 	{ 0x3413, KEY_VOLUMEUP },
106a17b738cSEmanuel Strobel 	{ 0x3418, KEY_VOLUMEDOWN },
107a17b738cSEmanuel Strobel 
108a17b738cSEmanuel Strobel 	{ 0x3412, KEY_ESC }, // EXIT
109a17b738cSEmanuel Strobel 	{ 0x3426, KEY_HELP }, // MIC
110a17b738cSEmanuel Strobel 
111a17b738cSEmanuel Strobel 	{ 0x3417, KEY_PAGEUP },
112a17b738cSEmanuel Strobel 	{ 0x341a, KEY_PAGEDOWN },
113a17b738cSEmanuel Strobel 
114a17b738cSEmanuel Strobel 	{ 0x3404, KEY_1 },
115a17b738cSEmanuel Strobel 	{ 0x3405, KEY_2 },
116a17b738cSEmanuel Strobel 	{ 0x3406, KEY_3 },
117a17b738cSEmanuel Strobel 	{ 0x3408, KEY_4 },
118a17b738cSEmanuel Strobel 	{ 0x3409, KEY_5 },
119a17b738cSEmanuel Strobel 	{ 0x340a, KEY_6 },
120a17b738cSEmanuel Strobel 	{ 0x340c, KEY_7 },
121a17b738cSEmanuel Strobel 	{ 0x340d, KEY_8 },
122a17b738cSEmanuel Strobel 	{ 0x340e, KEY_9 },
123a17b738cSEmanuel Strobel 	{ 0x340b, KEY_PREVIOUS },
124a17b738cSEmanuel Strobel 	{ 0x3410, KEY_0 },
125a17b738cSEmanuel Strobel 	{ 0x340f, KEY_NEXT },
126a17b738cSEmanuel Strobel };
127a17b738cSEmanuel Strobel 
128a17b738cSEmanuel Strobel static struct rc_map_list dreambox_map = {
129a17b738cSEmanuel Strobel 	.map = {
130a17b738cSEmanuel Strobel 		.scan     = dreambox,
131a17b738cSEmanuel Strobel 		.size     = ARRAY_SIZE(dreambox),
132a17b738cSEmanuel Strobel 		.rc_proto = RC_PROTO_NEC,
133a17b738cSEmanuel Strobel 		.name     = RC_MAP_DREAMBOX,
134a17b738cSEmanuel Strobel 	}
135a17b738cSEmanuel Strobel };
136a17b738cSEmanuel Strobel 
init_rc_map_dreambox(void)137a17b738cSEmanuel Strobel static int __init init_rc_map_dreambox(void)
138a17b738cSEmanuel Strobel {
139a17b738cSEmanuel Strobel 	return rc_map_register(&dreambox_map);
140a17b738cSEmanuel Strobel }
141a17b738cSEmanuel Strobel 
exit_rc_map_dreambox(void)142a17b738cSEmanuel Strobel static void __exit exit_rc_map_dreambox(void)
143a17b738cSEmanuel Strobel {
144a17b738cSEmanuel Strobel 	rc_map_unregister(&dreambox_map);
145a17b738cSEmanuel Strobel }
146a17b738cSEmanuel Strobel 
147a17b738cSEmanuel Strobel module_init(init_rc_map_dreambox)
148a17b738cSEmanuel Strobel module_exit(exit_rc_map_dreambox)
149a17b738cSEmanuel Strobel 
150a17b738cSEmanuel Strobel MODULE_LICENSE("GPL");
151a17b738cSEmanuel Strobel MODULE_AUTHOR("Emanuel Strobel <emanuel.strobel@yahoo.com>");
152462e108bSHans Verkuil MODULE_DESCRIPTION("Dreambox RC10/RC0 and RC20/RC-BT remote controller keytable");
153