[openwrt/openwrt] mpc85xx: overhaul WS-AP3825i LED setup

LEDE Commits lede-commits at lists.infradead.org
Thu Mar 24 15:26:19 PDT 2022


blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/9024f1e466f5ab64bc752d8a463d1867a2ba8d8e

commit 9024f1e466f5ab64bc752d8a463d1867a2ba8d8e
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Thu Mar 24 23:09:24 2022 +0100

    mpc85xx: overhaul WS-AP3825i LED setup
    
    As the LED controller is working now, we can make good use of the LEDs
    now.
    
     - Drop the model-name prefix
     - Rename eth0 / eth1 LEDs to LAN1 / LAN2, as they are labeled as such
       on the casing
     - Enable wired LEDs in userspace
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 .../linux/mpc85xx/base-files/etc/board.d/01_leds   | 19 +++++++++++++++++
 .../files/arch/powerpc/boot/dts/ws-ap3825i.dts     | 24 +++++++++++-----------
 2 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/target/linux/mpc85xx/base-files/etc/board.d/01_leds b/target/linux/mpc85xx/base-files/etc/board.d/01_leds
new file mode 100644
index 0000000000..391c909e4c
--- /dev/null
+++ b/target/linux/mpc85xx/base-files/etc/board.d/01_leds
@@ -0,0 +1,19 @@
+
+. /lib/functions/leds.sh
+. /lib/functions/uci-defaults.sh
+
+board=$(board_name)
+boardname="${board##*,}"
+
+board_config_update
+
+case $board in
+extreme-networks,ws-ap3825i)
+	ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth1"
+	ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth0"
+	;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts
index 7385f3402c..43c044b4fc 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts
@@ -31,44 +31,44 @@
 
 		wifi1 {
 			gpios = <&spi_gpio 3 GPIO_ACTIVE_HIGH>;
-			label = "ws-ap3825i:green:radio1";
+			label = "green:radio1";
 			linux,default-trigger = "phy0tpt";
 		};
 
 		wifi2 {
 			gpios = <&spi_gpio 2 GPIO_ACTIVE_HIGH>;
-			label = "ws-ap3825i:green:radio2";
+			label = "green:radio2";
 			linux,default-trigger = "phy1tpt";
 		};
 
 		led_power_green: power_green {
 			gpios = <&spi_gpio 0 GPIO_ACTIVE_HIGH>;
-			label = "ws-ap3825i:green:power";
+			label = "green:power";
 		};
 
 		led_power_red: power_red {
 			gpios = <&spi_gpio 1 GPIO_ACTIVE_HIGH>;
-			label = "ws-ap3825i:red:power";
+			label = "red:power";
 		};
 
-		eth0_red {
+		lan1_red {
 			gpios = <&spi_gpio 6 GPIO_ACTIVE_HIGH>;
-			label = "ws-ap3825i:red:eth0";
+			label = "red:lan1";
 		};
 
-		eth0_green {
+		lan1_green {
 			gpios = <&spi_gpio 4 GPIO_ACTIVE_HIGH>;
-			label = "ws-ap3825i:green:eth0";
+			label = "green:lan1";
 		};
 
-		eth1_red {
+		lan2_red {
 			gpios = <&spi_gpio 7 GPIO_ACTIVE_HIGH>;
-			label = "ws-ap3825i:red:eth1";
+			label = "red:lan2";
 		};
 
-		eth1_green {
+		lan2_green {
 			gpios = <&spi_gpio 5 GPIO_ACTIVE_HIGH>;
-			label = "ws-ap3825i:green:eth1";
+			label = "green:lan2";
 		};
 	};
 




More information about the lede-commits mailing list