rc-beelink-gs1.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // SPDX-License-Identifier: GPL-2.0+
  2. // Copyright (c) 2019 Clément Péron
  3. #include <media/rc-map.h>
  4. #include <linux/module.h>
  5. /*
  6. * Keymap for the Beelink GS1 remote control
  7. */
  8. static struct rc_map_table beelink_gs1_table[] = {
  9. /*
  10. * TV Keys (Power, Learn and Volume)
  11. * { 0x40400d, KEY_TV },
  12. * { 0x80f1, KEY_TV },
  13. * { 0x80f3, KEY_TV },
  14. * { 0x80f4, KEY_TV },
  15. */
  16. { 0x8051, KEY_POWER },
  17. { 0x804d, KEY_MUTE },
  18. { 0x8040, KEY_CONFIG },
  19. { 0x8026, KEY_UP },
  20. { 0x8028, KEY_DOWN },
  21. { 0x8025, KEY_LEFT },
  22. { 0x8027, KEY_RIGHT },
  23. { 0x800d, KEY_OK },
  24. { 0x8053, KEY_HOME },
  25. { 0x80bc, KEY_MEDIA },
  26. { 0x801b, KEY_BACK },
  27. { 0x8049, KEY_MENU },
  28. { 0x804e, KEY_VOLUMEUP },
  29. { 0x8056, KEY_VOLUMEDOWN },
  30. { 0x8054, KEY_SUBTITLE }, /* Web */
  31. { 0x8052, KEY_EPG }, /* Media */
  32. { 0x8041, KEY_CHANNELUP },
  33. { 0x8042, KEY_CHANNELDOWN },
  34. { 0x8031, KEY_1 },
  35. { 0x8032, KEY_2 },
  36. { 0x8033, KEY_3 },
  37. { 0x8034, KEY_4 },
  38. { 0x8035, KEY_5 },
  39. { 0x8036, KEY_6 },
  40. { 0x8037, KEY_7 },
  41. { 0x8038, KEY_8 },
  42. { 0x8039, KEY_9 },
  43. { 0x8044, KEY_DELETE },
  44. { 0x8030, KEY_0 },
  45. { 0x8058, KEY_MODE }, /* # Input Method */
  46. };
  47. static struct rc_map_list beelink_gs1_map = {
  48. .map = {
  49. .scan = beelink_gs1_table,
  50. .size = ARRAY_SIZE(beelink_gs1_table),
  51. .rc_proto = RC_PROTO_NEC,
  52. .name = RC_MAP_BEELINK_GS1,
  53. }
  54. };
  55. static int __init init_rc_map_beelink_gs1(void)
  56. {
  57. return rc_map_register(&beelink_gs1_map);
  58. }
  59. static void __exit exit_rc_map_beelink_gs1(void)
  60. {
  61. rc_map_unregister(&beelink_gs1_map);
  62. }
  63. module_init(init_rc_map_beelink_gs1)
  64. module_exit(exit_rc_map_beelink_gs1)
  65. MODULE_LICENSE("GPL");
  66. MODULE_AUTHOR("Clément Péron <[email protected]>");