0105-dts-Added-overlay-for-gpio_ir_recv-driver.patch 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. From 95a5908e69f5b3040ee0eedb2a3aceac662464ae Mon Sep 17 00:00:00 2001
  2. From: Holger Steinhaus <hsteinhaus@gmx.de>
  3. Date: Sat, 14 Nov 2015 18:37:43 +0100
  4. Subject: [PATCH 105/381] dts: Added overlay for gpio_ir_recv driver
  5. ---
  6. arch/arm/boot/dts/overlays/Makefile | 1 +
  7. arch/arm/boot/dts/overlays/README | 18 ++++++++++-
  8. arch/arm/boot/dts/overlays/gpio-ir-overlay.dts | 45 ++++++++++++++++++++++++++
  9. 3 files changed, 63 insertions(+), 1 deletion(-)
  10. create mode 100644 arch/arm/boot/dts/overlays/gpio-ir-overlay.dts
  11. --- a/arch/arm/boot/dts/overlays/Makefile
  12. +++ b/arch/arm/boot/dts/overlays/Makefile
  13. @@ -16,6 +16,7 @@ dtb-$(RPI_DT_OVERLAYS) += ads7846-overla
  14. dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb
  15. dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb
  16. dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb
  17. +dtb-$(RPI_DT_OVERLAYS) += gpio-ir-overlay.dtb
  18. dtb-$(RPI_DT_OVERLAYS) += gpio-poweroff-overlay.dtb
  19. dtb-$(RPI_DT_OVERLAYS) += hifiberry-amp-overlay.dtb
  20. dtb-$(RPI_DT_OVERLAYS) += hifiberry-dac-overlay.dtb
  21. --- a/arch/arm/boot/dts/overlays/README
  22. +++ b/arch/arm/boot/dts/overlays/README
  23. @@ -196,6 +196,22 @@ Params: int_pin GPIO us
  24. speed SPI bus speed (default 12000000)
  25. +Name: gpio-ir
  26. +Info: Use GPIO pin as rc-core style infrared receiver input. The rc-core-
  27. + based gpio_ir_recv driver maps received keys directly to a
  28. + /dev/input/event* device, all decoding is done by the kernel - LIRC is
  29. + not required! The key mapping and other decoding parameters can be
  30. + configured by "ir-keytable" tool.
  31. +Load: dtoverlay=gpio-ir,<param>=<val>
  32. +Params: gpio_pin Input pin number. Default is 18.
  33. +
  34. + gpio_pull Desired pull-up/down state (off, down, up)
  35. + Default is "down".
  36. +
  37. + rc-map-name Default rc keymap (can also be changed by
  38. + ir-keytable), defaults to "rc-rc6-mce"
  39. +
  40. +
  41. Name: gpio-poweroff
  42. Info: Drives a GPIO high or low on reboot
  43. Load: dtoverlay=gpio-poweroff,<param>=<val>
  44. @@ -308,7 +324,7 @@ Params: <None>
  45. Name: lirc-rpi
  46. Info: Configures lirc-rpi (Linux Infrared Remote Control for Raspberry Pi)
  47. Consult the module documentation for more details.
  48. -Load: dtoverlay=lirc-rpi,<param>=<val>,...
  49. +Load: dtoverlay=lirc-rpi,<param>=<val>
  50. Params: gpio_out_pin GPIO for output (default "17")
  51. gpio_in_pin GPIO for input (default "18")
  52. --- /dev/null
  53. +++ b/arch/arm/boot/dts/overlays/gpio-ir-overlay.dts
  54. @@ -0,0 +1,45 @@
  55. +// Definitions for ir-gpio module
  56. +/dts-v1/;
  57. +/plugin/;
  58. +
  59. +/ {
  60. + compatible = "brcm,bcm2708";
  61. +
  62. + fragment@0 {
  63. + target-path = "/";
  64. + __overlay__ {
  65. + gpio_ir: ir-receiver {
  66. + compatible = "gpio-ir-receiver";
  67. +
  68. + // pin number, high or low
  69. + gpios = <&gpio 18 1>;
  70. +
  71. + // parameter for keymap name
  72. + linux,rc-map-name = "rc-rc6-mce";
  73. +
  74. + status = "okay";
  75. + };
  76. + };
  77. + };
  78. +
  79. + fragment@1 {
  80. + target = <&gpio>;
  81. + __overlay__ {
  82. + gpio_ir_pins: gpio_ir_pins {
  83. + brcm,pins = <18>; // pin 18
  84. + brcm,function = <0>; // in
  85. + brcm,pull = <1>; // down
  86. + };
  87. + };
  88. + };
  89. +
  90. + __overrides__ {
  91. + // parameters
  92. + gpio_pin = <&gpio_ir>,"gpios:4",
  93. + <&gpio_ir_pins>,"brcm,pins:0",
  94. + <&gpio_ir_pins>,"brcm,pull:0"; // pin number
  95. + gpio_pull = <&gpio_ir_pins>,"brcm,pull:0"; // pull-up/down state
  96. +
  97. + rc-map-name = <&gpio_ir>,"linux,rc-map-name"; // default rc map
  98. + };
  99. +};