rc-imon-pad.c 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /* rc5-imon-pad.c - Keytable for SoundGraph iMON PAD and Antec Veris
  2. * RM-200 Remote Control
  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. #include <media/rc-map.h>
  12. #include <linux/module.h>
  13. /*
  14. * standard imon remote key table, which isn't really entirely
  15. * "standard", as different receivers decode the same key on the
  16. * same remote to different hex codes, and the silkscreened names
  17. * vary a bit between the SoundGraph and Antec remotes... ugh.
  18. */
  19. static struct rc_map_table imon_pad[] = {
  20. /* keys sorted mostly by frequency of use to optimize lookups */
  21. { 0x2a8195b7, KEY_REWIND },
  22. { 0x298315b7, KEY_REWIND },
  23. { 0x2b8115b7, KEY_FASTFORWARD },
  24. { 0x2b8315b7, KEY_FASTFORWARD },
  25. { 0x2b9115b7, KEY_PREVIOUS },
  26. { 0x298195b7, KEY_NEXT },
  27. { 0x2a8115b7, KEY_PLAY },
  28. { 0x2a8315b7, KEY_PLAY },
  29. { 0x2a9115b7, KEY_PAUSE },
  30. { 0x2b9715b7, KEY_STOP },
  31. { 0x298115b7, KEY_RECORD },
  32. { 0x01008000, KEY_UP },
  33. { 0x01007f00, KEY_DOWN },
  34. { 0x01000080, KEY_LEFT },
  35. { 0x0100007f, KEY_RIGHT },
  36. { 0x2aa515b7, KEY_UP },
  37. { 0x289515b7, KEY_DOWN },
  38. { 0x29a515b7, KEY_LEFT },
  39. { 0x2ba515b7, KEY_RIGHT },
  40. { 0x0200002c, KEY_SPACE }, /* Select/Space */
  41. { 0x2a9315b7, KEY_SPACE }, /* Select/Space */
  42. { 0x02000028, KEY_ENTER },
  43. { 0x28a195b7, KEY_ENTER },
  44. { 0x288195b7, KEY_EXIT },
  45. { 0x02000029, KEY_ESC },
  46. { 0x2bb715b7, KEY_ESC },
  47. { 0x0200002a, KEY_BACKSPACE },
  48. { 0x28a115b7, KEY_BACKSPACE },
  49. { 0x2b9595b7, KEY_MUTE },
  50. { 0x28a395b7, KEY_VOLUMEUP },
  51. { 0x28a595b7, KEY_VOLUMEDOWN },
  52. { 0x289395b7, KEY_CHANNELUP },
  53. { 0x288795b7, KEY_CHANNELDOWN },
  54. { 0x0200001e, KEY_NUMERIC_1 },
  55. { 0x0200001f, KEY_NUMERIC_2 },
  56. { 0x02000020, KEY_NUMERIC_3 },
  57. { 0x02000021, KEY_NUMERIC_4 },
  58. { 0x02000022, KEY_NUMERIC_5 },
  59. { 0x02000023, KEY_NUMERIC_6 },
  60. { 0x02000024, KEY_NUMERIC_7 },
  61. { 0x02000025, KEY_NUMERIC_8 },
  62. { 0x02000026, KEY_NUMERIC_9 },
  63. { 0x02000027, KEY_NUMERIC_0 },
  64. { 0x28b595b7, KEY_NUMERIC_1 },
  65. { 0x2bb195b7, KEY_NUMERIC_2 },
  66. { 0x28b195b7, KEY_NUMERIC_3 },
  67. { 0x2a8595b7, KEY_NUMERIC_4 },
  68. { 0x299595b7, KEY_NUMERIC_5 },
  69. { 0x2aa595b7, KEY_NUMERIC_6 },
  70. { 0x2b9395b7, KEY_NUMERIC_7 },
  71. { 0x2a8515b7, KEY_NUMERIC_8 },
  72. { 0x2aa115b7, KEY_NUMERIC_9 },
  73. { 0x2ba595b7, KEY_NUMERIC_0 },
  74. { 0x02200025, KEY_NUMERIC_STAR },
  75. { 0x28b515b7, KEY_NUMERIC_STAR },
  76. { 0x02200020, KEY_NUMERIC_POUND },
  77. { 0x29a115b7, KEY_NUMERIC_POUND },
  78. { 0x2b8515b7, KEY_VIDEO },
  79. { 0x299195b7, KEY_AUDIO },
  80. { 0x2ba115b7, KEY_IMAGES },
  81. { 0x28a515b7, KEY_TV },
  82. { 0x29a395b7, KEY_DVD },
  83. { 0x29a295b7, KEY_DVD },
  84. /* the Menu key between DVD and Subtitle on the RM-200... */
  85. { 0x2ba385b7, KEY_MENU },
  86. { 0x2ba395b7, KEY_MENU },
  87. { 0x288515b7, KEY_BOOKMARKS },
  88. { 0x2ab715b7, KEY_CAMERA }, /* Thumbnail */
  89. { 0x298595b7, KEY_SUBTITLE },
  90. { 0x2b8595b7, KEY_LANGUAGE },
  91. { 0x29a595b7, KEY_ZOOM },
  92. { 0x2aa395b7, KEY_SCREEN }, /* FullScreen */
  93. { 0x299115b7, KEY_KEYBOARD },
  94. { 0x299135b7, KEY_KEYBOARD },
  95. { 0x01010000, BTN_LEFT },
  96. { 0x01020000, BTN_RIGHT },
  97. { 0x01010080, BTN_LEFT },
  98. { 0x01020080, BTN_RIGHT },
  99. { 0x688301b7, BTN_LEFT },
  100. { 0x688481b7, BTN_RIGHT },
  101. { 0x2a9395b7, KEY_CYCLEWINDOWS }, /* TaskSwitcher */
  102. { 0x2b8395b7, KEY_TIME }, /* Timer */
  103. { 0x289115b7, KEY_POWER },
  104. { 0x29b195b7, KEY_EJECTCD }, /* the one next to play */
  105. { 0x299395b7, KEY_EJECTCLOSECD }, /* eject (by TaskSw) */
  106. { 0x02800000, KEY_CONTEXT_MENU }, /* Left Menu */
  107. { 0x2b8195b7, KEY_CONTEXT_MENU }, /* Left Menu*/
  108. { 0x02000065, KEY_COMPOSE }, /* RightMenu */
  109. { 0x28b715b7, KEY_COMPOSE }, /* RightMenu */
  110. { 0x2ab195b7, KEY_MEDIA }, /* Go or MultiMon */
  111. { 0x29b715b7, KEY_DASHBOARD }, /* AppLauncher */
  112. };
  113. static struct rc_map_list imon_pad_map = {
  114. .map = {
  115. .scan = imon_pad,
  116. .size = ARRAY_SIZE(imon_pad),
  117. .rc_proto = RC_PROTO_IMON,
  118. .name = RC_MAP_IMON_PAD,
  119. }
  120. };
  121. static int __init init_rc_map_imon_pad(void)
  122. {
  123. return rc_map_register(&imon_pad_map);
  124. }
  125. static void __exit exit_rc_map_imon_pad(void)
  126. {
  127. rc_map_unregister(&imon_pad_map);
  128. }
  129. module_init(init_rc_map_imon_pad)
  130. module_exit(exit_rc_map_imon_pad)
  131. MODULE_LICENSE("GPL");
  132. MODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>");