1 /* behold.h - Keytable for behold Remote Controller
2  *
3  * keymap imported from ir-keymaps.c
4  *
5  * Copyright (c) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  */
12 
13 #include <media/rc-map.h>
14 
15 /*
16  * Igor Kuznetsov <igk72@ya.ru>
17  * Andrey J. Melnikov <temnota@kmv.ru>
18  *
19  * Keytable is used by BeholdTV 60x series, M6 series at
20  * least, and probably other cards too.
21  * The "ascii-art picture" below (in comments, first row
22  * is the keycode in hex, and subsequent row(s) shows
23  * the button labels (several variants when appropriate)
24  * helps to descide which keycodes to assign to the buttons.
25  */
26 
27 static struct ir_scancode behold[] = {
28 
29 	/*  0x1c            0x12  *
30 	 *  TV/FM          POWER  *
31 	 *                        */
32 	{ 0x1c, KEY_TUNER },	/* XXX KEY_TV / KEY_RADIO */
33 	{ 0x12, KEY_POWER },
34 
35 	/*  0x01    0x02    0x03  *
36 	 *   1       2       3    *
37 	 *                        *
38 	 *  0x04    0x05    0x06  *
39 	 *   4       5       6    *
40 	 *                        *
41 	 *  0x07    0x08    0x09  *
42 	 *   7       8       9    *
43 	 *                        */
44 	{ 0x01, KEY_1 },
45 	{ 0x02, KEY_2 },
46 	{ 0x03, KEY_3 },
47 	{ 0x04, KEY_4 },
48 	{ 0x05, KEY_5 },
49 	{ 0x06, KEY_6 },
50 	{ 0x07, KEY_7 },
51 	{ 0x08, KEY_8 },
52 	{ 0x09, KEY_9 },
53 
54 	/*  0x0a    0x00    0x17  *
55 	 * RECALL    0      MODE  *
56 	 *                        */
57 	{ 0x0a, KEY_AGAIN },
58 	{ 0x00, KEY_0 },
59 	{ 0x17, KEY_MODE },
60 
61 	/*  0x14          0x10    *
62 	 * ASPECT      FULLSCREEN *
63 	 *                        */
64 	{ 0x14, KEY_SCREEN },
65 	{ 0x10, KEY_ZOOM },
66 
67 	/*          0x0b          *
68 	 *           Up           *
69 	 *                        *
70 	 *  0x18    0x16    0x0c  *
71 	 *  Left     Ok     Right *
72 	 *                        *
73 	 *         0x015          *
74 	 *         Down           *
75 	 *                        */
76 	{ 0x0b, KEY_CHANNELUP },
77 	{ 0x18, KEY_VOLUMEDOWN },
78 	{ 0x16, KEY_OK },		/* XXX KEY_ENTER */
79 	{ 0x0c, KEY_VOLUMEUP },
80 	{ 0x15, KEY_CHANNELDOWN },
81 
82 	/*  0x11            0x0d  *
83 	 *  MUTE            INFO  *
84 	 *                        */
85 	{ 0x11, KEY_MUTE },
86 	{ 0x0d, KEY_INFO },
87 
88 	/*  0x0f    0x1b    0x1a  *
89 	 * RECORD PLAY/PAUSE STOP *
90 	 *                        *
91 	 *  0x0e    0x1f    0x1e  *
92 	 *TELETEXT  AUDIO  SOURCE *
93 	 *           RED   YELLOW *
94 	 *                        */
95 	{ 0x0f, KEY_RECORD },
96 	{ 0x1b, KEY_PLAYPAUSE },
97 	{ 0x1a, KEY_STOP },
98 	{ 0x0e, KEY_TEXT },
99 	{ 0x1f, KEY_RED },	/*XXX KEY_AUDIO	*/
100 	{ 0x1e, KEY_YELLOW },	/*XXX KEY_SOURCE	*/
101 
102 	/*  0x1d   0x13     0x19  *
103 	 * SLEEP  PREVIEW   DVB   *
104 	 *         GREEN    BLUE  *
105 	 *                        */
106 	{ 0x1d, KEY_SLEEP },
107 	{ 0x13, KEY_GREEN },
108 	{ 0x19, KEY_BLUE },	/* XXX KEY_SAT	*/
109 
110 	/*  0x58           0x5c   *
111 	 * FREEZE        SNAPSHOT *
112 	 *                        */
113 	{ 0x58, KEY_SLOW },
114 	{ 0x5c, KEY_CAMERA },
115 
116 };
117 
118 static struct rc_keymap behold_map = {
119 	.map = {
120 		.scan    = behold,
121 		.size    = ARRAY_SIZE(behold),
122 		.ir_type = IR_TYPE_UNKNOWN,	/* Legacy IR type */
123 		.name    = RC_MAP_BEHOLD,
124 	}
125 };
126 
127 static int __init init_rc_map_behold(void)
128 {
129 	return ir_register_map(&behold_map);
130 }
131 
132 static void __exit exit_rc_map_behold(void)
133 {
134 	ir_unregister_map(&behold_map);
135 }
136 
137 module_init(init_rc_map_behold)
138 module_exit(exit_rc_map_behold)
139 
140 MODULE_LICENSE("GPL");
141 MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
142