[PATCH v3 08/13] realtek: Zyxel GS1900-8: define port LEDs

Sander Vanheule sander at svanheule.net
Sun Oct 30 11:31:01 PDT 2022


The GS1900-8 has one green status LED per port. To reproduce the same
behaviour as stock firmware, the LEDs need to light up on all supported
link speeds, and blink on link activity.

Signed-off-by: Sander Vanheule <sander at svanheule.net>
---
Changes in v3:
- Add LED triggers
---
 .../dts-5.10/rtl8380_zyxel_gs1900-8.dts       | 86 +++++++++++++++++++
 1 file changed, 86 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..6de1a2442edc 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
@@ -1,5 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/leds/realtek-led-trigger.h>
+
 #include "rtl8380_zyxel_gs1900.dtsi"
 
 / {
@@ -10,3 +13,86 @@
 &gpio1 {
 	/delete-node/ poe_enable;
 };
+
+&switchcore {
+	port-leds {
+		compatible = "realtek,maple-port-led";
+		#address-cells = <3>;
+		#size-cells = <0>;
+
+		realtek,output-mode = "serial";
+
+		led at 8.0.0 {
+			reg = <8 0 0>;
+			label = "green:lan-1";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <1>;
+			linux,default-trigger = "realtek-switchport";
+			realtek,port-led-trigger = <(RTL_LED_ACT | RTL_LED_LINK_10_100_1000)>;
+		};
+		led at 9.0.0 {
+			reg = <9 0 0>;
+			label = "green:lan-2";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <2>;
+			linux,default-trigger = "realtek-switchport";
+			realtek,port-led-trigger = <(RTL_LED_ACT | RTL_LED_LINK_10_100_1000)>;
+		};
+		led at 10.0.0 {
+			reg = <10 0 0>;
+			label = "green:lan-3";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <3>;
+			linux,default-trigger = "realtek-switchport";
+			realtek,port-led-trigger = <(RTL_LED_ACT | RTL_LED_LINK_10_100_1000)>;
+		};
+		led at 11.0.0 {
+			reg = <11 0 0>;
+			label = "green:lan-4";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <4>;
+			linux,default-trigger = "realtek-switchport";
+			realtek,port-led-trigger = <(RTL_LED_ACT | RTL_LED_LINK_10_100_1000)>;
+		};
+		led at 12.0.0 {
+			reg = <12 0 0>;
+			label = "green:lan-5";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <5>;
+			linux,default-trigger = "realtek-switchport";
+			realtek,port-led-trigger = <(RTL_LED_ACT | RTL_LED_LINK_10_100_1000)>;
+		};
+		led at 13.0.0 {
+			reg = <13 0 0>;
+			label = "green:lan-6";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <6>;
+			linux,default-trigger = "realtek-switchport";
+			realtek,port-led-trigger = <(RTL_LED_ACT | RTL_LED_LINK_10_100_1000)>;
+		};
+		led at 14.0.0 {
+			reg = <14 0 0>;
+			label = "green:lan-7";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <7>;
+			linux,default-trigger = "realtek-switchport";
+			realtek,port-led-trigger = <(RTL_LED_ACT | RTL_LED_LINK_10_100_1000)>;
+		};
+		led at 15.0.0 {
+			reg = <15 0 0>;
+			label = "green:lan-8";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <8>;
+			linux,default-trigger = "realtek-switchport";
+			realtek,port-led-trigger = <(RTL_LED_ACT | RTL_LED_LINK_10_100_1000)>;
+		};
+	};
+};
-- 
2.38.1




More information about the openwrt-devel mailing list