ramips: use function/color syntax for some dlink dir routers
authorMieczyslaw Nalewaj <namiltd@yahoo.com>
Wed, 8 May 2024 18:32:03 +0000 (20:32 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Thu, 9 May 2024 20:24:31 +0000 (22:24 +0200)
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 <namiltd@yahoo.com>
target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts
target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts
target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts
target/linux/ramips/dts/mt7621_dlink_dir-3040-a1.dts
target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts
target/linux/ramips/dts/mt7621_dlink_dir_nand_128m.dtsi
target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration

index 531076216deb1212e378523b86d5c319be806cb2..a818400342ad6ef4df723d73a60e6312a076f57d 100644 (file)
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include <dt-bindings/leds/common.h>
-
 #include "mt7621_dlink_dir_nand_128m.dtsi"
 
 / {
index fd25b94e8dc19f94f9274a0989895c6672d7432b..ba7b9a88dcf826bbe122b8f777eea007fac224f8 100644 (file)
@@ -8,15 +8,19 @@
 };
 
 &leds {
-       usb2_white {
-               label = "white:usb2";
+       led-4 {
+               function = LED_FUNCTION_USB;
+               color = <LED_COLOR_ID_WHITE>;
+               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 = <LED_COLOR_ID_WHITE>;
+               function-enumerator = <3>;
                gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
                trigger-sources = <&xhci_ehci_port1>;
                linux,default-trigger = "usbport";
index d8c347198b5a18e67b1d1c27431d5d6eda0b33f4..2ee0b8a5c39ed3b58f2d3f8002bfde533ffe2681 100644 (file)
@@ -8,15 +8,19 @@
 };
 
 &leds {
-       usb2_white {
-               label = "white:usb2";
+       led-4 {
+               function = LED_FUNCTION_USB;
+               color = <LED_COLOR_ID_WHITE>;
+               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 = <LED_COLOR_ID_WHITE>;
+               function-enumerator = <3>;
                gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
                trigger-sources = <&xhci_ehci_port1>;
                linux,default-trigger = "usbport";
index 0bcfa022fa93dafa80af3a3d2c621a7eeabceb6d..5044ba3bdc496f09ece4b0fa3558eb067736d108 100644 (file)
 };
 
 &leds {
-       usb2_white {
+       led-4 {
                function = LED_FUNCTION_USB;
                color = <LED_COLOR_ID_WHITE>;
-               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 = <LED_COLOR_ID_WHITE>;
-               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 = <LED_COLOR_ID_WHITE>;
                gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
                linux,default-trigger = "phy0radio";
        };
 
-       wlan5glb {
+       led-7 {
                function = LED_FUNCTION_WLAN_5GHZ;
                color = <LED_COLOR_ID_WHITE>;
                function-enumerator = <0>;
@@ -45,7 +45,7 @@
                linux,default-trigger = "phy1radio";
        };
 
-       wlan5ghb {
+       led-8 {
                function = LED_FUNCTION_WLAN_5GHZ;
                color = <LED_COLOR_ID_WHITE>;
                function-enumerator = <1>;
index f581095a81d5aceb10bf169c7a423426f707cce9..89e1189cf7d68fa3602c3ea11c0bfc78257294a4 100644 (file)
        leds {
                compatible = "gpio-leds";
 
-               led_power_orange: power_orange {
+               led_power_orange: led-0 {
                        function = LED_FUNCTION_POWER;
                        color = <LED_COLOR_ID_ORANGE>;
                        gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
                };
 
-               led_power_white: power_white {
+               led_power_white: led-1 {
                        function = LED_FUNCTION_POWER;
                        color = <LED_COLOR_ID_WHITE>;
                        gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
                };
 
-               led_net_orange: net_orange {
-                       label = "orange:net";
+               led_net_orange: led-2 {
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_ORANGE>;
                        gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
                };
 
-               net_white {
-                       label = "white:net";
+               led-3 {
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_WHITE>;
                        gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
                };
 
-               usb2_white {
-                       label = "white:usb2";
+               led-4 {
+                       function = LED_FUNCTION_USB;
+                       color = <LED_COLOR_ID_WHITE>;
+                       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 = <LED_COLOR_ID_WHITE>;
+                       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 = <LED_COLOR_ID_WHITE>;
                        gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "phy0radio";
                };
 
-               wlan5glb {
-                       label = "white:wlan5glb";
+               led-7 {
+                       function = LED_FUNCTION_WLAN_5GHZ;
+                       color = <LED_COLOR_ID_WHITE>;
+                       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 = <LED_COLOR_ID_WHITE>;
+                       function-enumerator = <1>;
                        gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "phy2radio";
                };
index d5adb8728cebc786b1bed4029d68e6430f499918..147d64c4b04df97ecf9447a6b532e5ea8ba6ab75 100644 (file)
        leds: leds {
                compatible = "gpio-leds";
 
-               led_power_orange: power_orange {
+               led_power_orange: led-0 {
                        function = LED_FUNCTION_POWER;
                        color = <LED_COLOR_ID_ORANGE>;
                        gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
                };
 
-               led_power_white: power_white {
+               led_power_white: led-1 {
                        function = LED_FUNCTION_POWER;
                        color = <LED_COLOR_ID_WHITE>;
                        gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
                };
 
-               led_net_orange: net_orange {
-                       label = "orange:net";
+               led_net_orange: led-2 {
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_ORANGE>;
                        gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
                };
 
-               net_white {
-                       label = "white:net";
+               led-3 {
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_WHITE>;
                        gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
                };
        };
index 6848bebd0010cc1869c13c45227144bb5bffa68b..d8beee9f0ec229baf09acf2438434de0e3b3520b 100644 (file)
@@ -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)
index b595ae6fd12eba5087bb917cddd88db6037e1b89..30860346f4fd5a1f182b1b77aff6486a7803bff0 100644 (file)
@@ -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'