[openwrt/openwrt] ramips: add missing LEDs to Asus RT-AX53U

LEDE Commits lede-commits at lists.infradead.org
Sun Apr 2 07:13:28 PDT 2023


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/a3fbeb2cbbfc315264840f300bc2d1ffb500eaba

commit a3fbeb2cbbfc315264840f300bc2d1ffb500eaba
Author: Marian Sarcinschi <znevna at gmail.com>
AuthorDate: Fri Dec 23 01:56:09 2022 +0200

    ramips: add missing LEDs to Asus RT-AX53U
    
    This patch adds the missing LEDs to Asus RT-AX53U.
    Based on PR #10400 and patch provided in #11068
     - enable the two LEDs controlled by mt7915e for wireless;
     - add label to power LED so it works properly and fix formatting;
     - add the USB LED;
     - switch LEDs are best left to be controlled by hardware for now.
    
    Co-Authored-By: Ivan Rozhuk <rozhuk.im at gmail.com>
    Co-Authored-By: Shiji Yang <yangshiji66 at qq.com>
    Co-Authored-By: Hartmut Birr <e9hack at gmail.com>
    Tested-by: Felix Baumann <felix.bau at gmx.de>
    Tested-by: Marian Sarcinschi <znevna at gmail.com>
    Signed-off-by: Marian Sarcinschi <znevna at gmail.com>
    (cherry picked from commit c4b806d5c4ccc653968620e6e9aec93bc4e370e5)
---
 target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts          | 14 ++++++++++++--
 target/linux/ramips/image/mt7621.mk                       |  3 ++-
 target/linux/ramips/mt7621/base-files/etc/board.d/01_leds |  5 +++++
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts
index aabd90ce64..a958d9909a 100644
--- a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts
+++ b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts
@@ -26,11 +26,21 @@
 	leds {
 		compatible = "gpio-leds";
 
-		led_power: led-0 {
+		led_power: power {
+			label = "blue:power";
 			color = <LED_COLOR_ID_BLUE>;
-                        function = LED_FUNCTION_POWER;
+			function = LED_FUNCTION_POWER;
 			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
 		};
+
+		led_usb {
+			label = "blue:usb";
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_USB;
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+			trigger-sources = <&ehci_port2>;
+			linux,default-trigger = "usbport";
+		};
 	};
 
 	keys {
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 1fb8060434..cbe56c7b77 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -250,7 +250,8 @@ define Device/asus_rt-ax53u
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
 	check-size
-  DEVICE_PACKAGES := kmod-mt7915e kmod-usb3 uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7915e kmod-usb3 uboot-envtools \
+	kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += asus_rt-ax53u
 
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 18a26cdfc0..c7aeabb0fc 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -7,6 +7,11 @@ board=$(board_name)
 board_config_update
 
 case $board in
+asus,rt-ax53u)
+	ucidef_set_led_usbport "usb" "USB" "blue:usb" "usb1-port2"
+	ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "mt76-phy0" "phy0tpt"
+	ucidef_set_led_wlan "wlan5g" "WiFi 5GHz" "mt76-phy1" "phy1tpt"
+	;;
 asus,rt-n56u-b1)
 	ucidef_set_led_netdev "lan" "LAN link" "blue:lan" "br-lan"
 	ucidef_set_led_netdev "wan" "WAN link" "blue:wan" "wan"




More information about the lede-commits mailing list