1 // SPDX-License-Identifier: GPL-2.0+
2 // behold.h - Keytable for behold Remote Controller
3 //
4 // keymap imported from ir-keymaps.c
5 //
6 // Copyright (c) 2010 by Mauro Carvalho Chehab
7
8 #include <media/rc-map.h>
9 #include <linux/module.h>
10
11 /*
12 * Igor Kuznetsov <igk72@ya.ru>
13 * Andrey J. Melnikov <temnota@kmv.ru>
14 *
15 * Keytable is used by BeholdTV 60x series, M6 series at
16 * least, and probably other cards too.
17 * The "ascii-art picture" below (in comments, first row
18 * is the keycode in hex, and subsequent row(s) shows
19 * the button labels (several variants when appropriate)
20 * helps to decide which keycodes to assign to the buttons.
21 */
22
23 static struct rc_map_table behold[] = {
24
25 /* 0x1c 0x12 *
26 * TV/FM POWER *
27 * */
28 { 0x866b1c, KEY_TUNER }, /* XXX KEY_TV / KEY_RADIO */
29 { 0x866b12, KEY_POWER },
30
31 /* 0x01 0x02 0x03 *
32 * 1 2 3 *
33 * *
34 * 0x04 0x05 0x06 *
35 * 4 5 6 *
36 * *
37 * 0x07 0x08 0x09 *
38 * 7 8 9 *
39 * */
40 { 0x866b01, KEY_NUMERIC_1 },
41 { 0x866b02, KEY_NUMERIC_2 },
42 { 0x866b03, KEY_NUMERIC_3 },
43 { 0x866b04, KEY_NUMERIC_4 },
44 { 0x866b05, KEY_NUMERIC_5 },
45 { 0x866b06, KEY_NUMERIC_6 },
46 { 0x866b07, KEY_NUMERIC_7 },
47 { 0x866b08, KEY_NUMERIC_8 },
48 { 0x866b09, KEY_NUMERIC_9 },
49
50 /* 0x0a 0x00 0x17 *
51 * RECALL 0 MODE *
52 * */
53 { 0x866b0a, KEY_AGAIN },
54 { 0x866b00, KEY_NUMERIC_0 },
55 { 0x866b17, KEY_MODE },
56
57 /* 0x14 0x10 *
58 * ASPECT FULLSCREEN *
59 * */
60 { 0x866b14, KEY_SCREEN },
61 { 0x866b10, KEY_ZOOM },
62
63 /* 0x0b *
64 * Up *
65 * *
66 * 0x18 0x16 0x0c *
67 * Left Ok Right *
68 * *
69 * 0x015 *
70 * Down *
71 * */
72 { 0x866b0b, KEY_CHANNELUP },
73 { 0x866b18, KEY_VOLUMEDOWN },
74 { 0x866b16, KEY_OK }, /* XXX KEY_ENTER */
75 { 0x866b0c, KEY_VOLUMEUP },
76 { 0x866b15, KEY_CHANNELDOWN },
77
78 /* 0x11 0x0d *
79 * MUTE INFO *
80 * */
81 { 0x866b11, KEY_MUTE },
82 { 0x866b0d, KEY_INFO },
83
84 /* 0x0f 0x1b 0x1a *
85 * RECORD PLAY/PAUSE STOP *
86 * *
87 * 0x0e 0x1f 0x1e *
88 *TELETEXT AUDIO SOURCE *
89 * RED YELLOW *
90 * */
91 { 0x866b0f, KEY_RECORD },
92 { 0x866b1b, KEY_PLAYPAUSE },
93 { 0x866b1a, KEY_STOP },
94 { 0x866b0e, KEY_TEXT },
95 { 0x866b1f, KEY_RED }, /*XXX KEY_AUDIO */
96 { 0x866b1e, KEY_VIDEO },
97
98 /* 0x1d 0x13 0x19 *
99 * SLEEP PREVIEW DVB *
100 * GREEN BLUE *
101 * */
102 { 0x866b1d, KEY_SLEEP },
103 { 0x866b13, KEY_GREEN },
104 { 0x866b19, KEY_BLUE }, /* XXX KEY_SAT */
105
106 /* 0x58 0x5c *
107 * FREEZE SNAPSHOT *
108 * */
109 { 0x866b58, KEY_SLOW },
110 { 0x866b5c, KEY_CAMERA },
111
112 };
113
114 static struct rc_map_list behold_map = {
115 .map = {
116 .scan = behold,
117 .size = ARRAY_SIZE(behold),
118 .rc_proto = RC_PROTO_NECX,
119 .name = RC_MAP_BEHOLD,
120 }
121 };
122
init_rc_map_behold(void)123 static int __init init_rc_map_behold(void)
124 {
125 return rc_map_register(&behold_map);
126 }
127
exit_rc_map_behold(void)128 static void __exit exit_rc_map_behold(void)
129 {
130 rc_map_unregister(&behold_map);
131 }
132
133 module_init(init_rc_map_behold)
134 module_exit(exit_rc_map_behold)
135
136 MODULE_LICENSE("GPL");
137 MODULE_AUTHOR("Mauro Carvalho Chehab");
138