[openwrt/openwrt] mpc85xx: add usb trigger to tl-wdr4900-v1 leds

LEDE Commits lede-commits at lists.infradead.org
Fri Aug 23 01:53:34 PDT 2024


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/71c6d99d57ce70ae643b3ba5a87dbb6dca1eb694

commit 71c6d99d57ce70ae643b3ba5a87dbb6dca1eb694
Author: Pawel Dembicki <paweldembicki at gmail.com>
AuthorDate: Thu Aug 22 13:45:11 2024 +0200

    mpc85xx: add usb trigger to tl-wdr4900-v1 leds
    
    TP-Link tl-wdr4900-v1 has two usb leds. Modern kernels can handle usb
    led trigger. Let's enable it.
    
    Signed-off-by: Pawel Dembicki <paweldembicki at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/16226
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts   | 21 +++++++++++++++++++++
 target/linux/mpc85xx/image/p1010.mk                 |  1 +
 2 files changed, 22 insertions(+)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
index cadf593fa6..b55fd2e7e7 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
@@ -118,6 +118,23 @@
 		usb at 22000 {
 			phy_type = "utmi";
 			dr_mode = "host";
+
+			port at 1 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <1>;
+				#trigger-source-cells = <0>;
+
+				hub_port1: port at 1 {
+					reg = <1>;
+					#trigger-source-cells = <0>;
+				};
+
+				hub_port2: port at 2 {
+					reg = <2>;
+					#trigger-source-cells = <0>;
+				};
+			};
 		};
 
 		mdio at 24000 {
@@ -334,6 +351,8 @@
 			color = <LED_COLOR_ID_GREEN>;
 			function = LED_FUNCTION_USB;
 			function-enumerator = <1>;
+			linux,default-trigger = "usbport";
+			trigger-sources = <&hub_port1>;
 		};
 
 		led-3 {
@@ -341,6 +360,8 @@
 			color = <LED_COLOR_ID_GREEN>;
 			function = LED_FUNCTION_USB;
 			function-enumerator = <2>;
+			linux,default-trigger = "usbport";
+			trigger-sources = <&hub_port2>;
 		};
 	};
 
diff --git a/target/linux/mpc85xx/image/p1010.mk b/target/linux/mpc85xx/image/p1010.mk
index a4f2d13dd4..1f898c483f 100644
--- a/target/linux/mpc85xx/image/p1010.mk
+++ b/target/linux/mpc85xx/image/p1010.mk
@@ -53,6 +53,7 @@ define Device/tplink_tl-wdr4900-v1
   DEVICE_VARIANT := v1
   DEVICE_COMPAT_VERSION := 1.1
   DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
+  DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
   TPLINK_HEADER_VERSION := 1
   TPLINK_HWID := 0x49000001
   TPLINK_HWREV := 1




More information about the lede-commits mailing list