Skip to content

Commit 8bc8824

Browse files
esmilpalmer-dabbelt
authored andcommitted
riscv: dts: sifive unleashed: Add PWM controlled LEDs
This adds the 4 PWM controlled green LEDs to the HiFive Unleashed device tree. The schematic doesn't specify any special function for the LEDs, so they're added here without any default triggers and named d1, d2, d3 and d4 just like in the schematic. Signed-off-by: Emil Renner Berthing <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Tested-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent d14e99b commit 8bc8824

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include "fu540-c000.dtsi"
55
#include <dt-bindings/gpio/gpio.h>
6+
#include <dt-bindings/leds/common.h>
7+
#include <dt-bindings/pwm/pwm.h>
68

79
/* Clock frequency (in Hz) of the PCB crystal for rtcclk */
810
#define RTCCLK_FREQ 1000000
@@ -42,6 +44,42 @@
4244
compatible = "gpio-restart";
4345
gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
4446
};
47+
48+
led-controller {
49+
compatible = "pwm-leds";
50+
51+
led-d1 {
52+
pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>;
53+
active-low;
54+
color = <LED_COLOR_ID_GREEN>;
55+
max-brightness = <255>;
56+
label = "d1";
57+
};
58+
59+
led-d2 {
60+
pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>;
61+
active-low;
62+
color = <LED_COLOR_ID_GREEN>;
63+
max-brightness = <255>;
64+
label = "d2";
65+
};
66+
67+
led-d3 {
68+
pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>;
69+
active-low;
70+
color = <LED_COLOR_ID_GREEN>;
71+
max-brightness = <255>;
72+
label = "d3";
73+
};
74+
75+
led-d4 {
76+
pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>;
77+
active-low;
78+
color = <LED_COLOR_ID_GREEN>;
79+
max-brightness = <255>;
80+
label = "d4";
81+
};
82+
};
4583
};
4684

4785
&uart0 {

0 commit comments

Comments
 (0)