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

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