[PATCH] ARM: dts: lan966x: add led configuration

Horatiu Vultur posted 1 patch 3 years, 7 months ago
There is a newer version of this series
arch/arm/boot/dts/lan966x-pcb8291.dts | 29 +++++++++++++++++++++++++++
arch/arm/boot/dts/lan966x-pcb8309.dts | 29 +++++++++++++++++++++++++++
2 files changed, 58 insertions(+)
[PATCH] ARM: dts: lan966x: add led configuration
Posted by Horatiu Vultur 3 years, 7 months ago
Add led configuration for pcb8291 and pcb8309. Both pcbs have 4 leds which
are connected to the sgpio controller.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 arch/arm/boot/dts/lan966x-pcb8291.dts | 29 +++++++++++++++++++++++++++
 arch/arm/boot/dts/lan966x-pcb8309.dts | 29 +++++++++++++++++++++++++++
 2 files changed, 58 insertions(+)

diff --git a/arch/arm/boot/dts/lan966x-pcb8291.dts b/arch/arm/boot/dts/lan966x-pcb8291.dts
index 24d9055c4a08..649cfe69d98d 100644
--- a/arch/arm/boot/dts/lan966x-pcb8291.dts
+++ b/arch/arm/boot/dts/lan966x-pcb8291.dts
@@ -23,6 +23,35 @@ gpio-restart {
 		gpios = <&gpio 56 GPIO_ACTIVE_LOW>;
 		priority = <200>;
 	};
+
+	leds {
+		compatible = "gpio-leds";
+		status = "okay";
+
+		led-s0-blue {
+			label = "s0:blue";
+			gpios = <&sgpio_out 2 0 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-s0-green {
+			label = "s0:green";
+			gpios = <&sgpio_out 2 1 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-s1-blue {
+			label = "s1:blue";
+			gpios = <&sgpio_out 3 0 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-s1-green {
+			label = "s1:green";
+			gpios = <&sgpio_out 3 1 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+	};
 };
 
 &gpio {
diff --git a/arch/arm/boot/dts/lan966x-pcb8309.dts b/arch/arm/boot/dts/lan966x-pcb8309.dts
index 05ce27ed5648..4f30975b4a13 100644
--- a/arch/arm/boot/dts/lan966x-pcb8309.dts
+++ b/arch/arm/boot/dts/lan966x-pcb8309.dts
@@ -42,6 +42,35 @@ i2c103: i2c-sfp@2 {
 		};
 	};
 
+	leds {
+		compatible = "gpio-leds";
+		status = "okay";
+
+		led-s0-green {
+			label = "s0:green";
+			gpios = <&sgpio_out 2 0 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-s0-red {
+			label = "s0:red";
+			gpios = <&sgpio_out 2 1 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-s1-green {
+			label = "s1:green";
+			gpios = <&sgpio_out 3 0 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+
+		led-s1-red {
+			label = "s1:red";
+			gpios = <&sgpio_out 3 1 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+	};
+
 	mux: mux-controller {
 		compatible = "gpio-mux";
 		#mux-control-cells = <0>;
-- 
2.33.0
Re: [PATCH] ARM: dts: lan966x: add led configuration
Posted by Pavel Machek 3 years, 6 months ago
Hi!

> Add led configuration for pcb8291 and pcb8309. Both pcbs have 4 leds which
> are connected to the sgpio controller.

> +		led-s0-blue {
> +			label = "s0:blue";
> +			label = "s0:green";
> +			label = "s1:blue";
> +			label = "s1:green";

Can we get more usefule led labels, please?

								Pavel

-- 
People of Russia, stop Putin before his war on Ukraine escalates.
Re: [PATCH] ARM: dts: lan966x: add led configuration
Posted by Claudiu.Beznea@microchip.com 3 years, 7 months ago
On 31.08.2022 22:44, Horatiu Vultur wrote:
> Add led configuration for pcb8291 and pcb8309. Both pcbs have 4 leds which
> are connected to the sgpio controller.
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
>  arch/arm/boot/dts/lan966x-pcb8291.dts | 29 +++++++++++++++++++++++++++
>  arch/arm/boot/dts/lan966x-pcb8309.dts | 29 +++++++++++++++++++++++++++
>  2 files changed, 58 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/lan966x-pcb8291.dts b/arch/arm/boot/dts/lan966x-pcb8291.dts
> index 24d9055c4a08..649cfe69d98d 100644
> --- a/arch/arm/boot/dts/lan966x-pcb8291.dts
> +++ b/arch/arm/boot/dts/lan966x-pcb8291.dts
> @@ -23,6 +23,35 @@ gpio-restart {
>  		gpios = <&gpio 56 GPIO_ACTIVE_LOW>;
>  		priority = <200>;
>  	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +		status = "okay";

There is no need for status here. Default is okay.

> +
> +		led-s0-blue {
> +			label = "s0:blue";
> +			gpios = <&sgpio_out 2 0 GPIO_ACTIVE_LOW>;
> +			default-state = "off";
> +		};
> +
> +		led-s0-green {
> +			label = "s0:green";
> +			gpios = <&sgpio_out 2 1 GPIO_ACTIVE_LOW>;
> +			default-state = "off";
> +		};
> +
> +		led-s1-blue {
> +			label = "s1:blue";
> +			gpios = <&sgpio_out 3 0 GPIO_ACTIVE_LOW>;
> +			default-state = "off";
> +		};
> +
> +		led-s1-green {
> +			label = "s1:green";
> +			gpios = <&sgpio_out 3 1 GPIO_ACTIVE_LOW>;
> +			default-state = "off";
> +		};
> +	};
>  };
>  
>  &gpio {
> diff --git a/arch/arm/boot/dts/lan966x-pcb8309.dts b/arch/arm/boot/dts/lan966x-pcb8309.dts
> index 05ce27ed5648..4f30975b4a13 100644
> --- a/arch/arm/boot/dts/lan966x-pcb8309.dts
> +++ b/arch/arm/boot/dts/lan966x-pcb8309.dts
> @@ -42,6 +42,35 @@ i2c103: i2c-sfp@2 {
>  		};
>  	};
>  
> +	leds {
> +		compatible = "gpio-leds";
> +		status = "okay";

Ditto

> +
> +		led-s0-green {
> +			label = "s0:green";
> +			gpios = <&sgpio_out 2 0 GPIO_ACTIVE_LOW>;
> +			default-state = "off";
> +		};
> +
> +		led-s0-red {
> +			label = "s0:red";
> +			gpios = <&sgpio_out 2 1 GPIO_ACTIVE_LOW>;
> +			default-state = "off";
> +		};
> +
> +		led-s1-green {
> +			label = "s1:green";
> +			gpios = <&sgpio_out 3 0 GPIO_ACTIVE_LOW>;
> +			default-state = "off";
> +		};
> +
> +		led-s1-red {
> +			label = "s1:red";
> +			gpios = <&sgpio_out 3 1 GPIO_ACTIVE_LOW>;
> +			default-state = "off";
> +		};
> +	};
> +
>  	mux: mux-controller {
>  		compatible = "gpio-mux";
>  		#mux-control-cells = <0>;