rc-khadas.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // SPDX-License-Identifier: GPL-2.0+
  2. //
  3. // Copyright (C) 2019 Christian Hewitt <[email protected]>
  4. /*
  5. * Keytable for the Khadas VIM/EDGE SBC remote control
  6. */
  7. #include <media/rc-map.h>
  8. #include <linux/module.h>
  9. static struct rc_map_table khadas[] = {
  10. { 0x14, KEY_POWER },
  11. { 0x03, KEY_UP },
  12. { 0x02, KEY_DOWN },
  13. { 0x0e, KEY_LEFT },
  14. { 0x1a, KEY_RIGHT },
  15. { 0x07, KEY_OK },
  16. { 0x01, KEY_BACK },
  17. { 0x5b, KEY_MUTE }, // mouse
  18. { 0x13, KEY_MENU },
  19. { 0x58, KEY_VOLUMEDOWN },
  20. { 0x0b, KEY_VOLUMEUP },
  21. { 0x48, KEY_HOME },
  22. };
  23. static struct rc_map_list khadas_map = {
  24. .map = {
  25. .scan = khadas,
  26. .size = ARRAY_SIZE(khadas),
  27. .rc_proto = RC_PROTO_NEC,
  28. .name = RC_MAP_KHADAS,
  29. }
  30. };
  31. static int __init init_rc_map_khadas(void)
  32. {
  33. return rc_map_register(&khadas_map);
  34. }
  35. static void __exit exit_rc_map_khadas(void)
  36. {
  37. rc_map_unregister(&khadas_map);
  38. }
  39. module_init(init_rc_map_khadas)
  40. module_exit(exit_rc_map_khadas)
  41. MODULE_LICENSE("GPL");
  42. MODULE_AUTHOR("Christian Hewitt <[email protected]>");