Jarod Wilson | 1159f83 | 2010-04-16 18:28:35 -0300 | [diff] [blame] | 1 | /* rc5-imon-mce.c - Keytable for Windows Media Center RC-6 remotes for use |
| 2 | * with the SoundGraph iMON/Antec Veris hardware IR decoder |
| 3 | * |
| 4 | * Copyright (c) 2010 by Jarod Wilson <jarod@redhat.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 as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | */ |
| 11 | |
| 12 | #include <media/rc-map.h> |
Paul Gortmaker | 7a707b8 | 2011-07-03 14:03:12 -0400 | [diff] [blame] | 13 | #include <linux/module.h> |
Jarod Wilson | 1159f83 | 2010-04-16 18:28:35 -0300 | [diff] [blame] | 14 | |
| 15 | /* mce-mode imon mce remote key table */ |
Mauro Carvalho Chehab | 2f4f58d | 2010-11-17 15:46:09 -0300 | [diff] [blame] | 16 | static struct rc_map_table imon_mce[] = { |
Jarod Wilson | 1159f83 | 2010-04-16 18:28:35 -0300 | [diff] [blame] | 17 | /* keys sorted mostly by frequency of use to optimize lookups */ |
| 18 | { 0x800ff415, KEY_REWIND }, |
| 19 | { 0x800ff414, KEY_FASTFORWARD }, |
| 20 | { 0x800ff41b, KEY_PREVIOUS }, |
| 21 | { 0x800ff41a, KEY_NEXT }, |
| 22 | |
| 23 | { 0x800ff416, KEY_PLAY }, |
| 24 | { 0x800ff418, KEY_PAUSE }, |
| 25 | { 0x800ff419, KEY_STOP }, |
| 26 | { 0x800ff417, KEY_RECORD }, |
| 27 | |
| 28 | { 0x02000052, KEY_UP }, |
| 29 | { 0x02000051, KEY_DOWN }, |
| 30 | { 0x02000050, KEY_LEFT }, |
| 31 | { 0x0200004f, KEY_RIGHT }, |
| 32 | |
| 33 | { 0x800ff41e, KEY_UP }, |
| 34 | { 0x800ff41f, KEY_DOWN }, |
| 35 | { 0x800ff420, KEY_LEFT }, |
| 36 | { 0x800ff421, KEY_RIGHT }, |
| 37 | |
| 38 | /* 0x800ff40b also KEY_NUMERIC_POUND on some receivers */ |
| 39 | { 0x800ff40b, KEY_ENTER }, |
| 40 | { 0x02000028, KEY_ENTER }, |
| 41 | /* the OK and Enter buttons decode to the same value on some remotes |
| 42 | { 0x02000028, KEY_OK }, */ |
| 43 | { 0x800ff422, KEY_OK }, |
| 44 | { 0x0200002a, KEY_EXIT }, |
| 45 | { 0x800ff423, KEY_EXIT }, |
| 46 | { 0x02000029, KEY_DELETE }, |
| 47 | /* 0x800ff40a also KEY_NUMERIC_STAR on some receivers */ |
| 48 | { 0x800ff40a, KEY_DELETE }, |
| 49 | |
| 50 | { 0x800ff40e, KEY_MUTE }, |
| 51 | { 0x800ff410, KEY_VOLUMEUP }, |
| 52 | { 0x800ff411, KEY_VOLUMEDOWN }, |
| 53 | { 0x800ff412, KEY_CHANNELUP }, |
| 54 | { 0x800ff413, KEY_CHANNELDOWN }, |
| 55 | |
| 56 | { 0x0200001e, KEY_NUMERIC_1 }, |
| 57 | { 0x0200001f, KEY_NUMERIC_2 }, |
| 58 | { 0x02000020, KEY_NUMERIC_3 }, |
| 59 | { 0x02000021, KEY_NUMERIC_4 }, |
| 60 | { 0x02000022, KEY_NUMERIC_5 }, |
| 61 | { 0x02000023, KEY_NUMERIC_6 }, |
| 62 | { 0x02000024, KEY_NUMERIC_7 }, |
| 63 | { 0x02000025, KEY_NUMERIC_8 }, |
| 64 | { 0x02000026, KEY_NUMERIC_9 }, |
| 65 | { 0x02000027, KEY_NUMERIC_0 }, |
| 66 | |
| 67 | { 0x800ff401, KEY_NUMERIC_1 }, |
| 68 | { 0x800ff402, KEY_NUMERIC_2 }, |
| 69 | { 0x800ff403, KEY_NUMERIC_3 }, |
| 70 | { 0x800ff404, KEY_NUMERIC_4 }, |
| 71 | { 0x800ff405, KEY_NUMERIC_5 }, |
| 72 | { 0x800ff406, KEY_NUMERIC_6 }, |
| 73 | { 0x800ff407, KEY_NUMERIC_7 }, |
| 74 | { 0x800ff408, KEY_NUMERIC_8 }, |
| 75 | { 0x800ff409, KEY_NUMERIC_9 }, |
| 76 | { 0x800ff400, KEY_NUMERIC_0 }, |
| 77 | |
| 78 | { 0x02200025, KEY_NUMERIC_STAR }, |
| 79 | { 0x02200020, KEY_NUMERIC_POUND }, |
| 80 | /* 0x800ff41d also KEY_BLUE on some receivers */ |
| 81 | { 0x800ff41d, KEY_NUMERIC_STAR }, |
| 82 | /* 0x800ff41c also KEY_PREVIOUS on some receivers */ |
| 83 | { 0x800ff41c, KEY_NUMERIC_POUND }, |
| 84 | |
| 85 | { 0x800ff446, KEY_TV }, |
| 86 | { 0x800ff447, KEY_AUDIO }, /* My Music */ |
| 87 | { 0x800ff448, KEY_PVR }, /* RecordedTV */ |
| 88 | { 0x800ff449, KEY_CAMERA }, |
| 89 | { 0x800ff44a, KEY_VIDEO }, |
| 90 | /* 0x800ff424 also KEY_MENU on some receivers */ |
| 91 | { 0x800ff424, KEY_DVD }, |
| 92 | /* 0x800ff425 also KEY_GREEN on some receivers */ |
| 93 | { 0x800ff425, KEY_TUNER }, /* LiveTV */ |
| 94 | { 0x800ff450, KEY_RADIO }, |
| 95 | |
| 96 | { 0x800ff44c, KEY_LANGUAGE }, |
| 97 | { 0x800ff427, KEY_ZOOM }, /* Aspect */ |
| 98 | |
| 99 | { 0x800ff45b, KEY_RED }, |
| 100 | { 0x800ff45c, KEY_GREEN }, |
| 101 | { 0x800ff45d, KEY_YELLOW }, |
| 102 | { 0x800ff45e, KEY_BLUE }, |
| 103 | |
| 104 | { 0x800ff466, KEY_RED }, |
| 105 | /* { 0x800ff425, KEY_GREEN }, */ |
| 106 | { 0x800ff468, KEY_YELLOW }, |
| 107 | /* { 0x800ff41d, KEY_BLUE }, */ |
| 108 | |
| 109 | { 0x800ff40f, KEY_INFO }, |
| 110 | { 0x800ff426, KEY_EPG }, /* Guide */ |
| 111 | { 0x800ff45a, KEY_SUBTITLE }, /* Caption/Teletext */ |
| 112 | { 0x800ff44d, KEY_TITLE }, |
| 113 | |
| 114 | { 0x800ff40c, KEY_POWER }, |
Jarod Wilson | 56c0893 | 2011-04-05 18:42:30 -0300 | [diff] [blame] | 115 | { 0x800ff40d, KEY_MEDIA }, /* Windows MCE button */ |
Jarod Wilson | 1159f83 | 2010-04-16 18:28:35 -0300 | [diff] [blame] | 116 | |
| 117 | }; |
| 118 | |
Mauro Carvalho Chehab | d100e65 | 2010-11-17 15:56:53 -0300 | [diff] [blame] | 119 | static struct rc_map_list imon_mce_map = { |
Jarod Wilson | 1159f83 | 2010-04-16 18:28:35 -0300 | [diff] [blame] | 120 | .map = { |
| 121 | .scan = imon_mce, |
| 122 | .size = ARRAY_SIZE(imon_mce), |
Jarod Wilson | 6718e8a | 2010-04-23 02:27:11 -0300 | [diff] [blame] | 123 | /* its RC6, but w/a hardware decoder */ |
David Härdeman | c003ab1 | 2012-10-11 19:11:54 -0300 | [diff] [blame] | 124 | .rc_type = RC_TYPE_RC6_MCE, |
Jarod Wilson | 1159f83 | 2010-04-16 18:28:35 -0300 | [diff] [blame] | 125 | .name = RC_MAP_IMON_MCE, |
| 126 | } |
| 127 | }; |
| 128 | |
| 129 | static int __init init_rc_map_imon_mce(void) |
| 130 | { |
Mauro Carvalho Chehab | d100e65 | 2010-11-17 15:56:53 -0300 | [diff] [blame] | 131 | return rc_map_register(&imon_mce_map); |
Jarod Wilson | 1159f83 | 2010-04-16 18:28:35 -0300 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | static void __exit exit_rc_map_imon_mce(void) |
| 135 | { |
Mauro Carvalho Chehab | d100e65 | 2010-11-17 15:56:53 -0300 | [diff] [blame] | 136 | rc_map_unregister(&imon_mce_map); |
Jarod Wilson | 1159f83 | 2010-04-16 18:28:35 -0300 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | module_init(init_rc_map_imon_mce) |
| 140 | module_exit(exit_rc_map_imon_mce) |
| 141 | |
| 142 | MODULE_LICENSE("GPL"); |
| 143 | MODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>"); |