0058-riscv-dts-allwinner-d1-Add-RGB-LEDs-to-boards.patch 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. From e6eb041b2099ec3d07a4ec391a06e86d7697c9d1 Mon Sep 17 00:00:00 2001
  2. From: Samuel Holland <[email protected]>
  3. Date: Thu, 11 Aug 2022 23:03:01 -0500
  4. Subject: [PATCH 058/117] riscv: dts: allwinner: d1: Add RGB LEDs to boards
  5. Some D1-based boards feature an onboard RGB LED. Enable them.
  6. Commit-changes: 5
  7. - New patch for v5
  8. Series-version: 5
  9. Series-to: Pavel Machek <[email protected]>
  10. Series-to: Chen-Yu Tsai <[email protected]>
  11. Series-to: Jernej Skrabec <[email protected]>
  12. Series-to: [email protected]
  13. Series-cc: Krzysztof Kozlowski <[email protected]>
  14. Series-cc: Rob Herring <[email protected]>
  15. Series-cc: [email protected]
  16. Series-cc: [email protected]
  17. Series-cc: [email protected]
  18. Series-cc: [email protected]
  19. Series-cc: [email protected]
  20. Cover-letter:
  21. leds: Allwinner A100 LED controller support
  22. This series adds bindings and a driver for the RGB LED controller found
  23. in some Allwinner SoCs, starting with A100. The hardware in the R329 and
  24. D1 SoCs appears to be identical.
  25. Patch 3 is included because the LED controller binding requires the DMA
  26. properties. That patch was sent previously[1], but never got merged.
  27. Patches 5-6 depend on the D1 devicetree series[2], but the rest of this
  28. series can be merged without them.
  29. This driver was tested on the D1 Nezha board.
  30. [1]: https://lore.kernel.org/linux-arm-kernel/[email protected]/
  31. [2]: https://lore.kernel.org/linux-riscv/[email protected]/
  32. END
  33. Signed-off-by: Samuel Holland <[email protected]>
  34. ---
  35. .../boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts | 12 ++++++++++++
  36. arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts | 13 +++++++++++++
  37. 2 files changed, 25 insertions(+)
  38. --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts
  39. +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts
  40. @@ -58,6 +58,18 @@
  41. status = "okay";
  42. };
  43. +&ledc {
  44. + pinctrl-0 = <&ledc_pc0_pin>;
  45. + pinctrl-names = "default";
  46. + status = "okay";
  47. +
  48. + multi-led@0 {
  49. + reg = <0x0>;
  50. + color = <LED_COLOR_ID_RGB>;
  51. + function = LED_FUNCTION_STATUS;
  52. + };
  53. +};
  54. +
  55. &lradc {
  56. status = "okay";
  57. --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts
  58. +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts
  59. @@ -5,6 +5,7 @@
  60. #include <dt-bindings/gpio/gpio.h>
  61. #include <dt-bindings/input/input.h>
  62. +#include <dt-bindings/leds/common.h>
  63. #include "sun20i-d1.dtsi"
  64. #include "sun20i-d1-common-regulators.dtsi"
  65. @@ -90,6 +91,18 @@
  66. };
  67. };
  68. +&ledc {
  69. + pinctrl-0 = <&ledc_pc0_pin>;
  70. + pinctrl-names = "default";
  71. + status = "okay";
  72. +
  73. + multi-led@0 {
  74. + reg = <0x0>;
  75. + color = <LED_COLOR_ID_RGB>;
  76. + function = LED_FUNCTION_STATUS;
  77. + };
  78. +};
  79. +
  80. &lradc {
  81. status = "okay";