rc-wetek-play2.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // SPDX-License-Identifier: GPL-2.0+
  2. //
  3. // Copyright (C) 2019 Christian Hewitt <[email protected]>
  4. #include <media/rc-map.h>
  5. #include <linux/module.h>
  6. //
  7. // Keytable for the WeTek Play 2 STB remote control
  8. //
  9. static struct rc_map_table wetek_play2[] = {
  10. { 0x5e5f02, KEY_POWER },
  11. { 0x5e5f46, KEY_SLEEP }, // tv
  12. { 0x5e5f10, KEY_MUTE },
  13. { 0x5e5f22, KEY_1 },
  14. { 0x5e5f23, KEY_2 },
  15. { 0x5e5f24, KEY_3 },
  16. { 0x5e5f25, KEY_4 },
  17. { 0x5e5f26, KEY_5 },
  18. { 0x5e5f27, KEY_6 },
  19. { 0x5e5f28, KEY_7 },
  20. { 0x5e5f29, KEY_8 },
  21. { 0x5e5f30, KEY_9 },
  22. { 0x5e5f71, KEY_BACK },
  23. { 0x5e5f21, KEY_0 },
  24. { 0x5e5f72, KEY_CAPSLOCK },
  25. // outer ring clockwide from top
  26. { 0x5e5f03, KEY_HOME },
  27. { 0x5e5f61, KEY_BACK },
  28. { 0x5e5f77, KEY_CONFIG }, // mouse
  29. { 0x5e5f83, KEY_EPG },
  30. { 0x5e5f84, KEY_SCREEN }, // square
  31. { 0x5e5f48, KEY_MENU },
  32. // inner ring
  33. { 0x5e5f50, KEY_UP },
  34. { 0x5e5f4b, KEY_DOWN },
  35. { 0x5e5f4c, KEY_LEFT },
  36. { 0x5e5f4d, KEY_RIGHT },
  37. { 0x5e5f47, KEY_OK },
  38. { 0x5e5f44, KEY_VOLUMEUP },
  39. { 0x5e5f43, KEY_VOLUMEDOWN },
  40. { 0x5e5f4f, KEY_FAVORITES },
  41. { 0x5e5f82, KEY_SUBTITLE }, // txt
  42. { 0x5e5f41, KEY_PAGEUP },
  43. { 0x5e5f42, KEY_PAGEDOWN },
  44. { 0x5e5f73, KEY_RED },
  45. { 0x5e5f74, KEY_GREEN },
  46. { 0x5e5f75, KEY_YELLOW },
  47. { 0x5e5f76, KEY_BLUE },
  48. { 0x5e5f67, KEY_PREVIOUSSONG },
  49. { 0x5e5f79, KEY_REWIND },
  50. { 0x5e5f80, KEY_FASTFORWARD },
  51. { 0x5e5f81, KEY_NEXTSONG },
  52. { 0x5e5f04, KEY_RECORD },
  53. { 0x5e5f2c, KEY_PLAYPAUSE },
  54. { 0x5e5f2b, KEY_STOP },
  55. };
  56. static struct rc_map_list wetek_play2_map = {
  57. .map = {
  58. .scan = wetek_play2,
  59. .size = ARRAY_SIZE(wetek_play2),
  60. .rc_proto = RC_PROTO_NECX,
  61. .name = RC_MAP_WETEK_PLAY2,
  62. }
  63. };
  64. static int __init init_rc_map_wetek_play2(void)
  65. {
  66. return rc_map_register(&wetek_play2_map);
  67. }
  68. static void __exit exit_rc_map_wetek_play2(void)
  69. {
  70. rc_map_unregister(&wetek_play2_map);
  71. }
  72. module_init(init_rc_map_wetek_play2)
  73. module_exit(exit_rc_map_wetek_play2)
  74. MODULE_LICENSE("GPL");
  75. MODULE_AUTHOR("Christian Hewitt <[email protected]");