lantiq: vr9: set the usb led trigger via devicetree
authorMathias Kresin <dev@kresin.me>
Wed, 17 Feb 2021 19:52:12 +0000 (20:52 +0100)
committerMathias Kresin <dev@kresin.me>
Sun, 28 Feb 2021 23:19:58 +0000 (00:19 +0100)
Assign the usbdev trigger via devicetree and drop the userspace
handling of the usb leds.

Drop the now unused userspace helper code as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9.dtsi
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts
target/linux/lantiq/xrx200/base-files/etc/board.d/01_leds

index 60f7f7a4c0a21106d1880a173a9063827be5585d..85c584c1f1686728919e2e493a5e8d0012ab1646 100644 (file)
                };
 
                usb0: usb@e101000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                        status = "disabled";
                        compatible = "lantiq,xrx200-usb";
                        reg = <0xe101000 0x1000
                        dr_mode = "host";
                        phys = <&usb_phy0>;
                        phy-names = "usb2-phy";
+
+                       ehci_port1: port@1 {
+                               reg = <1>;
+                               #trigger-source-cells = <0>;
+                       };
                };
 
                usb1: usb@e106000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                        status = "disabled";
                        compatible = "lantiq,xrx200-usb";
                        reg = <0xe106000 0x1000>;
                        dr_mode = "host";
                        phys = <&usb_phy1>;
                        phy-names = "usb2-phy";
+
+                       ehci_port2: port@1 {
+                               reg = <1>;
+                               #trigger-source-cells = <0>;
+                       };
                };
 
                eth0: eth@e108000 {
index f5b0b4f2a1e23bf76f0230b7ead6e12a117a391a..9cac3e6ec059e56afcfd05f7bd7818d69efad9e1 100644 (file)
@@ -15,9 +15,6 @@
                led-failsafe = &power;
                led-running = &power;
                led-upgrade = &power;
-
-               led-usb = &led_usb1;
-               led-usb2 = &led_usb2;
        };
 
        memory@0 {
                        label = "green:fxo";
                        gpios = <&stp 19 GPIO_ACTIVE_HIGH>;
                };
-               led_usb1: usb1 {
+               usb1 {
                        label = "green:usb1";
                        gpios = <&stp 18 GPIO_ACTIVE_HIGH>;
+                       trigger-sources = <&ehci_port1>;
+                       linux,default-trigger = "usbport";
                };
-               led_usb2: usb2 {
+
+               usb2 {
                        label = "green:usb2";
                        gpios = <&stp 15 GPIO_ACTIVE_HIGH>;
+                       trigger-sources = <&ehci_port2>;
+                       linux,default-trigger = "usbport";
                };
                sd {
                        label = "green:sd";
index aa6c308ffee3561b53853062fcfe13321e670ca0..d33b817f2d70bc1f6f206fb623b7060d409fb89e 100644 (file)
@@ -18,8 +18,6 @@
                led-dsl = &led_dsl;
                led-internet = &led_internet;
                led-wifi = &led_wifi;
-               led-usb = &led_usb0;
-               led-usb2 = &led_usb2;
        };
 
        memory@0 {
                        gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
                };
 
-               led_usb0: usb0 {
+               usb0 {
                        label = "green:usb";
                        gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
+                       trigger-sources = <&ehci_port1>;
+                       linux,default-trigger = "usbport";
                };
 
-               led_usb2: usb2 {
+               usb2 {
                        label = "green:usb2";
                        gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
+                       trigger-sources = <&ehci_port2>;
+                       linux,default-trigger = "usbport";
                };
 
                led_wps: wps {
index 19cfb822eb4df61c7bd8a992ad205ca3da2c5421..aa76f66267f7d215f9c8a5154fc55f82908317e0 100644 (file)
@@ -13,9 +13,6 @@
                led-dsl = &led_dsl;
                led-internet = &led_internet;
                led-wifi = &led_wlan5g;
-
-               led-usb = &led_usb;
-               led-usb2 = &led_usb;
        };
 
        memory@0 {
                        gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
                };
 
-               led_usb: usb {
+               usb {
                        label = "blue:usb";
                        gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
+                       trigger-sources = <&ehci_port1>, <&ehci_port2>;
+                       linux,default-trigger = "usbport";
                };
 
                eth {
index 2812df7e68656631c743f8fb53a9e1e7d40710cf..0e029d1995665d565e498025776ca6f83c18aa76 100644 (file)
@@ -4,19 +4,18 @@
        compatible = "zyxel,p-2812hnu-f1", "zyxel,p-2812hnu", "lantiq,xway", "lantiq,vr9";
        model = "ZyXEL P-2812HNU-F1";
 
-       aliases {
-               led-usb = &led_usb1;
-               led-usb2 = &led_usb2;
-       };
-
        leds {
-               led_usb1: usb1 {
+               usb1 {
                        label = "green:usb1";
                        gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
+                       trigger-sources = <&ehci_port1>;
+                       linux,default-trigger = "usbport";
                };
-               led_usb2: usb2 {
+               usb2 {
                        label = "green:usb2";
                        gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
+                       trigger-sources = <&ehci_port2>;
+                       linux,default-trigger = "usbport";
                };
        };
 };
index 6a19f52a1eb45fab38e35e026513946d8c788356..6fd8151a4fccb4afa07e7058be0d67fd4dda4a66 100755 (executable)
@@ -11,12 +11,6 @@ board_config_update
 led_wifi="$(get_dt_led wifi)"
 [ -n "$led_wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "$led_wifi" "phy0tpt"
 
-led_usb="$(get_dt_led usb)"
-[ -n "$led_usb" ] && ucidef_set_led_usbdev "usb" "usb" "$led_usb" "1-1"
-
-led_usb2="$(get_dt_led usb2)"
-[ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1"
-
 led_dsl="$(get_dt_led dsl)"
 [ -n "$led_dsl" ] && {
        led_internet="$(get_dt_led internet)"