rc-kworld-plus-tv-analog.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* kworld-plus-tv-analog.h - Keytable for kworld_plus_tv_analog Remote Controller
  2. *
  3. * keymap imported from ir-keymaps.c
  4. *
  5. * Copyright (c) 2010 by Mauro Carvalho Chehab
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. */
  12. #include <media/rc-map.h>
  13. #include <linux/module.h>
  14. /* Kworld Plus TV Analog Lite PCI IR
  15. Mauro Carvalho Chehab <mchehab@infradead.org>
  16. */
  17. static struct rc_map_table kworld_plus_tv_analog[] = {
  18. { 0x0c, KEY_MEDIA }, /* Kworld key */
  19. { 0x16, KEY_CLOSECD }, /* -> ) */
  20. { 0x1d, KEY_POWER2 },
  21. { 0x00, KEY_1 },
  22. { 0x01, KEY_2 },
  23. { 0x02, KEY_3 }, /* Two keys have the same code: 3 and left */
  24. { 0x03, KEY_4 }, /* Two keys have the same code: 3 and right */
  25. { 0x04, KEY_5 },
  26. { 0x05, KEY_6 },
  27. { 0x06, KEY_7 },
  28. { 0x07, KEY_8 },
  29. { 0x08, KEY_9 },
  30. { 0x0a, KEY_0 },
  31. { 0x09, KEY_AGAIN },
  32. { 0x14, KEY_MUTE },
  33. { 0x20, KEY_UP },
  34. { 0x21, KEY_DOWN },
  35. { 0x0b, KEY_ENTER },
  36. { 0x10, KEY_CHANNELUP },
  37. { 0x11, KEY_CHANNELDOWN },
  38. /* Couldn't map key left/key right since those
  39. conflict with '3' and '4' scancodes
  40. I dunno what the original driver does
  41. */
  42. { 0x13, KEY_VOLUMEUP },
  43. { 0x12, KEY_VOLUMEDOWN },
  44. /* The lower part of the IR
  45. There are several duplicated keycodes there.
  46. Most of them conflict with digits.
  47. Add mappings just to the unused scancodes.
  48. Somehow, the original driver has a way to know,
  49. but this doesn't seem to be on some GPIO.
  50. Also, it is not related to the time between keyup
  51. and keydown.
  52. */
  53. { 0x19, KEY_TIME}, /* Timeshift */
  54. { 0x1a, KEY_STOP},
  55. { 0x1b, KEY_RECORD},
  56. { 0x22, KEY_TEXT},
  57. { 0x15, KEY_AUDIO}, /* ((*)) */
  58. { 0x0f, KEY_ZOOM},
  59. { 0x1c, KEY_CAMERA}, /* snapshot */
  60. { 0x18, KEY_RED}, /* B */
  61. { 0x23, KEY_GREEN}, /* C */
  62. };
  63. static struct rc_map_list kworld_plus_tv_analog_map = {
  64. .map = {
  65. .scan = kworld_plus_tv_analog,
  66. .size = ARRAY_SIZE(kworld_plus_tv_analog),
  67. .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
  68. .name = RC_MAP_KWORLD_PLUS_TV_ANALOG,
  69. }
  70. };
  71. static int __init init_rc_map_kworld_plus_tv_analog(void)
  72. {
  73. return rc_map_register(&kworld_plus_tv_analog_map);
  74. }
  75. static void __exit exit_rc_map_kworld_plus_tv_analog(void)
  76. {
  77. rc_map_unregister(&kworld_plus_tv_analog_map);
  78. }
  79. module_init(init_rc_map_kworld_plus_tv_analog)
  80. module_exit(exit_rc_map_kworld_plus_tv_analog)
  81. MODULE_LICENSE("GPL");
  82. MODULE_AUTHOR("Mauro Carvalho Chehab");