Skip to content

Commit 2cfe9bb

Browse files
esmilpalmer-dabbelt
authored andcommitted
riscv: dts: sifive unmatched: Add PWM controlled LEDs
This adds the two PWM controlled LEDs to the HiFive Unmatched device tree. D12 is just a regular green diode, but D2 is an RGB diode with 3 PWM inputs controlling the three different colours. Signed-off-by: Emil Renner Berthing <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Acked-by: Pavel Machek <[email protected]> Tested-by: Ron Economos <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent d8357e3 commit 2cfe9bb

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include "fu740-c000.dtsi"
55
#include <dt-bindings/gpio/gpio.h>
66
#include <dt-bindings/interrupt-controller/irq.h>
7+
#include <dt-bindings/leds/common.h>
8+
#include <dt-bindings/pwm/pwm.h>
79

810
/* Clock frequency (in Hz) of the PCB crystal for rtcclk */
911
#define RTCCLK_FREQ 1000000
@@ -44,6 +46,46 @@
4446
compatible = "gpio-poweroff";
4547
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
4648
};
49+
50+
led-controller-1 {
51+
compatible = "pwm-leds";
52+
53+
led-d12 {
54+
pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>;
55+
active-low;
56+
color = <LED_COLOR_ID_GREEN>;
57+
max-brightness = <255>;
58+
label = "d12";
59+
};
60+
};
61+
62+
led-controller-2 {
63+
compatible = "pwm-leds-multicolor";
64+
65+
multi-led {
66+
color = <LED_COLOR_ID_RGB>;
67+
max-brightness = <255>;
68+
label = "d2";
69+
70+
led-red {
71+
pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>;
72+
active-low;
73+
color = <LED_COLOR_ID_RED>;
74+
};
75+
76+
led-green {
77+
pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>;
78+
active-low;
79+
color = <LED_COLOR_ID_GREEN>;
80+
};
81+
82+
led-blue {
83+
pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>;
84+
active-low;
85+
color = <LED_COLOR_ID_BLUE>;
86+
};
87+
};
88+
};
4789
};
4890

4991
&uart0 {

0 commit comments

Comments
 (0)