xref: /linux/drivers/media/rc/keymaps/rc-xbox-dvd.c (revision 95298d63c67673c654c08952672d016212b26054)
1 // SPDX-License-Identifier: GPL-2.0+
2 // Keytable for Xbox DVD remote
3 // Copyright (c) 2018 by Benjamin Valentin <benpicco@googlemail.com>
4 
5 #include <media/rc-map.h>
6 #include <linux/module.h>
7 
8 /* based on lircd.conf.xbox */
9 static struct rc_map_table xbox_dvd[] = {
10 	{0xa0b, KEY_OK},
11 	{0xaa6, KEY_UP},
12 	{0xaa7, KEY_DOWN},
13 	{0xaa8, KEY_RIGHT},
14 	{0xaa9, KEY_LEFT},
15 	{0xac3, KEY_INFO},
16 
17 	{0xac6, KEY_NUMERIC_9},
18 	{0xac7, KEY_NUMERIC_8},
19 	{0xac8, KEY_NUMERIC_7},
20 	{0xac9, KEY_NUMERIC_6},
21 	{0xaca, KEY_NUMERIC_5},
22 	{0xacb, KEY_NUMERIC_4},
23 	{0xacc, KEY_NUMERIC_3},
24 	{0xacd, KEY_NUMERIC_2},
25 	{0xace, KEY_NUMERIC_1},
26 	{0xacf, KEY_NUMERIC_0},
27 
28 	{0xad5, KEY_ANGLE},
29 	{0xad8, KEY_BACK},
30 	{0xadd, KEY_PREVIOUSSONG},
31 	{0xadf, KEY_NEXTSONG},
32 	{0xae0, KEY_STOP},
33 	{0xae2, KEY_REWIND},
34 	{0xae3, KEY_FASTFORWARD},
35 	{0xae5, KEY_TITLE},
36 	{0xae6, KEY_PAUSE},
37 	{0xaea, KEY_PLAY},
38 	{0xaf7, KEY_MENU},
39 };
40 
41 static struct rc_map_list xbox_dvd_map = {
42 	.map = {
43 		.scan     = xbox_dvd,
44 		.size     = ARRAY_SIZE(xbox_dvd),
45 		.rc_proto = RC_PROTO_XBOX_DVD,
46 		.name     = RC_MAP_XBOX_DVD,
47 	}
48 };
49 
50 static int __init init_rc_map(void)
51 {
52 	return rc_map_register(&xbox_dvd_map);
53 }
54 
55 static void __exit exit_rc_map(void)
56 {
57 	rc_map_unregister(&xbox_dvd_map);
58 }
59 
60 module_init(init_rc_map)
61 module_exit(exit_rc_map)
62 
63 MODULE_LICENSE("GPL");
64