rc-zx-irdec.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Copyright (C) 2017 Sanechips Technology Co., Ltd.
  3. * Copyright 2017 Linaro Ltd.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #include <linux/module.h>
  10. #include <media/rc-map.h>
  11. static struct rc_map_table zx_irdec_table[] = {
  12. { 0x01, KEY_1 },
  13. { 0x02, KEY_2 },
  14. { 0x03, KEY_3 },
  15. { 0x04, KEY_4 },
  16. { 0x05, KEY_5 },
  17. { 0x06, KEY_6 },
  18. { 0x07, KEY_7 },
  19. { 0x08, KEY_8 },
  20. { 0x09, KEY_9 },
  21. { 0x31, KEY_0 },
  22. { 0x16, KEY_DELETE },
  23. { 0x0a, KEY_MODE }, /* Input method */
  24. { 0x0c, KEY_VOLUMEUP },
  25. { 0x18, KEY_VOLUMEDOWN },
  26. { 0x0b, KEY_CHANNELUP },
  27. { 0x15, KEY_CHANNELDOWN },
  28. { 0x0d, KEY_PAGEUP },
  29. { 0x13, KEY_PAGEDOWN },
  30. { 0x46, KEY_FASTFORWARD },
  31. { 0x43, KEY_REWIND },
  32. { 0x44, KEY_PLAYPAUSE },
  33. { 0x45, KEY_STOP },
  34. { 0x49, KEY_OK },
  35. { 0x47, KEY_UP },
  36. { 0x4b, KEY_DOWN },
  37. { 0x48, KEY_LEFT },
  38. { 0x4a, KEY_RIGHT },
  39. { 0x4d, KEY_MENU },
  40. { 0x56, KEY_APPSELECT }, /* Application */
  41. { 0x4c, KEY_BACK },
  42. { 0x1e, KEY_INFO },
  43. { 0x4e, KEY_F1 },
  44. { 0x4f, KEY_F2 },
  45. { 0x50, KEY_F3 },
  46. { 0x51, KEY_F4 },
  47. { 0x1c, KEY_AUDIO },
  48. { 0x12, KEY_MUTE },
  49. { 0x11, KEY_DOT }, /* Location */
  50. { 0x1d, KEY_SETUP },
  51. { 0x40, KEY_POWER },
  52. };
  53. static struct rc_map_list zx_irdec_map = {
  54. .map = {
  55. .scan = zx_irdec_table,
  56. .size = ARRAY_SIZE(zx_irdec_table),
  57. .rc_proto = RC_PROTO_NEC,
  58. .name = RC_MAP_ZX_IRDEC,
  59. }
  60. };
  61. static int __init init_rc_map_zx_irdec(void)
  62. {
  63. return rc_map_register(&zx_irdec_map);
  64. }
  65. static void __exit exit_rc_map_zx_irdec(void)
  66. {
  67. rc_map_unregister(&zx_irdec_map);
  68. }
  69. module_init(init_rc_map_zx_irdec)
  70. module_exit(exit_rc_map_zx_irdec)
  71. MODULE_AUTHOR("Shawn Guo <shawn.guo@linaro.org>");
  72. MODULE_LICENSE("GPL v2");