From: Mikhail Zhilkin Date: Sun, 3 Dec 2023 12:40:46 +0000 (+0000) Subject: ramips: update leds & buttons dts description X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8226c8d306be0d617016f9c8e3f1659ef41e8ca6;p=openwrt%2Fopenwrt.git ramips: update leds & buttons dts description This commit: 1. Removes deprecated "label" property from the dts leds subnnodes; 2. Updates buttons and leds dts description according to kernel docs examples. Scope: devices well known to me. Run-tested: TP-Link ec330-g5u, WiFire S1500.nbn Signed-off-by: Mikhail Zhilkin --- diff --git a/target/linux/ramips/dts/mt7620a_sercomm_cpj.dtsi b/target/linux/ramips/dts/mt7620a_sercomm_cpj.dtsi index e903f9f729..8c565385e8 100644 --- a/target/linux/ramips/dts/mt7620a_sercomm_cpj.dtsi +++ b/target/linux/ramips/dts/mt7620a_sercomm_cpj.dtsi @@ -38,14 +38,12 @@ compatible = "gpio-leds"; status_green: led-0 { - label = "green:status"; gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; color = ; function = LED_FUNCTION_STATUS; }; status_amber: led-1 { - label = "amber:status"; gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; color = ; function = LED_FUNCTION_STATUS; diff --git a/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi b/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi index 7b3f316a8c..93570823b3 100644 --- a/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi +++ b/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi @@ -17,15 +17,13 @@ leds { compatible = "gpio-leds"; - led_status_green: led-1 { - label = "green:status"; + led_status_green: led-0 { color = ; function = LED_FUNCTION_STATUS; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; - led_status_red: led-2 { - label = "red:status"; + led_status_red: led-1 { color = ; function = LED_FUNCTION_STATUS; gpios = <&gpio 16 GPIO_ACTIVE_LOW>; @@ -35,7 +33,7 @@ keys { compatible = "gpio-keys"; - reset { + button-0 { label = "reset"; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; linux,code = ; diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-flash.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-flash.dts index d373a801d2..36f2532161 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-flash.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-flash.dts @@ -7,8 +7,7 @@ model = "Beeline SmartBox Flash"; leds { - led-0 { - label = "blue:wan"; + led-2 { color = ; function = LED_FUNCTION_WAN; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts index f2a99a63a8..c1bf5c899b 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts @@ -23,21 +23,18 @@ compatible = "gpio-leds"; led_status_green: led-0 { - label = "green:status"; color = ; function = LED_FUNCTION_STATUS; gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; }; led-1 { - label = "blue:wan"; color = ; function = LED_FUNCTION_WAN; gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; }; led_status_red: led-2 { - label = "red:status"; color = ; function = LED_FUNCTION_STATUS; gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; @@ -47,7 +44,7 @@ keys { compatible = "gpio-keys"; - reset { + button-0 { label = "reset"; gpios = <&gpio 4 GPIO_ACTIVE_LOW>; linux,code = ; diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts index e2c0165e6b..912b191049 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts @@ -11,7 +11,7 @@ }; keys { - switch_bt { + switch-0 { label = "ROUT<->REP Switch_bt"; gpios = <&gpio 6 GPIO_ACTIVE_LOW>; linux,input-type = ; @@ -39,7 +39,6 @@ }; &led_wps { - label = "blue:wps"; color = ; }; diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts index 00f4957c57..4af425a648 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts @@ -23,21 +23,18 @@ compatible = "gpio-leds"; led-0 { - label = "blue:wan"; color = ; function = LED_FUNCTION_WAN; gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; }; led_status_green: led-1 { - label = "green:status"; color = ; function = LED_FUNCTION_STATUS; gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; }; led_status_red: led-2 { - label = "red:status"; color = ; function = LED_FUNCTION_STATUS; gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; @@ -47,13 +44,13 @@ keys { compatible = "gpio-keys"; - wps { + button-0 { label = "wps"; gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; linux,code = ; }; - reset { + button-1 { label = "reset"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; linux,code = ; diff --git a/target/linux/ramips/dts/mt7621_etisalat_s3.dts b/target/linux/ramips/dts/mt7621_etisalat_s3.dts index 64e21bb704..2581e05a90 100644 --- a/target/linux/ramips/dts/mt7621_etisalat_s3.dts +++ b/target/linux/ramips/dts/mt7621_etisalat_s3.dts @@ -23,21 +23,18 @@ compatible = "gpio-leds"; led-0 { - label = "blue:wan"; color = ; function = LED_FUNCTION_WAN; gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; }; led_status_green: led-1 { - label = "green:status"; color = ; function = LED_FUNCTION_STATUS; gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; }; led_status_red: led-2 { - label = "red:status"; color = ; function = LED_FUNCTION_STATUS; gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; @@ -47,13 +44,13 @@ keys { compatible = "gpio-keys"; - wps { + button-0 { label = "wps"; gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; linux,code = ; }; - reset { + button-1 { label = "reset"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; linux,code = ; diff --git a/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi b/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi index 36d576108d..0416a5f980 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi +++ b/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi @@ -19,22 +19,19 @@ leds { compatible = "gpio-leds"; - led-1 { - label = "blue:wan"; + led-0 { color = ; function = LED_FUNCTION_WAN; gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; }; - led_status_green: led-0 { - label = "green:status"; + led_status_green: led-1 { color = ; function = LED_FUNCTION_STATUS; gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; }; led_status_red: led-2 { - label = "red:status"; color = ; function = LED_FUNCTION_STATUS; gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; @@ -44,13 +41,13 @@ keys { compatible = "gpio-keys"; - wps { + button-0 { label = "wps"; gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; linux,code = ; }; - reset { + button-1 { label = "reset"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; linux,code = ; diff --git a/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi b/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi index 09862b8067..8b2bb6b949 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi +++ b/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi @@ -17,13 +17,13 @@ keys { compatible = "gpio-keys"; - reset { + button-0 { label = "reset"; gpios = <&gpio 7 GPIO_ACTIVE_LOW>; linux,code = ; }; - wps { + button-1 { label = "wps"; gpios = <&gpio 18 GPIO_ACTIVE_LOW>; linux,code = ; @@ -34,33 +34,29 @@ compatible = "gpio-leds"; led-0 { - label = "amber:lan4"; color = ; function = LED_FUNCTION_LAN; - function-enumerator = <0>; + function-enumerator = <4>; linux,default-trigger = "mt7530-0:00:1Gbps"; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; }; led-1 { - label = "green:lan4"; color = ; function = LED_FUNCTION_LAN; - function-enumerator = <1>; + function-enumerator = <4>; gpios = <&gpio 4 GPIO_ACTIVE_LOW>; }; led-2 { - label = "amber:lan3"; color = ; function = LED_FUNCTION_LAN; - function-enumerator = <2>; + function-enumerator = <3>; linux,default-trigger = "mt7530-0:01:1Gbps"; gpios = <&gpio 10 GPIO_ACTIVE_LOW>; }; led-3 { - label = "green:lan3"; color = ; function = LED_FUNCTION_LAN; function-enumerator = <3>; @@ -68,85 +64,72 @@ }; led-4 { - label = "amber:lan2"; color = ; function = LED_FUNCTION_LAN; - function-enumerator = <4>; + function-enumerator = <2>; linux,default-trigger = "mt7530-0:02:1Gbps"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; led-5 { - label = "amber:lan1"; color = ; function = LED_FUNCTION_LAN; - function-enumerator = <5>; + function-enumerator = <1>; linux,default-trigger = "mt7530-0:03:1Gbps"; gpios = <&gpio 22 GPIO_ACTIVE_LOW>; }; led-6 { - label = "green:lan1"; color = ; function = LED_FUNCTION_LAN; - function-enumerator = <6>; + function-enumerator = <1>; gpios = <&gpio 23 GPIO_ACTIVE_LOW>; }; led-7 { - label = "amber:wan"; color = ; function = LED_FUNCTION_WAN; - function-enumerator = <0>; linux,default-trigger = "mt7530-0:04:1Gbps"; gpios = <&gpio 24 GPIO_ACTIVE_LOW>; }; led-8 { - label = "green:wan"; color = ; function = LED_FUNCTION_WAN; - function-enumerator = <1>; gpios = <&gpio 25 GPIO_ACTIVE_LOW>; }; led-9 { - label = "green:lan2"; color = ; function = LED_FUNCTION_LAN; - function-enumerator = <7>; + function-enumerator = <2>; gpios = <&gpio 26 GPIO_ACTIVE_LOW>; }; led-10 { - label = "white:wlan2g"; color = ; function = LED_FUNCTION_WLAN; - function-enumerator = <0>; + function-enumerator = <24>; linux,default-trigger = "phy1radio"; gpios = <&gpio 28 GPIO_ACTIVE_LOW>; }; led_wps: led-11 { function = LED_FUNCTION_WPS; - function-enumerator = <0>; gpios = <&gpio 29 GPIO_ACTIVE_LOW>; panic-indicator; }; led_status: led-12 { - label = "white:status"; color = ; function = LED_FUNCTION_STATUS; - function-enumerator = <0>; gpios = <&gpio 30 GPIO_ACTIVE_LOW>; }; led-13 { - label = "white:wlan5g"; color = ; function = LED_FUNCTION_WLAN; - function-enumerator = <1>; + function-enumerator = <50>; linux,default-trigger = "phy0radio"; gpios = <&gpio 32 GPIO_ACTIVE_LOW>; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts index 84b3efe8df..a1b458edd5 100644 --- a/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts @@ -29,67 +29,54 @@ led-0 { color = ; function = LED_FUNCTION_USB; - function-enumerator = <0>; gpios = <&gpio 0 GPIO_ACTIVE_LOW>; trigger-sources = <&xhci_ehci_port1>; linux,default-trigger = "usbport"; }; led-1 { - label = "blue:wps"; color = ; function = LED_FUNCTION_WPS; - function-enumerator = <0>; gpios = <&gpio 5 GPIO_ACTIVE_LOW>; }; led-2 { - label = "blue:ethernet"; color = ; function = LED_FUNCTION_LAN; - function-enumerator = <0>; gpios = <&gpio 9 GPIO_ACTIVE_LOW>; }; led-3 { - label = "amber:internet"; color = ; function = LED_FUNCTION_WAN; - function-enumerator = <0>; gpios = <&gpio 13 GPIO_ACTIVE_LOW>; }; led-4 { - label = "blue:internet"; color = ; function = LED_FUNCTION_WAN; - function-enumerator = <1>; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; led-5 { - label = "blue:wireless_5g"; color = ; function = LED_FUNCTION_WLAN; - function-enumerator = <0>; + function-enumerator = <50>; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy1tpt"; }; led-6 { - label = "blue:wireless_2g"; color = ; function = LED_FUNCTION_WLAN; - function-enumerator = <1>; + function-enumerator = <24>; gpios = <&gpio 16 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy0tpt"; }; led_power: led-7 { - label = "blue:power"; color = ; - function = LED_FUNCTION_STATUS; - function-enumerator = <0>; + function = LED_FUNCTION_POWER; gpios = <&gpio 18 GPIO_ACTIVE_LOW>; }; }; @@ -97,28 +84,28 @@ keys { compatible = "gpio-keys"; - led { + button-0 { label = "led"; gpios = <&gpio 4 GPIO_ACTIVE_LOW>; debounce-interval = <60>; linux,code = ; }; - wifi { + button-1 { label = "wifi on/off"; gpios = <&gpio 7 GPIO_ACTIVE_LOW>; debounce-interval = <60>; linux,code = ; }; - reset { + button-2 { label = "reset"; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; debounce-interval = <60>; linux,code = ; }; - wps { + button-3 { label = "wps"; gpios = <&gpio 10 GPIO_ACTIVE_LOW>; debounce-interval = <60>; diff --git a/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts b/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts index 4ffe988153..a3cc6038c0 100644 --- a/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts +++ b/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts @@ -28,7 +28,6 @@ }; &led_wps { - label = "white:wps"; color = ; }; 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 51afb9cf41..1061de6f44 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 @@ -48,10 +48,10 @@ rostelecom,rt-sf-1) ;; beeline,smartbox-pro|\ wifire,s1500-nbn) - ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1" "link tx rx" - ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2" "link tx rx" - ucidef_set_led_netdev "lan3" "lan3" "green:lan3" "lan3" "link tx rx" - ucidef_set_led_netdev "lan4" "lan4" "green:lan4" "lan4" "link tx rx" + ucidef_set_led_netdev "lan1" "lan1" "green:lan-1" "lan1" "link tx rx" + ucidef_set_led_netdev "lan2" "lan2" "green:lan-2" "lan2" "link tx rx" + ucidef_set_led_netdev "lan3" "lan3" "green:lan-3" "lan3" "link tx rx" + ucidef_set_led_netdev "lan4" "lan4" "green:lan-4" "lan4" "link tx rx" ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx" ;; belkin,rt1800) @@ -202,9 +202,9 @@ tplink,deco-m4r-v4) ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan" ;; tplink,ec330-g5u-v1) - ucidef_set_led_netdev "lan" "Ethernet" "blue:ethernet" "br-lan" "link tx rx" - ucidef_set_led_netdev "wan" "Internet" "blue:internet" "wan" "link tx rx" - ucidef_set_led_netdev "wan-off" "Internet-off" "amber:internet" "wan" "link" + ucidef_set_led_netdev "lan" "Ethernet" "blue:lan" "br-lan" "link tx rx" + ucidef_set_led_netdev "wan" "Internet" "blue:wan" "wan" "link tx rx" + ucidef_set_led_netdev "wan-off" "Internet-off" "amber:wan" "wan" "link" ;; tplink,re350-v1) ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "blue:wifi2G" "wlan0"