rc-tivo.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* rc-tivo.c - Keytable for TiVo remotes
  2. *
  3. * Copyright (c) 2011 by Jarod Wilson <jarod@redhat.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. */
  10. #include <media/rc-map.h>
  11. #include <linux/module.h>
  12. /*
  13. * Initial mapping is for the TiVo remote included in the Nero LiquidTV bundle,
  14. * which also ships with a TiVo-branded IR transceiver, supported by the mceusb
  15. * driver. Note that the remote uses an NEC-ish protocol, but instead of having
  16. * a command/not_command pair, it has a vendor ID of 0x3085, but some keys, the
  17. * NEC extended checksums do pass, so the table presently has the intended
  18. * values and the checksum-passed versions for those keys.
  19. */
  20. static struct rc_map_table tivo[] = {
  21. { 0x3085f009, KEY_MEDIA }, /* TiVo Button */
  22. { 0x3085e010, KEY_POWER2 }, /* TV Power */
  23. { 0x3085e011, KEY_TV }, /* Live TV/Swap */
  24. { 0x3085c034, KEY_VIDEO_NEXT }, /* TV Input */
  25. { 0x3085e013, KEY_INFO },
  26. { 0x3085a05f, KEY_CYCLEWINDOWS }, /* Window */
  27. { 0x0085305f, KEY_CYCLEWINDOWS },
  28. { 0x3085c036, KEY_EPG }, /* Guide */
  29. { 0x3085e014, KEY_UP },
  30. { 0x3085e016, KEY_DOWN },
  31. { 0x3085e017, KEY_LEFT },
  32. { 0x3085e015, KEY_RIGHT },
  33. { 0x3085e018, KEY_SCROLLDOWN }, /* Red Thumbs Down */
  34. { 0x3085e019, KEY_SELECT },
  35. { 0x3085e01a, KEY_SCROLLUP }, /* Green Thumbs Up */
  36. { 0x3085e01c, KEY_VOLUMEUP },
  37. { 0x3085e01d, KEY_VOLUMEDOWN },
  38. { 0x3085e01b, KEY_MUTE },
  39. { 0x3085d020, KEY_RECORD },
  40. { 0x3085e01e, KEY_CHANNELUP },
  41. { 0x3085e01f, KEY_CHANNELDOWN },
  42. { 0x0085301f, KEY_CHANNELDOWN },
  43. { 0x3085d021, KEY_PLAY },
  44. { 0x3085d023, KEY_PAUSE },
  45. { 0x3085d025, KEY_SLOW },
  46. { 0x3085d022, KEY_REWIND },
  47. { 0x3085d024, KEY_FASTFORWARD },
  48. { 0x3085d026, KEY_PREVIOUS },
  49. { 0x3085d027, KEY_NEXT }, /* ->| */
  50. { 0x3085b044, KEY_ZOOM }, /* Aspect */
  51. { 0x3085b048, KEY_STOP },
  52. { 0x3085b04a, KEY_DVD }, /* DVD Menu */
  53. { 0x3085d028, KEY_NUMERIC_1 },
  54. { 0x3085d029, KEY_NUMERIC_2 },
  55. { 0x3085d02a, KEY_NUMERIC_3 },
  56. { 0x3085d02b, KEY_NUMERIC_4 },
  57. { 0x3085d02c, KEY_NUMERIC_5 },
  58. { 0x3085d02d, KEY_NUMERIC_6 },
  59. { 0x3085d02e, KEY_NUMERIC_7 },
  60. { 0x3085d02f, KEY_NUMERIC_8 },
  61. { 0x0085302f, KEY_NUMERIC_8 },
  62. { 0x3085c030, KEY_NUMERIC_9 },
  63. { 0x3085c031, KEY_NUMERIC_0 },
  64. { 0x3085c033, KEY_ENTER },
  65. { 0x3085c032, KEY_CLEAR },
  66. };
  67. static struct rc_map_list tivo_map = {
  68. .map = {
  69. .scan = tivo,
  70. .size = ARRAY_SIZE(tivo),
  71. .rc_proto = RC_PROTO_NEC,
  72. .name = RC_MAP_TIVO,
  73. }
  74. };
  75. static int __init init_rc_map_tivo(void)
  76. {
  77. return rc_map_register(&tivo_map);
  78. }
  79. static void __exit exit_rc_map_tivo(void)
  80. {
  81. rc_map_unregister(&tivo_map);
  82. }
  83. module_init(init_rc_map_tivo)
  84. module_exit(exit_rc_map_tivo)
  85. MODULE_LICENSE("GPL");
  86. MODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>");