ramips: expose ephy leds for miwifi-mini
authorDavid Yang <mmyangfl@gmail.com>
Sun, 11 Jul 2021 15:17:43 +0000 (23:17 +0800)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 24 Aug 2021 23:42:17 +0000 (01:42 +0200)
Give users more control by exposing ephy leds.

Signed-off-by: David Yang <mmyangfl@gmail.com>
[remove execute bit on 01_leds, add status for gpio2]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts
target/linux/ramips/mt7620/base-files/etc/board.d/01_leds

index b2e46a7a567e83b4feaf0b8b398b8bbad73c6491..9f5df5dd795a552786bf9b7795693900de78293c 100644 (file)
                        label = "red:status";
                        gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
                };
+
+               wan {
+                       label = "green:wan";
+                       gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
+               };
+
+               lan1 {
+                       label = "green:lan1";
+                       gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
+               };
+
+               lan2 {
+                       label = "green:lan2";
+                       gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
+               };
        };
 
        keys {
        status = "okay";
 };
 
+&gpio2 {
+       status = "okay";
+};
+
 &spi0 {
        status = "okay";
 
 };
 
 &ethernet {
-       pinctrl-names = "default";
-       pinctrl-0 = <&ephy_pins>;
-
        nvmem-cells = <&macaddr_factory_28>;
        nvmem-cell-names = "mac-address";
 
 
 &state_default {
        gpio {
-               groups = "i2c", "rgmii1";
+               groups = "ephy", "i2c", "rgmii1";
                function = "gpio";
        };
 };
index 5c104b98c270f0d51ffac3e3905d973de17e556f..ff3a5c8c0ca14e9e3e3ea15a4bcdf2dbc6444eaa 100644 (file)
@@ -207,6 +207,11 @@ wavlink,wl-wn579x3)
        ucidef_set_led_switch "lan" "lan" "blue:lan" "switch0" "0x20"
        ucidef_set_led_switch "wan" "wan" "blue:wan" "switch0" "0x10"
        ;;
+xiaomi,miwifi-mini)
+       ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x02"
+       ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x01"
+       ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
+       ;;
 zbtlink,zbt-ape522ii)
        ucidef_set_led_netdev "wlan2g4" "wlan1-link" "green:wlan2g4" "wlan1"
        ucidef_set_led_netdev "sys1" "wlan1" "green:sys1" "wlan1" "tx rx"