1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ATI X10 RF remote keytable
5 * Copyright (C) 2011 Anssi Hannula <anssi.hannula@?ki.fi>
7 * This file is based on the static generic keytable previously found in
8 * ati_remote.c, which is
9 * Copyright (c) 2004 Torrey Hoffman <thoffman@arnor.net>
10 * Copyright (c) 2002 Vladimir Dergachev
13 #include <linux/module.h>
14 #include <media/rc-map.h>
17 * Intended usage comments below are from vendor-supplied
18 * Source: ATI REMOTE WONDERâ„¢ Installation Guide
19 * http://www2.ati.com/manuals/remctrl.pdf
21 * Scancodes were in strict left-right, top-bottom order on the
22 * original ATI Remote Wonder, but were moved on later models.
24 * Keys A-F are intended to be user-programmable.
27 static struct rc_map_table ati_x10
[] = {
28 /* keyboard - Above the cursor pad */
31 { 0x02, KEY_POWER
}, /* Power */
33 { 0x03, KEY_TV
}, /* TV */
34 { 0x04, KEY_DVD
}, /* DVD */
35 { 0x05, KEY_WWW
}, /* WEB */
36 { 0x06, KEY_BOOKMARKS
}, /* "book": Open Media Library */
37 { 0x07, KEY_EDIT
}, /* "hand": Toggle left mouse button (grab) */
39 /* Mouse emulation pad goes here, handled by driver separately */
41 { 0x09, KEY_VOLUMEDOWN
}, /* VOL + */
42 { 0x08, KEY_VOLUMEUP
}, /* VOL - */
43 { 0x0a, KEY_MUTE
}, /* MUTE */
44 { 0x0b, KEY_CHANNELUP
}, /* CH + */
45 { 0x0c, KEY_CHANNELDOWN
},/* CH - */
48 * We could use KEY_NUMERIC_x for these, but the X11 protocol
49 * has problems with keycodes greater than 255, so avoid those high
50 * keycodes in default maps.
52 { 0x0d, KEY_NUMERIC_1
},
53 { 0x0e, KEY_NUMERIC_2
},
54 { 0x0f, KEY_NUMERIC_3
},
55 { 0x10, KEY_NUMERIC_4
},
56 { 0x11, KEY_NUMERIC_5
},
57 { 0x12, KEY_NUMERIC_6
},
58 { 0x13, KEY_NUMERIC_7
},
59 { 0x14, KEY_NUMERIC_8
},
60 { 0x15, KEY_NUMERIC_9
},
61 { 0x16, KEY_MENU
}, /* "menu": DVD root menu */
62 /* KEY_NUMERIC_STAR? */
63 { 0x17, KEY_NUMERIC_0
},
64 { 0x18, KEY_SETUP
}, /* "check": DVD setup menu */
65 /* KEY_NUMERIC_POUND? */
67 /* DVD navigation buttons */
69 { 0x1a, KEY_UP
}, /* up */
72 { 0x1c, KEY_PROPS
}, /* "timer" Should be Data On Screen */
73 /* Symbol is "circle nailed to box" */
74 { 0x1d, KEY_LEFT
}, /* left */
75 { 0x1e, KEY_OK
}, /* "OK" */
76 { 0x1f, KEY_RIGHT
}, /* right */
77 { 0x20, KEY_SCREEN
}, /* "max" (X11 warning: 0x177) */
78 /* Should be AC View Toggle, but
79 that's not in <input/input.h>.
82 { 0x22, KEY_DOWN
}, /* down */
84 /* Play/stop/pause buttons */
85 { 0x24, KEY_REWIND
}, /* (<<) Rewind */
86 { 0x25, KEY_PLAY
}, /* ( >) Play (KEY_PLAYCD?) */
87 { 0x26, KEY_FASTFORWARD
}, /* (>>) Fast forward */
89 { 0x27, KEY_RECORD
}, /* ( o) red */
90 { 0x28, KEY_STOPCD
}, /* ([]) Stop (KEY_STOP is something else!) */
91 { 0x29, KEY_PAUSE
}, /* ('') Pause (KEY_PAUSECD?) */
93 /* Extra keys, not on the original ATI remote */
94 { 0x2a, KEY_NEXT
}, /* (>+) */
95 { 0x2b, KEY_PREVIOUS
}, /* (<-) */
96 { 0x2d, KEY_INFO
}, /* PLAYING (X11 warning: 0x166) */
97 { 0x2e, KEY_HOME
}, /* TOP */
98 { 0x2f, KEY_END
}, /* END */
99 { 0x30, KEY_SELECT
}, /* SELECT (X11 warning: 0x161) */
102 static struct rc_map_list ati_x10_map
= {
105 .size
= ARRAY_SIZE(ati_x10
),
106 .rc_proto
= RC_PROTO_OTHER
,
107 .name
= RC_MAP_ATI_X10
,
111 static int __init
init_rc_map_ati_x10(void)
113 return rc_map_register(&ati_x10_map
);
116 static void __exit
exit_rc_map_ati_x10(void)
118 rc_map_unregister(&ati_x10_map
);
121 module_init(init_rc_map_ati_x10
)
122 module_exit(exit_rc_map_ati_x10
)
124 MODULE_LICENSE("GPL");
125 MODULE_AUTHOR("Anssi Hannula <anssi.hannula@iki.fi>");