mpc85xx: add usb trigger to tl-wdr4900-v1 leds
authorPawel Dembicki <paweldembicki@gmail.com>
Thu, 22 Aug 2024 11:45:11 +0000 (13:45 +0200)
committerRobert Marko <robimarko@gmail.com>
Fri, 23 Aug 2024 08:53:29 +0000 (10:53 +0200)
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@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16226
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
target/linux/mpc85xx/image/p1010.mk

index cadf593fa6fd8eba6d285bc500fef24bc783d372..b55fd2e7e7483a267a61d3f382f867a81cf63dfd 100644 (file)
                usb@22000 {
                        phy_type = "utmi";
                        dr_mode = "host";
+
+                       port@1 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <1>;
+                               #trigger-source-cells = <0>;
+
+                               hub_port1: port@1 {
+                                       reg = <1>;
+                                       #trigger-source-cells = <0>;
+                               };
+
+                               hub_port2: port@2 {
+                                       reg = <2>;
+                                       #trigger-source-cells = <0>;
+                               };
+                       };
                };
 
                mdio@24000 {
                        color = <LED_COLOR_ID_GREEN>;
                        function = LED_FUNCTION_USB;
                        function-enumerator = <1>;
+                       linux,default-trigger = "usbport";
+                       trigger-sources = <&hub_port1>;
                };
 
                led-3 {
                        color = <LED_COLOR_ID_GREEN>;
                        function = LED_FUNCTION_USB;
                        function-enumerator = <2>;
+                       linux,default-trigger = "usbport";
+                       trigger-sources = <&hub_port2>;
                };
        };
 
index a4f2d13dd4e9241703a19be8310aa5dbfa8b233c..1f898c483f5b9e11cb19e5bceb315b8a4f7ba125 100644 (file)
@@ -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