rc-hauppauge.c 6.8 KB

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