Unverified Commit 2cfe9bbe authored by Emil Renner Berthing's avatar Emil Renner Berthing Committed by Palmer Dabbelt
Browse files

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: default avatarEmil Renner Berthing <emil.renner.berthing@canonical.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Tested-by: default avatarRon Economos <re@w6rz.net>
Link: https://lore.kernel.org/r/20220705210143.315151-5-emil.renner.berthing@canonical.com


Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent d8357e3b
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@
#include "fu740-c000.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/pwm/pwm.h>

/* Clock frequency (in Hz) of the PCB crystal for rtcclk */
#define RTCCLK_FREQ		1000000
@@ -44,6 +46,46 @@
		compatible = "gpio-poweroff";
		gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
	};

	led-controller-1 {
		compatible = "pwm-leds";

		led-d12 {
			pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>;
			active-low;
			color = <LED_COLOR_ID_GREEN>;
			max-brightness = <255>;
			label = "d12";
		};
	};

	led-controller-2 {
		compatible = "pwm-leds-multicolor";

		multi-led {
			color = <LED_COLOR_ID_RGB>;
			max-brightness = <255>;
			label = "d2";

			led-red {
				pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>;
				active-low;
				color = <LED_COLOR_ID_RED>;
			};

			led-green {
				pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>;
				active-low;
				color = <LED_COLOR_ID_GREEN>;
			};

			led-blue {
				pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>;
				active-low;
				color = <LED_COLOR_ID_BLUE>;
			};
		};
	};
};

&uart0 {