Skip to contentSkip to conversation

ARM: dts: bananapi: add support for PHY LEDs

PATCH Applied Michael Klein 2 participants 2 messages May 8, 2025 – May 13, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ARM: dts: bananapi: add support for PHY LEDs

The RTL8211E ethernet PHY driver has recently gained support for controlling PHY LEDs via /sys/class/leds. The Bananapi M1 has three LEDs connected to the RTL8211E PHY. Add the corresponding nodes to the device tree.

---

v2: Refine commit message
v3: Move patch changelog below commit message separator

 .../boot/dts/allwinner/sun7i-a20-bananapi.dts | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)
arch/arm/boot/dts/allwinner/sun7i-a20-bananapi.dts +27 -0
index 46ecf9db2324..d8b362c9661a 100644
@@ -48,6 +48,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/leds/common.h>
 
 / {
 	model = "LeMaker Banana Pi";
@@ -169,6 +170,32 @@ &ir0 {
 &gmac_mdio {
 	phy1: ethernet-phy@1 {
 		reg = <1>;
+
+		leds {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			led@0 {
+				reg = <0>;
+				color = <LED_COLOR_ID_GREEN>;
+				function = LED_FUNCTION_LAN;
+				linux,default-trigger = "netdev";
+			};
+
+			led@1 {
+				reg = <1>;
+				color = <LED_COLOR_ID_AMBER>;
+				function = LED_FUNCTION_LAN;
+				linux,default-trigger = "netdev";
+			};
+
+			led@2 {
+				reg = <2>;
+				color = <LED_COLOR_ID_BLUE>;
+				function = LED_FUNCTION_LAN;
+				linux,default-trigger = "netdev";
+			};
+		};
 	};
 };
 
Signature · 1 line
2.39.5
Applied
#1 lore raw
Quoted 6 lines · Michael Klein

The RTL8211E ethernet PHY driver has recently gained support for controlling PHY LEDs via /sys/class/leds. The Bananapi M1 has three LEDs connected to the RTL8211E PHY. Add the corresponding nodes to the device tree.

Applied to sunxi/dt-for-6.16 in sunxi/linux.git, thanks!

[1/1] ARM: dts: bananapi: add support for PHY LEDs

      https://git.kernel.org/sunxi/linux/c/d010f85f1acf

Best regards,

Signature · 1 line
Chen-Yu Tsai <[email protected]>