From: David Yang Date: Sun, 11 Jul 2021 15:17:43 +0000 (+0800) Subject: ramips: expose ephy leds for miwifi-mini X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=38cb5005166dd49fb3d69ba68a905b97cc23f6a3;p=openwrt%2Fstaging%2Flynxis.git ramips: expose ephy leds for miwifi-mini Give users more control by exposing ephy leds. Signed-off-by: David Yang [remove execute bit on 01_leds, add status for gpio2] Signed-off-by: Adrian Schmutzler --- diff --git a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts index b2e46a7a56..9f5df5dd79 100644 --- a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts +++ b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts @@ -37,6 +37,21 @@ 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 { @@ -54,6 +69,10 @@ status = "okay"; }; +&gpio2 { + status = "okay"; +}; + &spi0 { status = "okay"; @@ -119,9 +138,6 @@ }; ðernet { - pinctrl-names = "default"; - pinctrl-0 = <&ephy_pins>; - nvmem-cells = <&macaddr_factory_28>; nvmem-cell-names = "mac-address"; @@ -148,7 +164,7 @@ &state_default { gpio { - groups = "i2c", "rgmii1"; + groups = "ephy", "i2c", "rgmii1"; function = "gpio"; }; }; diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index 5c104b98c2..ff3a5c8c0c 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -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"