rc-hauppauge.c 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. /* rc-hauppauge.c - Keytable for Hauppauge Remote Controllers
  2. *
  3. * keymap imported from ir-keymaps.c
  4. *
  5. * This map currently contains the code for four different RCs:
  6. * - New Hauppauge Gray;
  7. * - Old Hauppauge Gray (with a golden screen for media keys);
  8. * - Hauppauge Black;
  9. * - DSR-0112 remote bundled with Haupauge MiniStick.
  10. *
  11. * Copyright (c) 2010-2011 by Mauro Carvalho Chehab
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation; either version 2 of the License, or
  16. * (at your option) any later version.
  17. */
  18. #include <media/rc-map.h>
  19. #include <linux/module.h>
  20. /*
  21. * Hauppauge:the newer, gray remotes (seems there are multiple
  22. * slightly different versions), shipped with cx88+ivtv cards.
  23. *
  24. * This table contains the complete RC5 code, instead of just the data part
  25. */
  26. static struct rc_map_table rc5_hauppauge_new[] = {
  27. /*
  28. * Remote Controller Hauppauge Gray found on modern devices
  29. * Keycodes start with address = 0x1e
  30. */
  31. { 0x1e3b, KEY_SELECT }, /* GO / house symbol */
  32. { 0x1e3d, KEY_POWER2 }, /* system power (green button) */
  33. { 0x1e1c, KEY_TV },
  34. { 0x1e18, KEY_VIDEO }, /* Videos */
  35. { 0x1e19, KEY_AUDIO }, /* Music */
  36. { 0x1e1a, KEY_CAMERA }, /* Pictures */
  37. { 0x1e1b, KEY_EPG }, /* Guide */
  38. { 0x1e0c, KEY_RADIO },
  39. { 0x1e14, KEY_UP },
  40. { 0x1e15, KEY_DOWN },
  41. { 0x1e16, KEY_LEFT },
  42. { 0x1e17, KEY_RIGHT },
  43. { 0x1e25, KEY_OK }, /* OK */
  44. { 0x1e1f, KEY_EXIT }, /* back/exit */
  45. { 0x1e0d, KEY_MENU },
  46. { 0x1e10, KEY_VOLUMEUP },
  47. { 0x1e11, KEY_VOLUMEDOWN },
  48. { 0x1e12, KEY_PREVIOUS }, /* previous channel */
  49. { 0x1e0f, KEY_MUTE },
  50. { 0x1e20, KEY_CHANNELUP }, /* channel / program + */
  51. { 0x1e21, KEY_CHANNELDOWN }, /* channel / program - */
  52. { 0x1e37, KEY_RECORD }, /* recording */
  53. { 0x1e36, KEY_STOP },
  54. { 0x1e32, KEY_REWIND }, /* backward << */
  55. { 0x1e35, KEY_PLAY },
  56. { 0x1e34, KEY_FASTFORWARD }, /* forward >> */
  57. { 0x1e24, KEY_PREVIOUSSONG }, /* replay |< */
  58. { 0x1e30, KEY_PAUSE }, /* pause */
  59. { 0x1e1e, KEY_NEXTSONG }, /* skip >| */
  60. { 0x1e01, KEY_1 },
  61. { 0x1e02, KEY_2 },
  62. { 0x1e03, KEY_3 },
  63. { 0x1e04, KEY_4 },
  64. { 0x1e05, KEY_5 },
  65. { 0x1e06, KEY_6 },
  66. { 0x1e07, KEY_7 },
  67. { 0x1e08, KEY_8 },
  68. { 0x1e09, KEY_9 },
  69. { 0x1e0a, KEY_TEXT }, /* keypad asterisk as well */
  70. { 0x1e00, KEY_0 },
  71. { 0x1e0e, KEY_SUBTITLE }, /* also the Pound key (#) */
  72. { 0x1e0b, KEY_RED }, /* red button */
  73. { 0x1e2e, KEY_GREEN }, /* green button */
  74. { 0x1e38, KEY_YELLOW }, /* yellow key */
  75. { 0x1e29, KEY_BLUE }, /* blue key */
  76. /*
  77. * Old Remote Controller Hauppauge Gray with a golden screen
  78. * Keycodes start with address = 0x1f
  79. */
  80. { 0x1f3d, KEY_POWER2 }, /* system power (green button) */
  81. { 0x1f3b, KEY_SELECT }, /* GO */
  82. /* Keys 0 to 9 */
  83. { 0x1f00, KEY_0 },
  84. { 0x1f01, KEY_1 },
  85. { 0x1f02, KEY_2 },
  86. { 0x1f03, KEY_3 },
  87. { 0x1f04, KEY_4 },
  88. { 0x1f05, KEY_5 },
  89. { 0x1f06, KEY_6 },
  90. { 0x1f07, KEY_7 },
  91. { 0x1f08, KEY_8 },
  92. { 0x1f09, KEY_9 },
  93. { 0x1f1f, KEY_EXIT }, /* back/exit */
  94. { 0x1f0d, KEY_MENU },
  95. { 0x1f10, KEY_VOLUMEUP },
  96. { 0x1f11, KEY_VOLUMEDOWN },
  97. { 0x1f20, KEY_CHANNELUP }, /* channel / program + */
  98. { 0x1f21, KEY_CHANNELDOWN }, /* channel / program - */
  99. { 0x1f25, KEY_ENTER }, /* OK */
  100. { 0x1f0b, KEY_RED }, /* red button */
  101. { 0x1f2e, KEY_GREEN }, /* green button */
  102. { 0x1f38, KEY_YELLOW }, /* yellow key */
  103. { 0x1f29, KEY_BLUE }, /* blue key */
  104. { 0x1f0f, KEY_MUTE },
  105. { 0x1f0c, KEY_RADIO }, /* There's no indicator on this key */
  106. { 0x1f3c, KEY_ZOOM }, /* full */
  107. { 0x1f32, KEY_REWIND }, /* backward << */
  108. { 0x1f35, KEY_PLAY },
  109. { 0x1f34, KEY_FASTFORWARD }, /* forward >> */
  110. { 0x1f37, KEY_RECORD }, /* recording */
  111. { 0x1f36, KEY_STOP },
  112. { 0x1f30, KEY_PAUSE }, /* pause */
  113. { 0x1f24, KEY_PREVIOUSSONG }, /* replay |< */
  114. { 0x1f1e, KEY_NEXTSONG }, /* skip >| */
  115. /*
  116. * Keycodes for DSR-0112 remote bundled with Haupauge MiniStick
  117. * Keycodes start with address = 0x1d
  118. */
  119. { 0x1d00, KEY_0 },
  120. { 0x1d01, KEY_1 },
  121. { 0x1d02, KEY_2 },
  122. { 0x1d03, KEY_3 },
  123. { 0x1d04, KEY_4 },
  124. { 0x1d05, KEY_5 },
  125. { 0x1d06, KEY_6 },
  126. { 0x1d07, KEY_7 },
  127. { 0x1d08, KEY_8 },
  128. { 0x1d09, KEY_9 },
  129. { 0x1d0a, KEY_TEXT },
  130. { 0x1d0d, KEY_MENU },
  131. { 0x1d0f, KEY_MUTE },
  132. { 0x1d10, KEY_VOLUMEUP },
  133. { 0x1d11, KEY_VOLUMEDOWN },
  134. { 0x1d12, KEY_PREVIOUS }, /* Prev.Ch .. ??? */
  135. { 0x1d14, KEY_UP },
  136. { 0x1d15, KEY_DOWN },
  137. { 0x1d16, KEY_LEFT },
  138. { 0x1d17, KEY_RIGHT },
  139. { 0x1d1c, KEY_TV },
  140. { 0x1d1e, KEY_NEXT }, /* >| */
  141. { 0x1d1f, KEY_EXIT },
  142. { 0x1d20, KEY_CHANNELUP },
  143. { 0x1d21, KEY_CHANNELDOWN },
  144. { 0x1d24, KEY_LAST }, /* <| */
  145. { 0x1d25, KEY_OK },
  146. { 0x1d30, KEY_PAUSE },
  147. { 0x1d32, KEY_REWIND },
  148. { 0x1d34, KEY_FASTFORWARD },
  149. { 0x1d35, KEY_PLAY },
  150. { 0x1d36, KEY_STOP },
  151. { 0x1d37, KEY_RECORD },
  152. { 0x1d3b, KEY_GOTO },
  153. { 0x1d3d, KEY_POWER },
  154. { 0x1d3f, KEY_HOME },
  155. /*
  156. * Keycodes for PT# R-005 remote bundled with Haupauge HVR-930C
  157. * Keycodes start with address = 0x1c
  158. */
  159. { 0x1c3b, KEY_GOTO },
  160. { 0x1c3d, KEY_POWER },
  161. { 0x1c14, KEY_UP },
  162. { 0x1c15, KEY_DOWN },
  163. { 0x1c16, KEY_LEFT },
  164. { 0x1c17, KEY_RIGHT },
  165. { 0x1c25, KEY_OK },
  166. { 0x1c00, KEY_0 },
  167. { 0x1c01, KEY_1 },
  168. { 0x1c02, KEY_2 },
  169. { 0x1c03, KEY_3 },
  170. { 0x1c04, KEY_4 },
  171. { 0x1c05, KEY_5 },
  172. { 0x1c06, KEY_6 },
  173. { 0x1c07, KEY_7 },
  174. { 0x1c08, KEY_8 },
  175. { 0x1c09, KEY_9 },
  176. { 0x1c1f, KEY_EXIT }, /* BACK */
  177. { 0x1c0d, KEY_MENU },
  178. { 0x1c1c, KEY_TV },
  179. { 0x1c10, KEY_VOLUMEUP },
  180. { 0x1c11, KEY_VOLUMEDOWN },
  181. { 0x1c20, KEY_CHANNELUP },
  182. { 0x1c21, KEY_CHANNELDOWN },
  183. { 0x1c0f, KEY_MUTE },
  184. { 0x1c12, KEY_PREVIOUS }, /* Prev */
  185. { 0x1c36, KEY_STOP },
  186. { 0x1c37, KEY_RECORD },
  187. { 0x1c24, KEY_LAST }, /* <| */
  188. { 0x1c1e, KEY_NEXT }, /* >| */
  189. { 0x1c0a, KEY_TEXT },
  190. { 0x1c0e, KEY_SUBTITLE }, /* CC */
  191. { 0x1c32, KEY_REWIND },
  192. { 0x1c30, KEY_PAUSE },
  193. { 0x1c35, KEY_PLAY },
  194. { 0x1c34, KEY_FASTFORWARD },
  195. /*
  196. * Keycodes for the old Black Remote Controller
  197. * This one also uses RC-5 protocol
  198. * Keycodes start with address = 0x00
  199. */
  200. { 0x001f, KEY_TV },
  201. { 0x0020, KEY_CHANNELUP },
  202. { 0x000c, KEY_RADIO },
  203. { 0x0011, KEY_VOLUMEDOWN },
  204. { 0x002e, KEY_ZOOM }, /* full screen */
  205. { 0x0010, KEY_VOLUMEUP },
  206. { 0x000d, KEY_MUTE },
  207. { 0x0021, KEY_CHANNELDOWN },
  208. { 0x0022, KEY_VIDEO }, /* source */
  209. { 0x0001, KEY_1 },
  210. { 0x0002, KEY_2 },
  211. { 0x0003, KEY_3 },
  212. { 0x0004, KEY_4 },
  213. { 0x0005, KEY_5 },
  214. { 0x0006, KEY_6 },
  215. { 0x0007, KEY_7 },
  216. { 0x0008, KEY_8 },
  217. { 0x0009, KEY_9 },
  218. { 0x001e, KEY_RED }, /* Reserved */
  219. { 0x0000, KEY_0 },
  220. { 0x0026, KEY_SLEEP }, /* Minimize */
  221. };
  222. static struct rc_map_list rc5_hauppauge_new_map = {
  223. .map = {
  224. .scan = rc5_hauppauge_new,
  225. .size = ARRAY_SIZE(rc5_hauppauge_new),
  226. .rc_type = RC_TYPE_RC5,
  227. .name = RC_MAP_HAUPPAUGE,
  228. }
  229. };
  230. static int __init init_rc_map_rc5_hauppauge_new(void)
  231. {
  232. return rc_map_register(&rc5_hauppauge_new_map);
  233. }
  234. static void __exit exit_rc_map_rc5_hauppauge_new(void)
  235. {
  236. rc_map_unregister(&rc5_hauppauge_new_map);
  237. }
  238. module_init(init_rc_map_rc5_hauppauge_new)
  239. module_exit(exit_rc_map_rc5_hauppauge_new)
  240. MODULE_LICENSE("GPL");
  241. MODULE_AUTHOR("Mauro Carvalho Chehab");