diff mbox series

[v2,09/16] realtek: Zyxel GS1900-8: define port LEDs

Message ID 0af9d0cdbbcb223d6cf37268333c4585536dca22.1664830160.git.sander@svanheule.net
State Superseded
Delegated to: Sander Vanheule
Headers show
Series realtek: pinctrl and switch LED drivers | expand

Commit Message

Sander Vanheule Oct. 3, 2022, 8:52 p.m. UTC
The GS1900-8 had 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:

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

Signed-off-by: Sander Vanheule <sander@svanheule.net>
---
 .../dts-5.10/rtl8380_zyxel_gs1900-8.dts       | 69 +++++++++++++++++++
 1 file changed, 69 insertions(+)
diff mbox series

Patch

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..57d148ac83a8 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,7 @@ 
 // SPDX-License-Identifier: GPL-2.0-or-later
 
+#include <dt-bindings/leds/common.h>
+
 #include "rtl8380_zyxel_gs1900.dtsi"
 
 / {
@@ -10,3 +12,70 @@ 
 &gpio1 {
 	/delete-node/ poe_enable;
 };
+
+&switchcore {
+	port-leds {
+		compatible = "realtek,maple-port-led";
+		#address-cells = <3>;
+		#size-cells = <0>;
+
+		realtek,output-mode = "serial";
+
+		led@8.0.0 {
+			reg = <8 0 0>;
+			label = "green:lan-1";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <1>;
+		};
+		led@9.0.0 {
+			reg = <9 0 0>;
+			label = "green:lan-2";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <2>;
+		};
+		led@10.0.0 {
+			reg = <10 0 0>;
+			label = "green:lan-3";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <3>;
+		};
+		led@11.0.0 {
+			reg = <11 0 0>;
+			label = "green:lan-4";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <4>;
+		};
+		led@12.0.0 {
+			reg = <12 0 0>;
+			label = "green:lan-5";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <5>;
+		};
+		led@13.0.0 {
+			reg = <13 0 0>;
+			label = "green:lan-6";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <6>;
+		};
+		led@14.0.0 {
+			reg = <14 0 0>;
+			label = "green:lan-7";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <7>;
+		};
+		led@15.0.0 {
+			reg = <15 0 0>;
+			label = "green:lan-8";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			function-enumerator = <8>;
+		};
+	};
+};