From: Mieczyslaw Nalewaj Date: Wed, 8 May 2024 18:32:03 +0000 (+0200) Subject: ramips: use function/color syntax for some dlink dir routers X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d646ea8a00aab7998e4d7bf80ba256cd65347d2c;p=openwrt%2Fopenwrt.git ramips: use function/color syntax for some dlink dir routers Abandoning the label and using the function/color syntax for some dlink dir series routers: dir-1960-a1, dir-2660-a1, dir-2640-a1, dir-3040-a1 and dir-3060-a1 Signed-off-by: Mieczyslaw Nalewaj --- diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts index 531076216d..a818400342 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include - #include "mt7621_dlink_dir_nand_128m.dtsi" / { diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts index fd25b94e8d..ba7b9a88dc 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts @@ -8,15 +8,19 @@ }; &leds { - usb2_white { - label = "white:usb2"; + led-4 { + function = LED_FUNCTION_USB; + color = ; + function-enumerator = <2>; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; trigger-sources = <&ehci_port2>; linux,default-trigger = "usbport"; }; - usb3_white { - label = "white:usb3"; + led-5 { + function = LED_FUNCTION_USB; + color = ; + function-enumerator = <3>; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; trigger-sources = <&xhci_ehci_port1>; linux,default-trigger = "usbport"; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts index d8c347198b..2ee0b8a5c3 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts @@ -8,15 +8,19 @@ }; &leds { - usb2_white { - label = "white:usb2"; + led-4 { + function = LED_FUNCTION_USB; + color = ; + function-enumerator = <2>; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; trigger-sources = <&ehci_port2>; linux,default-trigger = "usbport"; }; - usb3_white { - label = "white:usb3"; + led-5 { + function = LED_FUNCTION_USB; + color = ; + function-enumerator = <3>; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; trigger-sources = <&xhci_ehci_port1>; linux,default-trigger = "usbport"; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-3040-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-3040-a1.dts index 0bcfa022fa..5044ba3bdc 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-3040-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-3040-a1.dts @@ -12,32 +12,32 @@ }; &leds { - usb2_white { + led-4 { function = LED_FUNCTION_USB; color = ; - function-enumerator = <0>; + function-enumerator = <2>; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; trigger-sources = <&ehci_port2>; linux,default-trigger = "usbport"; }; - usb3_white { + led-5 { function = LED_FUNCTION_USB; color = ; - function-enumerator = <1>; + function-enumerator = <3>; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; trigger-sources = <&xhci_ehci_port1>; linux,default-trigger = "usbport"; }; - wlan2g { + led-6 { function = LED_FUNCTION_WLAN_2GHZ; color = ; gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy0radio"; }; - wlan5glb { + led-7 { function = LED_FUNCTION_WLAN_5GHZ; color = ; function-enumerator = <0>; @@ -45,7 +45,7 @@ linux,default-trigger = "phy1radio"; }; - wlan5ghb { + led-8 { function = LED_FUNCTION_WLAN_5GHZ; color = ; function-enumerator = <1>; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts index f581095a81..89e1189cf7 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts @@ -37,56 +37,67 @@ leds { compatible = "gpio-leds"; - led_power_orange: power_orange { + led_power_orange: led-0 { function = LED_FUNCTION_POWER; color = ; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; }; - led_power_white: power_white { + led_power_white: led-1 { function = LED_FUNCTION_POWER; color = ; gpios = <&gpio 16 GPIO_ACTIVE_LOW>; }; - led_net_orange: net_orange { - label = "orange:net"; + led_net_orange: led-2 { + function = LED_FUNCTION_WAN; + color = ; gpios = <&gpio 4 GPIO_ACTIVE_LOW>; }; - net_white { - label = "white:net"; + led-3 { + function = LED_FUNCTION_WAN; + color = ; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; }; - usb2_white { - label = "white:usb2"; + led-4 { + function = LED_FUNCTION_USB; + color = ; + function-enumerator = <2>; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; trigger-sources = <&ehci_port2>; linux,default-trigger = "usbport"; }; - usb3_white { - label = "white:usb3"; + led-5 { + function = LED_FUNCTION_USB; + color = ; + function-enumerator = <3>; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; trigger-sources = <&xhci_ehci_port1>; linux,default-trigger = "usbport"; }; - wlan2g { - label = "white:wlan2g"; + led-6 { + function = LED_FUNCTION_WLAN_2GHZ; + color = ; gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy0radio"; }; - wlan5glb { - label = "white:wlan5glb"; + led-7 { + function = LED_FUNCTION_WLAN_5GHZ; + color = ; + function-enumerator = <0>; gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy1radio"; }; - wlan5ghb { - label = "white:wlan5ghb"; + led-8 { + function = LED_FUNCTION_WLAN_5GHZ; + color = ; + function-enumerator = <1>; gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy2radio"; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir_nand_128m.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir_nand_128m.dtsi index d5adb8728c..147d64c4b0 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir_nand_128m.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir_nand_128m.dtsi @@ -34,25 +34,27 @@ leds: leds { compatible = "gpio-leds"; - led_power_orange: power_orange { + led_power_orange: led-0 { function = LED_FUNCTION_POWER; color = ; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; }; - led_power_white: power_white { + led_power_white: led-1 { function = LED_FUNCTION_POWER; color = ; gpios = <&gpio 16 GPIO_ACTIVE_LOW>; }; - led_net_orange: net_orange { - label = "orange:net"; + led_net_orange: led-2 { + function = LED_FUNCTION_WAN; + color = ; gpios = <&gpio 4 GPIO_ACTIVE_LOW>; }; - net_white { - label = "white:net"; + led-3 { + function = LED_FUNCTION_WAN; + color = ; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; }; }; diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 6848bebd00..d8beee9f0e 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -94,12 +94,12 @@ dlink,dap-x1860-a1) dlink,dir-1960-a1|\ dlink,dir-2640-a1|\ dlink,dir-2660-a1) - ucidef_set_led_netdev "wan" "wan" "white:net" "wan" + ucidef_set_led_netdev "wan" "wan" "white:wan" "wan" ;; dlink,dir-3040-a1|\ dlink,dir-3060-a1) - ucidef_set_led_netdev "net_white" "WAN Link" "white:net" "wan" "link" - ucidef_set_led_netdev "net_orange" "WAN Activity" "orange:net" "wan" "tx rx" + ucidef_set_led_netdev "net_white" "WAN Link" "white:wan" "wan" "link" + ucidef_set_led_netdev "net_orange" "WAN Activity" "orange:wan" "wan" "tx rx" ;; dlink,dir-853-a1|\ dlink,dir-853-a3) diff --git a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration index b595ae6fd1..30860346f4 100644 --- a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration @@ -4,6 +4,13 @@ board=$(board_name) case "$board" in +dlink,dir-1960-a1|\ +dlink,dir-2640-a1|\ +dlink,dir-2660-a1|\ +dlink,dir-3040-a1|\ +dlink,dir-3060-a1) + migrate_leds ':net=:wan' + ;; tplink,archer-a6-v3|\ tplink,archer-c6-v3) migrate_leds ':wifi2g$=:wlan-2' ':wifi5g$=:wlan-5'