diff mbox series

[net-next,v6,16/16] arm: mvebu: dt: Add PHY LED support for 370-rd WAN port

Message ID 20230327141031.11904-17-ansuelsmth@gmail.com
State New
Headers show
Series net: Add basic LED support for switch/phy | expand

Commit Message

Christian Marangi March 27, 2023, 2:10 p.m. UTC
From: Andrew Lunn <andrew@lunn.ch>

The WAN port of the 370-RD has a Marvell PHY, with one LED on
the front panel. List this LED in the device tree.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 arch/arm/boot/dts/armada-370-rd.dts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Rob Herring April 3, 2023, 6:46 p.m. UTC | #1
On Mon, Mar 27, 2023 at 04:10:31PM +0200, Christian Marangi wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> 
> The WAN port of the 370-RD has a Marvell PHY, with one LED on
> the front panel. List this LED in the device tree.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  arch/arm/boot/dts/armada-370-rd.dts | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/armada-370-rd.dts b/arch/arm/boot/dts/armada-370-rd.dts
> index be005c9f42ef..15b36aa34ef4 100644
> --- a/arch/arm/boot/dts/armada-370-rd.dts
> +++ b/arch/arm/boot/dts/armada-370-rd.dts
> @@ -20,6 +20,7 @@
>  /dts-v1/;
>  #include <dt-bindings/input/input.h>
>  #include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/leds/common.h>
>  #include <dt-bindings/gpio/gpio.h>
>  #include "armada-370.dtsi"
>  
> @@ -135,6 +136,19 @@ &mdio {
>  	pinctrl-names = "default";
>  	phy0: ethernet-phy@0 {
>  		reg = <0>;
> +		leds {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			led@0 {
> +				reg = <0>;
> +				label = "WAN";

WAN or

> +				color = <LED_COLOR_ID_WHITE>;
> +				function = LED_FUNCTION_LAN;

LAN?

> +				function-enumerator = <1>;
> +				linux,default-trigger = "netdev";
> +			};
> +		};
>  	};
>  
>  	switch: switch@10 {
> -- 
> 2.39.2
>
Andrew Lunn April 3, 2023, 7:28 p.m. UTC | #2
> > +		leds {
> > +			#address-cells = <1>;
> > +			#size-cells = <0>;
> > +
> > +			led@0 {
> > +				reg = <0>;
> > +				label = "WAN";
> 
> WAN or
> 
> > +				color = <LED_COLOR_ID_WHITE>;
> > +				function = LED_FUNCTION_LAN;
> 
> LAN?

Hi Rob

I did not know there was LED_FUNCTION_WAN. I just blindly copied it
from some other DT fragment.

I will change this, thanks.

	Andrew
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/armada-370-rd.dts b/arch/arm/boot/dts/armada-370-rd.dts
index be005c9f42ef..15b36aa34ef4 100644
--- a/arch/arm/boot/dts/armada-370-rd.dts
+++ b/arch/arm/boot/dts/armada-370-rd.dts
@@ -20,6 +20,7 @@ 
 /dts-v1/;
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/gpio/gpio.h>
 #include "armada-370.dtsi"
 
@@ -135,6 +136,19 @@  &mdio {
 	pinctrl-names = "default";
 	phy0: ethernet-phy@0 {
 		reg = <0>;
+		leds {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			led@0 {
+				reg = <0>;
+				label = "WAN";
+				color = <LED_COLOR_ID_WHITE>;
+				function = LED_FUNCTION_LAN;
+				function-enumerator = <1>;
+				linux,default-trigger = "netdev";
+			};
+		};
 	};
 
 	switch: switch@10 {