[RFC PATCH 6/7] realtek: Zyxel GS1900-8: define port LEDs

Sander Vanheule sander at svanheule.net
Sat Jul 16 12:09:58 PDT 2022


Add all port LEDs to the device tree for the GS1900-8. To reproduce the
same behaviour as stock firmware, the LEDs need to light up on all
link speeds, and blink on link activity:

    echo 1f > /sys/class/leds/lan?/rtl_hw_trigger
    echo realtek-switchport > /sys/class/leds/lan?/trigger

Signed-off-by: Sander Vanheule <sander at svanheule.net>
---
 .../dts-5.10/rtl8380_zyxel_gs1900-8.dts       | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/target/linux/realtek/dts-5.10/rtl8380_zyxel_gs1900-8.dts b/target/linux/realtek/dts-5.10/rtl8380_zyxel_gs1900-8.dts
index e9c5efe60392..41266b701aca 100644
--- a/target/linux/realtek/dts-5.10/rtl8380_zyxel_gs1900-8.dts
+++ b/target/linux/realtek/dts-5.10/rtl8380_zyxel_gs1900-8.dts
@@ -10,3 +10,44 @@
 &gpio1 {
 	/delete-node/ poe_enable;
 };
+
+&switchcore {
+	port-leds {
+		compatible = "realtek,rtl8380-port-led";
+		#address-cells = <2>;
+		#size-cells = <0>;
+
+		led at 8.0 {
+			reg = <8 0>;
+			label = "lan1";
+		};
+		led at 9.0 {
+			reg = <9 0>;
+			label = "lan2";
+		};
+		led at 10.0 {
+			reg = <10 0>;
+			label = "lan3";
+		};
+		led at 11.0 {
+			reg = <11 0>;
+			label = "lan4";
+		};
+		led at 12.0 {
+			reg = <12 0>;
+			label = "lan5";
+		};
+		led at 13.0 {
+			reg = <13 0>;
+			label = "lan6";
+		};
+		led at 14.0 {
+			reg = <14 0>;
+			label = "lan7";
+		};
+		led at 15.0 {
+			reg = <15 0>;
+			label = "lan8";
+		};
+	};
+};
-- 
2.36.1




More information about the openwrt-devel mailing list