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