0003-riscv-sifive-unmatched-define-PWM-LEDs.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From 2c2d8ac8c124a2938c9326c14b2dffd46d76b4a8 Mon Sep 17 00:00:00 2001
  2. From: David Abdurachmanov <[email protected]>
  3. Date: Mon, 13 Sep 2021 02:15:37 -0700
  4. Subject: [PATCH 3/7] riscv: sifive: unmatched: define PWM LEDs
  5. Add D2 (RGB) and D12 (green) LEDs for SiFive Unmatched board.
  6. Signed-off-by: David Abdurachmanov <[email protected]>
  7. ---
  8. .../riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 41 ++++++++++++++++++++++
  9. 1 file changed, 41 insertions(+)
  10. --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
  11. +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
  12. @@ -4,6 +4,8 @@
  13. #include "fu740-c000.dtsi"
  14. #include <dt-bindings/gpio/gpio.h>
  15. #include <dt-bindings/interrupt-controller/irq.h>
  16. +#include <dt-bindings/leds/common.h>
  17. +#include <dt-bindings/pwm/pwm.h>
  18. /* Clock frequency (in Hz) of the PCB crystal for rtcclk */
  19. #define RTCCLK_FREQ 1000000
  20. @@ -31,6 +33,45 @@
  21. soc {
  22. };
  23. + pwmleds {
  24. + compatible = "pwm-leds";
  25. + green-d12 {
  26. + label = "green:d12";
  27. + color = <LED_COLOR_ID_GREEN>;
  28. + pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>;
  29. + active-low = <1>;
  30. + max-brightness = <255>;
  31. + linux,default-trigger = "none";
  32. + };
  33. +
  34. + green-d2 {
  35. + label = "green:d2";
  36. + color = <LED_COLOR_ID_GREEN>;
  37. + pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>;
  38. + active-low = <1>;
  39. + max-brightness = <255>;
  40. + linux,default-trigger = "none";
  41. + };
  42. +
  43. + red-d2 {
  44. + label = "red:d2";
  45. + color = <LED_COLOR_ID_RED>;
  46. + pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>;
  47. + active-low = <1>;
  48. + max-brightness = <255>;
  49. + linux,default-trigger = "none";
  50. + };
  51. +
  52. + blue-d2 {
  53. + label = "blue:d2";
  54. + color = <LED_COLOR_ID_BLUE>;
  55. + pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>;
  56. + active-low = <1>;
  57. + max-brightness = <255>;
  58. + linux,default-trigger = "none";
  59. + };
  60. + };
  61. +
  62. hfclk: hfclk {
  63. #clock-cells = <0>;
  64. compatible = "fixed-clock";