1c34516e5SAnssi Hannula /* 2c34516e5SAnssi Hannula * ATI X10 RF remote keytable 3c34516e5SAnssi Hannula * 4c34516e5SAnssi Hannula * Copyright (C) 2011 Anssi Hannula <anssi.hannula@?ki.fi> 5c34516e5SAnssi Hannula * 6c34516e5SAnssi Hannula * This file is based on the static generic keytable previously found in 7c34516e5SAnssi Hannula * ati_remote.c, which is 8c34516e5SAnssi Hannula * Copyright (c) 2004 Torrey Hoffman <thoffman@arnor.net> 9c34516e5SAnssi Hannula * Copyright (c) 2002 Vladimir Dergachev 10c34516e5SAnssi Hannula * 11c34516e5SAnssi Hannula * This program is free software; you can redistribute it and/or modify 12c34516e5SAnssi Hannula * it under the terms of the GNU General Public License as published by 13c34516e5SAnssi Hannula * the Free Software Foundation; either version 2 of the License, or 14c34516e5SAnssi Hannula * (at your option) any later version. 15c34516e5SAnssi Hannula * 16c34516e5SAnssi Hannula * This program is distributed in the hope that it will be useful, 17c34516e5SAnssi Hannula * but WITHOUT ANY WARRANTY; without even the implied warranty of 18c34516e5SAnssi Hannula * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19c34516e5SAnssi Hannula * GNU General Public License for more details. 20c34516e5SAnssi Hannula * 21c34516e5SAnssi Hannula * You should have received a copy of the GNU General Public License along 22c34516e5SAnssi Hannula * with this program; if not, write to the Free Software Foundation, Inc., 23c34516e5SAnssi Hannula * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24c34516e5SAnssi Hannula */ 25c34516e5SAnssi Hannula 26547d42eaSMauro Carvalho Chehab #include <linux/module.h> 27c34516e5SAnssi Hannula #include <media/rc-map.h> 28c34516e5SAnssi Hannula 29220edfb0SGeorge Spelvin /* 30220edfb0SGeorge Spelvin * Intended usage comments below are from vendor-supplied 31220edfb0SGeorge Spelvin * Source: ATI REMOTE WONDER™ Installation Guide 32220edfb0SGeorge Spelvin * http://www2.ati.com/manuals/remctrl.pdf 33220edfb0SGeorge Spelvin * 34220edfb0SGeorge Spelvin * Scancodes were in strict left-right, top-bottom order on the 35220edfb0SGeorge Spelvin * original ATI Remote Wonder, but were moved on later models. 36220edfb0SGeorge Spelvin * 37220edfb0SGeorge Spelvin * Keys A-F are intended to be user-programmable. 38220edfb0SGeorge Spelvin */ 39220edfb0SGeorge Spelvin 40c34516e5SAnssi Hannula static struct rc_map_table ati_x10[] = { 41d701c831SGeorge Spelvin /* keyboard - Above the cursor pad */ 42d701c831SGeorge Spelvin { 0x00, KEY_A }, 43d701c831SGeorge Spelvin { 0x01, KEY_B }, 44d701c831SGeorge Spelvin { 0x02, KEY_POWER }, /* Power */ 45d701c831SGeorge Spelvin 46d701c831SGeorge Spelvin { 0x03, KEY_TV }, /* TV */ 47d701c831SGeorge Spelvin { 0x04, KEY_DVD }, /* DVD */ 48d701c831SGeorge Spelvin { 0x05, KEY_WWW }, /* WEB */ 49220edfb0SGeorge Spelvin { 0x06, KEY_BOOKMARKS }, /* "book": Open Media Library */ 50220edfb0SGeorge Spelvin { 0x07, KEY_EDIT }, /* "hand": Toggle left mouse button (grab) */ 51220edfb0SGeorge Spelvin 52220edfb0SGeorge Spelvin /* Mouse emulation pad goes here, handled by driver separately */ 53220edfb0SGeorge Spelvin 54d701c831SGeorge Spelvin { 0x09, KEY_VOLUMEDOWN }, /* VOL + */ 55d701c831SGeorge Spelvin { 0x08, KEY_VOLUMEUP }, /* VOL - */ 56d701c831SGeorge Spelvin { 0x0a, KEY_MUTE }, /* MUTE */ 57d701c831SGeorge Spelvin { 0x0b, KEY_CHANNELUP }, /* CH + */ 58d701c831SGeorge Spelvin { 0x0c, KEY_CHANNELDOWN },/* CH - */ 59d701c831SGeorge Spelvin 60356237d6SGeorge Spelvin /* 61356237d6SGeorge Spelvin * We could use KEY_NUMERIC_x for these, but the X11 protocol 62356237d6SGeorge Spelvin * has problems with keycodes greater than 255, so avoid those high 63356237d6SGeorge Spelvin * keycodes in default maps. 64356237d6SGeorge Spelvin */ 655eefb4f0SAnssi Hannula { 0x0d, KEY_1 }, 665eefb4f0SAnssi Hannula { 0x0e, KEY_2 }, 675eefb4f0SAnssi Hannula { 0x0f, KEY_3 }, 685eefb4f0SAnssi Hannula { 0x10, KEY_4 }, 695eefb4f0SAnssi Hannula { 0x11, KEY_5 }, 705eefb4f0SAnssi Hannula { 0x12, KEY_6 }, 715eefb4f0SAnssi Hannula { 0x13, KEY_7 }, 725eefb4f0SAnssi Hannula { 0x14, KEY_8 }, 735eefb4f0SAnssi Hannula { 0x15, KEY_9 }, 74220edfb0SGeorge Spelvin { 0x16, KEY_MENU }, /* "menu": DVD root menu */ 75356237d6SGeorge Spelvin /* KEY_NUMERIC_STAR? */ 76d701c831SGeorge Spelvin { 0x17, KEY_0 }, 77356237d6SGeorge Spelvin { 0x18, KEY_SETUP }, /* "check": DVD setup menu */ 78356237d6SGeorge Spelvin /* KEY_NUMERIC_POUND? */ 79d701c831SGeorge Spelvin 80d701c831SGeorge Spelvin /* DVD navigation buttons */ 81d701c831SGeorge Spelvin { 0x19, KEY_C }, 825eefb4f0SAnssi Hannula { 0x1a, KEY_UP }, /* up */ 83d701c831SGeorge Spelvin { 0x1b, KEY_D }, 84d701c831SGeorge Spelvin 85356237d6SGeorge Spelvin { 0x1c, KEY_PROPS }, /* "timer" Should be Data On Screen */ 86356237d6SGeorge Spelvin /* Symbol is "circle nailed to box" */ 87d701c831SGeorge Spelvin { 0x1d, KEY_LEFT }, /* left */ 885eefb4f0SAnssi Hannula { 0x1e, KEY_OK }, /* "OK" */ 89d701c831SGeorge Spelvin { 0x1f, KEY_RIGHT }, /* right */ 90356237d6SGeorge Spelvin { 0x20, KEY_SCREEN }, /* "max" (X11 warning: 0x177) */ 91356237d6SGeorge Spelvin /* Should be AC View Toggle, but 92356237d6SGeorge Spelvin that's not in <input/input.h>. 93356237d6SGeorge Spelvin KEY_ZOOM (0x174)? */ 94d701c831SGeorge Spelvin { 0x21, KEY_E }, 95d701c831SGeorge Spelvin { 0x22, KEY_DOWN }, /* down */ 96d701c831SGeorge Spelvin { 0x23, KEY_F }, 97d701c831SGeorge Spelvin /* Play/stop/pause buttons */ 98220edfb0SGeorge Spelvin { 0x24, KEY_REWIND }, /* (<<) Rewind */ 99356237d6SGeorge Spelvin { 0x25, KEY_PLAY }, /* ( >) Play (KEY_PLAYCD?) */ 100356237d6SGeorge Spelvin { 0x26, KEY_FASTFORWARD }, /* (>>) Fast forward */ 101d701c831SGeorge Spelvin 102d701c831SGeorge Spelvin { 0x27, KEY_RECORD }, /* ( o) red */ 103356237d6SGeorge Spelvin { 0x28, KEY_STOPCD }, /* ([]) Stop (KEY_STOP is something else!) */ 104356237d6SGeorge Spelvin { 0x29, KEY_PAUSE }, /* ('') Pause (KEY_PAUSECD?) */ 105d701c831SGeorge Spelvin 106d701c831SGeorge Spelvin /* Extra keys, not on the original ATI remote */ 1075eefb4f0SAnssi Hannula { 0x2a, KEY_NEXT }, /* (>+) */ 108d701c831SGeorge Spelvin { 0x2b, KEY_PREVIOUS }, /* (<-) */ 109356237d6SGeorge Spelvin { 0x2d, KEY_INFO }, /* PLAYING (X11 warning: 0x166) */ 1105eefb4f0SAnssi Hannula { 0x2e, KEY_HOME }, /* TOP */ 1115eefb4f0SAnssi Hannula { 0x2f, KEY_END }, /* END */ 112356237d6SGeorge Spelvin { 0x30, KEY_SELECT }, /* SELECT (X11 warning: 0x161) */ 113c34516e5SAnssi Hannula }; 114c34516e5SAnssi Hannula 115c34516e5SAnssi Hannula static struct rc_map_list ati_x10_map = { 116c34516e5SAnssi Hannula .map = { 117c34516e5SAnssi Hannula .scan = ati_x10, 118c34516e5SAnssi Hannula .size = ARRAY_SIZE(ati_x10), 1196d741bfeSSean Young .rc_proto = RC_PROTO_OTHER, 120c34516e5SAnssi Hannula .name = RC_MAP_ATI_X10, 121c34516e5SAnssi Hannula } 122c34516e5SAnssi Hannula }; 123c34516e5SAnssi Hannula 124c34516e5SAnssi Hannula static int __init init_rc_map_ati_x10(void) 125c34516e5SAnssi Hannula { 126c34516e5SAnssi Hannula return rc_map_register(&ati_x10_map); 127c34516e5SAnssi Hannula } 128c34516e5SAnssi Hannula 129c34516e5SAnssi Hannula static void __exit exit_rc_map_ati_x10(void) 130c34516e5SAnssi Hannula { 131c34516e5SAnssi Hannula rc_map_unregister(&ati_x10_map); 132c34516e5SAnssi Hannula } 133c34516e5SAnssi Hannula 134c34516e5SAnssi Hannula module_init(init_rc_map_ati_x10) 135c34516e5SAnssi Hannula module_exit(exit_rc_map_ati_x10) 136c34516e5SAnssi Hannula 137c34516e5SAnssi Hannula MODULE_LICENSE("GPL"); 138c34516e5SAnssi Hannula MODULE_AUTHOR("Anssi Hannula <anssi.hannula@iki.fi>"); 139