ipq40xx: convert to device-tree based USB LED trigger
authorChristian Lamparter <chunkeey@gmail.com>
Thu, 20 Dec 2018 21:43:30 +0000 (22:43 +0100)
committerChristian Lamparter <chunkeey@gmail.com>
Thu, 27 Dec 2018 13:36:23 +0000 (14:36 +0100)
Thanks to the ledtrig-usb.c the USB LED trigger can be
setup in the device-tree definition for the Asus RT-AC58U
and ZyXEL NBG6617.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
target/linux/ipq40xx/base-files/etc/board.d/01_leds
target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-nbg6617.dts
target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts
target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4018-nbg6617.dts
target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts

index 5e382c03a7d437eef8213a28ff5d088e863dcdce..5d10af0c08c6719d92bb767c532058d344943baa 100755 (executable)
@@ -14,7 +14,6 @@ case "$board" in
 asus,rt-ac58u)
        ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:blue:wlan2G" "phy0tpt"
        ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:blue:wlan5G" "phy1tpt"
-       ucidef_set_led_usbport "usb" "USB" "${boardname}:blue:usb" "usb1-port1" "usb2-port1" "usb3-port1" "usb4-port1"
        ucidef_set_led_netdev "wan" "WAN" "${boardname}:blue:wan" "eth1"
        ucidef_set_led_switch "lan" "LAN" "${boardname}:blue:lan" "switch0" "0x1e"
        ;;
@@ -43,7 +42,6 @@ meraki,mr33)
 zyxel,nbg6617)
        ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:green:wlan2G" "phy0tpt"
        ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:green:wlan5G" "phy1tpt"
-       ucidef_set_led_usbport "usb" "USB" "${boardname}:green:usb" "usb1-port1" "usb2-port1" "usb3-port1" "usb4-port1"
        ;;
 zyxel,wre6606)
        ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:green:wlan2g" "phy0tpt"
index 08ae27d682d82fe359f960cdb0b54b042402c4b7..8df3796dae81d65a29facbd45b81de720ae56ae2 100644 (file)
 
                usb2@60f8800 {
                        status = "okay";
+
+                       dwc3@6000000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               usb2_port1: port@1 {
+                                       reg = <1>;
+                                       #trigger-source-cells = <0>;
+                               };
+                       };
                };
 
                usb3@8af8800 {
                        status = "okay";
+
+                       dwc3@8a00000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               usb3_port1: port@1 {
+                                       reg = <1>;
+                                       #trigger-source-cells = <0>;
+                               };
+
+                               usb3_port2: port@2 {
+                                       reg = <2>;
+                                       #trigger-source-cells = <0>;
+                               };
+                       };
                };
 
                crypto@8e3a000 {
                usb {
                        label = "nbg6617:green:usb";
                        gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
+                       trigger-sources = <&usb2_port1>, <&usb3_port1>, <&usb3_port2>;
+                       linux,default-trigger = "usbport";
                };
 
                wlan2G {
index 6b90b596d9c6b0b0bdd622585d709f3f1512ef46..9a7c715518fc73d5ef3054f94514df98688292d3 100644 (file)
 
                usb2@60f8800 {
                        status = "okay";
+
+                       dwc3@6000000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               usb2_port1: port@1 {
+                                       reg = <1>;
+                                       #trigger-source-cells = <0>;
+                               };
+                       };
                };
 
                usb3@8af8800 {
                        status = "okay";
+
+                       dwc3@8a00000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               usb3_port1: port@1 {
+                                       reg = <1>;
+                                       #trigger-source-cells = <0>;
+                               };
+
+                               usb3_port2: port@2 {
+                                       reg = <2>;
+                                       #trigger-source-cells = <0>;
+                               };
+                       };
                };
 
                crypto@8e3a000 {
                usb {
                        label = "rt-ac58u:blue:usb";
                        gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
+                       trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>;
+                       linux,default-trigger = "usbport";
                };
 
                lan {
index 2ee8f075d7b008ddfcf301c07f5478fed06fb0d6..a8c144f928e5c8dea95f767944609a7d27052fff 100644 (file)
 
                usb2@60f8800 {
                        status = "okay";
+
+                       dwc3@6000000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               usb2_port1: port@1 {
+                                       reg = <1>;
+                                       #trigger-source-cells = <0>;
+                               };
+                       };
                };
 
                usb3@8af8800 {
                        status = "okay";
+
+                       dwc3@8a00000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               usb3_port1: port@1 {
+                                       reg = <1>;
+                                       #trigger-source-cells = <0>;
+                               };
+
+                               usb3_port2: port@2 {
+                                       reg = <2>;
+                                       #trigger-source-cells = <0>;
+                               };
+                       };
                };
 
                crypto@8e3a000 {
                usb {
                        label = "nbg6617:green:usb";
                        gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
+                       trigger-sources = <&usb2_port1>, <&usb3_port1>, <&usb3_port2>;
+                       linux,default-trigger = "usbport";
                };
 
                wlan2G {
index 0e09407f6f7cf52caec1f660f8e59a9d00e008ba..26c086ed25390fd4d4ed0ae759c8978ec4b6c9e3 100644 (file)
 
                usb2@60f8800 {
                        status = "okay";
+
+                       dwc3@6000000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               usb2_port1: port@1 {
+                                       reg = <1>;
+                                       #trigger-source-cells = <0>;
+                               };
+                       };
                };
 
                usb3@8af8800 {
                        status = "okay";
+
+                       dwc3@8a00000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               usb3_port1: port@1 {
+                                       reg = <1>;
+                                       #trigger-source-cells = <0>;
+                               };
+
+                               usb3_port2: port@2 {
+                                       reg = <2>;
+                                       #trigger-source-cells = <0>;
+                               };
+                       };
                };
 
                crypto@8e3a000 {
                usb {
                        label = "rt-ac58u:blue:usb";
                        gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
+                       trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>;
+                       linux,default-trigger = "usbport";
                };
 
                lan {