GNU Linux-libre 4.14.266-gnu1
[releases.git] / drivers / media / rc / keymaps / rc-geekbox.c
1 /*
2  * Keytable for the GeekBox remote controller
3  *
4  * Copyright (C) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * You should have received a copy of the GNU General Public License
11  * along with this program. If not, see <http://www.gnu.org/licenses/>.
12  */
13
14 #include <media/rc-map.h>
15 #include <linux/module.h>
16
17 static struct rc_map_table geekbox[] = {
18         { 0x01, KEY_BACK },
19         { 0x02, KEY_DOWN },
20         { 0x03, KEY_UP },
21         { 0x07, KEY_OK },
22         { 0x0b, KEY_VOLUMEUP },
23         { 0x0e, KEY_LEFT },
24         { 0x13, KEY_MENU },
25         { 0x14, KEY_POWER },
26         { 0x1a, KEY_RIGHT },
27         { 0x48, KEY_HOME },
28         { 0x58, KEY_VOLUMEDOWN },
29         { 0x5c, KEY_SCREEN },
30 };
31
32 static struct rc_map_list geekbox_map = {
33         .map = {
34                 .scan     = geekbox,
35                 .size     = ARRAY_SIZE(geekbox),
36                 .rc_proto = RC_PROTO_NEC,
37                 .name     = RC_MAP_GEEKBOX,
38         }
39 };
40
41 static int __init init_rc_map_geekbox(void)
42 {
43         return rc_map_register(&geekbox_map);
44 }
45
46 static void __exit exit_rc_map_geekbox(void)
47 {
48         rc_map_unregister(&geekbox_map);
49 }
50
51 module_init(init_rc_map_geekbox)
52 module_exit(exit_rc_map_geekbox)
53
54 MODULE_LICENSE("GPL");
55 MODULE_AUTHOR("Martin Blumenstingl <martin.blumenstingl@googlemail.com>");