[openwrt/openwrt] ramips: use led, function/color syntax for some tp-link archer routers

LEDE Commits lede-commits at lists.infradead.org
Thu May 9 13:27:11 PDT 2024


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/474b108dfe79dd9a068bd8a592ee1b8a75d525e4

commit 474b108dfe79dd9a068bd8a592ee1b8a75d525e4
Author: Mieczyslaw Nalewaj <namiltd at yahoo.com>
AuthorDate: Mon Apr 29 19:10:59 2024 +0200

    ramips: use led, function/color syntax for some tp-link archer routers
    
    Setting the LED name and abandoning the label and using the
    function/color syntax for some TP-Link Archer series routers:
    Archer C2 v1, Archer C20 v1, Archer C20i and Archer C50 v1
    
    Signed-off-by: Mieczyslaw Nalewaj <namiltd at yahoo.com>
---
 .../ramips/dts/mt7620a_tplink_archer-c2-v1.dts     | 10 +++++-----
 .../ramips/dts/mt7620a_tplink_archer-c20-v1.dts    | 22 ++++++++++++----------
 .../ramips/dts/mt7620a_tplink_archer-c20i.dts      | 10 +++++-----
 .../ramips/dts/mt7620a_tplink_archer-c50-v1.dts    | 22 ++++++++++++----------
 4 files changed, 34 insertions(+), 30 deletions(-)

diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts
index 10756e3b3c..b134398f44 100644
--- a/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts
+++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts
@@ -19,13 +19,13 @@
 	leds {
 		compatible = "gpio-leds";
 
-		lan {
+		led-0 {
 			function = LED_FUNCTION_LAN;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
 		};
 
-		usb {
+		led-1 {
 			function = LED_FUNCTION_USB;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
@@ -33,19 +33,19 @@
 			linux,default-trigger = "usbport";
 		};
 
-		led_wps: wps {
+		led_wps: led-2 {
 			function = LED_FUNCTION_WPS;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
 		};
 
-		wan {
+		led-3 {
 			function = LED_FUNCTION_WAN;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
 		};
 
-		wlan {
+		led-4 {
 			function = LED_FUNCTION_WLAN;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts
index 285e27c357..6b49fa6793 100644
--- a/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts
+++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts
@@ -16,20 +16,20 @@
 	leds {
 		compatible = "gpio-leds";
 
-		lan {
+		led-0 {
 			function = LED_FUNCTION_LAN;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
 		};
 
-		led_power: power {
+		led_power: led-1 {
 			function = LED_FUNCTION_POWER;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
 			default-state = "keep";
 		};
 
-		usb {
+		led-2 {
 			function = LED_FUNCTION_USB;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
@@ -37,31 +37,33 @@
 			linux,default-trigger = "usbport";
 		};
 
-		wan {
+		led-3 {
 			function = LED_FUNCTION_WAN;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
 		};
 
-		wan_orange {
+		led-4 {
 			function = LED_FUNCTION_WAN;
 			color = <LED_COLOR_ID_ORANGE>;
 			gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
 		};
 
-		wlan5g {
-			label = "blue:wlan5g";
+		led-5 {
+			function = LED_FUNCTION_WLAN_5GHZ;
+			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "phy0tpt";
 		};
 
-		wlan2g {
-			label = "blue:wlan2g";
+		led-6 {
+			function = LED_FUNCTION_WLAN_2GHZ;
+			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "phy1tpt";
 		};
 
-		wps {
+		led-7 {
 			function = LED_FUNCTION_WPS;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts
index 12141a6e59..0e461ceba5 100644
--- a/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts
+++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts
@@ -17,13 +17,13 @@
 	leds {
 		compatible = "gpio-leds";
 
-		lan {
+		led-0 {
 			function = LED_FUNCTION_LAN;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
 		};
 
-		usb {
+		led-1 {
 			function = LED_FUNCTION_USB;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
@@ -31,19 +31,19 @@
 			linux,default-trigger = "usbport";
 		};
 
-		led_wps: wps {
+		led_wps: led-2 {
 			function = LED_FUNCTION_WPS;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
 		};
 
-		wan {
+		led-3 {
 			function = LED_FUNCTION_WAN;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
 		};
 
-		wlan {
+		led-4 {
 			function = LED_FUNCTION_WLAN;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts
index 97b803470d..8581bbe49b 100644
--- a/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts
+++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts
@@ -16,20 +16,20 @@
 	leds {
 		compatible = "gpio-leds";
 
-		lan {
+		led-0 {
 			function = LED_FUNCTION_LAN;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
 		};
 
-		led_power: power {
+		led_power: led-1 {
 			function = LED_FUNCTION_POWER;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
 			default-state = "on";
 		};
 
-		usb {
+		led-2 {
 			function = LED_FUNCTION_USB;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
@@ -37,31 +37,33 @@
 			linux,default-trigger = "usbport";
 		};
 
-		wan {
+		led-3 {
 			function = LED_FUNCTION_WAN;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
 		};
 
-		wan_orange {
+		led-4 {
 			function = LED_FUNCTION_WAN;
 			color = <LED_COLOR_ID_ORANGE>;
 			gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
 		};
 
-		wlan5g {
-			label = "green:wlan5g";
+		led-5 {
+			function = LED_FUNCTION_WLAN_5GHZ;
+			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "phy0tpt";
 		};
 
-		wlan2g {
-			label = "green:wlan2g";
+		led-6 {
+			function = LED_FUNCTION_WLAN_2GHZ;
+			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "phy1tpt";
 		};
 
-		wps {
+		led-7 {
 			function = LED_FUNCTION_WPS;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;




More information about the lede-commits mailing list