ramips: fix WAN LED for D-Link DIR-810L/TRENDnet TEW-810DR
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 9 Jun 2020 09:52:26 +0000 (11:52 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 10 Jun 2020 23:51:34 +0000 (01:51 +0200)
The WAN LED on DIR-810L was actually blinking on LAN1 port
activity. This has already been improved for the TEW-810DR, where
the GPIO has been set up explicitly rather than having it controlled
by the switch.

This patch also applies this setup to the DIR-810L.

In addition, the trigger in 01_leds is set up with
ucidef_set_led_switch for both devices now, so state changes should
be displayed correctly as well.

Reported-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net> [DIR-810L]
Tested-by: J. Scott Heppler <shep971@centurylink.net> [TEW-810DR]
target/linux/ramips/dts/mt7620a_cameo_810.dtsi
target/linux/ramips/dts/mt7620a_dlink_dir-810l.dts
target/linux/ramips/dts/mt7620a_trendnet_tew-810dr.dts
target/linux/ramips/mt7620/base-files/etc/board.d/01_leds

index 8ab166d283b17550bcb0a8817f7a5889b113d6a1..adbb4cf65cc3f57ec58ac1391f213558337f1990 100644 (file)
        mediatek,portmap = "llllw";
 };
 
+&gsw {
+       mediatek,port4 = "ephy";
+};
+
+&gpio2 {
+       status = "okay";
+};
+
 &wmac {
        pinctrl-names = "default";
        pinctrl-0 = <&pa_pins>;
index 63952d3e6492f39fd40d956624a06a7f2e621986..9dd9825433bfd6f7b3886a52af1fb70754ca9a47 100644 (file)
                        gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
                };
 
-               wan {
+               wan_orange {
                        label = "dir-810l:orange:wan";
                        gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
                };
 
+               wan_green {
+                       label = "dir-810l:green:wan";
+                       gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
+               };
+
                power_orange {
                        label = "dir-810l:orange:power";
                        gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
 
 &state_default {
        gpio {
-               groups = "i2c", "uartf";
+               groups = "i2c", "uartf", "ephy";
                function = "gpio";
        };
 };
-
-&gsw {
-       pinctrl-names = "default";
-       pinctrl-0 = <&ephy_pins>;
-
-       mediatek,port4 = "ephy";
-};
index 679b429b6de07972d05d33dd6c8699dab0f381f1..7437cde073a12b2279e3a61e2f56d782b6c67d8c 100644 (file)
                function = "gpio";
        };
 };
-
-&gsw {
-       mediatek,port4 = "ephy";
-};
-
-&gpio2 {
-       status = "okay";
-};
index e7b9413a48a0b850ff7fb5fc6a4c8f78ea9df822..2b2ac6b46b078c732c47fa1e1dcb19fa4be30b79 100755 (executable)
@@ -54,6 +54,10 @@ comfast,cf-wr800n)
        ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1
        set_wifi_led "$boardname:white:wifi"
        ;;
+dlink,dir-810l|\
+trendnet,tew-810dr)
+       ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
+       ;;
 dlink,dwr-116-a1|\
 head-weblink,hdrm200|\
 ohyeah,oy-0001|\
@@ -191,9 +195,6 @@ tplink,archer-mr200)
 tplink,re200-v1)
        ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
        ;;
-trendnet,tew-810dr)
-       ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" "eth0.2"
-       ;;
 youku,yk1)
        set_wifi_led "$boardname:blue:air"
        ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"