0211-BCM270X_DT-Add-pi3-act-led-overlay.patch 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. From b77abe2ef3f89489f9ca47653170bf31c3ea0bab Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Wed, 23 Mar 2016 15:57:14 +0000
  4. Subject: [PATCH] BCM270X_DT: Add pi3-act-led overlay
  5. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  6. ---
  7. arch/arm/boot/dts/overlays/Makefile | 1 +
  8. arch/arm/boot/dts/overlays/README | 19 +++++++++++++++
  9. arch/arm/boot/dts/overlays/pi3-act-led-overlay.dts | 27 ++++++++++++++++++++++
  10. 3 files changed, 47 insertions(+)
  11. create mode 100644 arch/arm/boot/dts/overlays/pi3-act-led-overlay.dts
  12. --- a/arch/arm/boot/dts/overlays/Makefile
  13. +++ b/arch/arm/boot/dts/overlays/Makefile
  14. @@ -39,6 +39,7 @@ dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can0.
  15. dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can1.dtbo
  16. dtbo-$(RPI_DT_OVERLAYS) += mmc.dtbo
  17. dtbo-$(RPI_DT_OVERLAYS) += mz61581.dtbo
  18. +dtbo-$(RPI_DT_OVERLAYS) += pi3-act-led.dtbo
  19. dtbo-$(RPI_DT_OVERLAYS) += pi3-disable-bt.dtbo
  20. dtbo-$(RPI_DT_OVERLAYS) += pi3-miniuart-bt.dtbo
  21. dtbo-$(RPI_DT_OVERLAYS) += piscreen.dtbo
  22. --- a/arch/arm/boot/dts/overlays/README
  23. +++ b/arch/arm/boot/dts/overlays/README
  24. @@ -136,12 +136,14 @@ Params:
  25. act_led_activelow Set to "on" to invert the sense of the LED
  26. (default "off")
  27. + N.B. For Pi3 see pi3-act-led overlay.
  28. act_led_gpio Set which GPIO to use for the activity LED
  29. (in case you want to connect it to an external
  30. device)
  31. (default "16" on a non-Plus board, "47" on a
  32. Plus or Pi 2)
  33. + N.B. For Pi3 see pi3-act-led overlay.
  34. pwr_led_trigger
  35. pwr_led_activelow
  36. @@ -499,6 +501,23 @@ Params: speed Display
  37. [ The pcf8563-rtc overlay has been deleted. See i2c-rtc. ]
  38. +Name: pi3-act-led
  39. +Info: Pi3 uses a GPIO expander to drive the LEDs which can only be accessed
  40. + from the VPU. There is a special driver for this with a separate DT
  41. + node, which has the unfortunate consequence of breaking the
  42. + act_led_gpio and act_led_activelow dtparams.
  43. + This overlay changes the GPIO controller back to the standard one and
  44. + restores the dtparams.
  45. +Load: dtoverlay=pi3-act-led,<param>=<val>
  46. +Params: activelow Set to "on" to invert the sense of the LED
  47. + (default "off")
  48. +
  49. + gpio Set which GPIO to use for the activity LED
  50. + (in case you want to connect it to an external
  51. + device)
  52. + REQUIRED
  53. +
  54. +
  55. Name: pi3-disable-bt
  56. Info: Disable Pi3 Bluetooth and restore UART0/ttyAMA0 over GPIOs 14 & 15
  57. N.B. To disable the systemd service that initialises the modem so it
  58. --- /dev/null
  59. +++ b/arch/arm/boot/dts/overlays/pi3-act-led-overlay.dts
  60. @@ -0,0 +1,27 @@
  61. +/dts-v1/;
  62. +/plugin/;
  63. +
  64. +/* Pi3 uses a GPIO expander to drive the LEDs which can only be accessed
  65. + from the VPU. There is a special driver for this with a separate DT node,
  66. + which has the unfortunate consequence of breaking the act_led_gpio and
  67. + act_led_activelow dtparams.
  68. +
  69. + This overlay changes the GPIO controller back to the standard one and
  70. + restores the dtparams.
  71. +*/
  72. +
  73. +/{
  74. + compatible = "brcm,bcm2708";
  75. +
  76. + fragment@0 {
  77. + target = <&act_led>;
  78. + frag0: __overlay__ {
  79. + gpios = <&gpio 0 0>;
  80. + };
  81. + };
  82. +
  83. + __overrides__ {
  84. + gpio = <&frag0>,"gpios:4";
  85. + activelow = <&frag0>,"gpios:8";
  86. + };
  87. +};