mediatek: convert to new LED color/function format where possible
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 7 Feb 2024 13:48:39 +0000 (14:48 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 7 Feb 2024 13:48:39 +0000 (14:48 +0100)
Initial conversion to new LED color/function format
and drop label format where possible. The same label
is composed at runtime.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
17 files changed:
target/linux/mediatek/dts/mt7622-totolink-a8000ru.dts
target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts
target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts
target/linux/mediatek/dts/mt7629-netgear-ex6250-v2.dts
target/linux/mediatek/dts/mt7629-tplink_eap225-v5.dts
target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts
target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts
target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts
target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts
target/linux/mediatek/dts/mt7981b-jcg-q30-pro.dts
target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts
target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts
target/linux/mediatek/dts/mt7986a-asus-tuf-ax6000.dts
target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi
target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-common.dtsi
target/linux/mediatek/dts/mt7986a-zyxel-ex5700-telenor.dts
target/linux/mediatek/dts/mt7986b-netgear-wax220.dts

index 776d38d1e31dcbd3965ea76f4497b5f23333e3bd..5ec07128baaa7620b61e1543cf98934096276d25 100644 (file)
@@ -2,6 +2,7 @@
 
 /dts-v1/;
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/gpio/gpio.h>
 
 #include "mt7622.dtsi"
@@ -57,7 +58,8 @@
                compatible = "gpio-leds";
 
                led_status: status_red {
-                       label = "red:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 81 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                };
index dcf851b2740a38f6a7aaec2f7844038a85cfdaf6..01365a278da6d1cfa496315121e3bd42651d3b59 100644 (file)
@@ -2,6 +2,7 @@
 /dts-v1/;
 
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/gpio/gpio.h>
 
 #include "mt7622.dtsi"
                compatible = "gpio-leds";
 
                led_power_blue: power_blue {
-                       label = "blue:power";
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&pio 18 GPIO_ACTIVE_LOW>;
                };
 
                led_power_amber: power_amber {
-                       label = "amber:power";
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_AMBER>;
                        gpios = <&pio 17 GPIO_ACTIVE_LOW>;
                };
 
index 5b1b3083a066589e535fb507bdc6c3f113e0a33a..78286714eafa6f8f4b27c495dc982fd32ba01ef9 100644 (file)
@@ -2,6 +2,7 @@
 
 /dts-v1/;
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include "mt7629.dtsi"
 
 / {
@@ -25,7 +26,8 @@
                compatible = "gpio-leds";
 
                led_cpu: cpu {
-                       label = "orange:cpu";
+                       function = LED_FUNCTION_CPU;
+                       color = <LED_COLOR_ID_ORANGE>;
                        gpios = <&pio 57 GPIO_ACTIVE_LOW>;
                };
 
@@ -42,7 +44,8 @@
                };
 
                wan {
-                       label = "orange:wan";
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_ORANGE>;
                        gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
                };
        };
index 5645ad799e9247f02aa7090ee44a5404e056fa02..99d3a7cefbbaf8646a1833982dc118682a910eab 100644 (file)
@@ -2,6 +2,7 @@
 
 /dts-v1/;
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include "mt7629.dtsi"
 
 / {
                compatible = "gpio-leds";
 
                led_power_green: power_green {
-                       label = "green:power";
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 21 GPIO_ACTIVE_LOW>;
                };
 
                led_power_red: power_red {
-                       label = "red:power";
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 61 GPIO_ACTIVE_LOW>;
                };
 
@@ -83,7 +86,8 @@
                };
 
                wps_green {
-                       label = "green:wps";
+                       function = LED_FUNCTION_WPS;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 57 GPIO_ACTIVE_LOW>;
                };
 
index 5eab714fdac3c104c1f0bff1137d73125cfc3f4a..bab3ad5737383be4465bdf6bd70abaf222ce02f5 100644 (file)
@@ -2,6 +2,7 @@
 
 /dts-v1/;
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include "mt7629.dtsi"
 
 / {
                compatible = "gpio-leds";
 
                led_status_green: status_green {
-                       label = "green:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 55 GPIO_ACTIVE_HIGH>;
                        default-state = "on";
                };
 
                led_status_amber: status_amber {
-                       label = "amber:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_AMBER>;
                        gpios = <&pio 56 GPIO_ACTIVE_HIGH>;
                };
        };
index 281c96e275ef5bacbec333947988588bd7f79165..919c208918e0d1087ebaf6ce46b2245a37f619b6 100644 (file)
@@ -3,6 +3,7 @@
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 #include "mt7981.dtsi"
 
                compatible = "gpio-leds";
 
                led_status_red: led_status_red {
-                       label = "red:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 3 GPIO_ACTIVE_LOW>;
                };
 
                led_status_green: led_status_green {
-                       label = "green:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 7 GPIO_ACTIVE_LOW>;
                };
        };
index 3f330f40fae43e946d3235367dd87a6781509258..c8db5b58f543290e2ca8966200b70ef0a3f130d8 100644 (file)
@@ -6,6 +6,7 @@
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 #include "mt7981.dtsi"
 
                compatible = "gpio-leds";
 
                green_led: led-0 {
-                       label = "green:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 9 GPIO_ACTIVE_LOW>;
                };
 
                led-1 {
-                       label = "blue:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&pio 12 GPIO_ACTIVE_LOW>;
                };
 
                red_led: led-2 {
-                       label = "red:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 35 GPIO_ACTIVE_LOW>;
                };
        };
index f4ba629525155aaa9e613b740f0583e764e92cde..10b56a3aa74807046d13211491fe41350be914a3 100644 (file)
@@ -2,6 +2,8 @@
 
 /dts-v1/;
 
+#include <dt-bindings/leds/common.h>
+
 #include "mt7981.dtsi"
 
 / {
@@ -42,7 +44,8 @@
                compatible = "gpio-leds";
 
                led_status: led@0 {
-                       label = "blue:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&pio 10 GPIO_ACTIVE_LOW>;
                };
 
                };
 
                led@2 {
-                       label = "blue:wan";
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&pio 5 GPIO_ACTIVE_LOW>;
                };
 
                led@3 {
-                       label = "blue:lan";
+                       function = LED_FUNCTION_LAN;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&pio 9 GPIO_ACTIVE_LOW>;
                };
 
index de702d4a534c6f0e4f1faf831ea098359fc7889a..030cc25041685313d2485706d110f08b505451e4 100644 (file)
@@ -3,6 +3,7 @@
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 #include "mt7981.dtsi"
 
                compatible = "gpio-leds";
 
                led_status_green: green {
-                       label = "green:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 4 GPIO_ACTIVE_LOW>;
                };
 
                led_status_red: red {
-                       label = "red:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 5 GPIO_ACTIVE_LOW>;
                };
        };
index bb6b474080ac12b2b7954b65807e577fa3ccb425..c8b9aeba42fe283aeafc0b275aa0eeabda11eef9 100644 (file)
@@ -3,6 +3,7 @@
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 #include "mt7981.dtsi"
 
                compatible = "gpio-leds";
 
                led_status_red: red {
-                       label = "red:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 8 GPIO_ACTIVE_HIGH>;
                };
 
                led_status_blue: blue {
-                       label = "blue:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&pio 13 GPIO_ACTIVE_LOW>;
                };
        };
index cd6f6b30c3efedb209282556371eea4de64f0fc1..3925f80ba35ace054207bdb7857faa1cf8cefbae 100644 (file)
@@ -3,6 +3,7 @@
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 #include "mt7981.dtsi"
 
                compatible = "gpio-leds";
 
                led_status_red: red {
-                       label = "red:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 3 GPIO_ACTIVE_LOW>;
                };
 
                led_status_green: green {
-                       label = "green:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 7 GPIO_ACTIVE_LOW>;
                };
        };
index 2af18958bc517f35a4c588cd3cad7d9c799eaf96..e9c8edc3dcee710334d69cded439d0e444c6f6e1 100644 (file)
@@ -65,7 +65,8 @@
                };
 
                wan-red {
-                       label = "red:wan";
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 12 GPIO_ACTIVE_LOW>;
                };
        };
index b05dec93b49a9fffa2d5dad0b72a0d1fb0894a40..2d7b9c8c5c019eb88b96d8f986cb3e143a0de919 100644 (file)
@@ -48,7 +48,8 @@
                compatible = "gpio-leds";
 
                wlan {
-                       label = "white:wlan";
+                       function = LED_FUNCTION_WLAN;
+                       color = <LED_COLOR_ID_WHITE>;
                        gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "phy1tpt";
                };
@@ -59,7 +60,8 @@
                };
 
                wan-red {
-                       label = "red:wan";
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 12 GPIO_ACTIVE_LOW>;
                };
 
index da08bdc723b1b23dfc827eb082676c877c4ed8dd..c851853286a01d406fabdef540bf4f144b36c273 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 #include "mt7986a.dtsi"
 
                compatible = "gpio-leds";
 
                led_status_red: status_red {
-                       label = "red:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
                };
 
                led_status_green: status_green {
-                       label = "green:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 8 GPIO_ACTIVE_HIGH>;
                };
 
index 04e86a737d1d01d2b0d6a42f726495c2ca7d45d5..335ee93989f38f2b2b7d07f0d7d61cabfb0b48b1 100644 (file)
@@ -7,6 +7,7 @@
 #include "mt7986a.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        aliases {
                };
 
                led_green_lan {
-                       label = "green:lan";
+                       function = LED_FUNCTION_LAN;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 20 GPIO_ACTIVE_HIGH>;
                        default-state = "off";
                };
index f5bb73c97d7ee79c141b253115c34dc9914b144a..29961e528cc7418823ad441aa3c3d4a7a11496fe 100644 (file)
@@ -2,6 +2,7 @@
 
 /dts-v1/;
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/gpio/gpio.h>
 
 #include "mt7986a.dtsi"
                };
 
                white2 {
-                       label = "white:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_WHITE>;
                        gpios = <&pio 16 GPIO_ACTIVE_HIGH>;
                        default-state = "off";
                };
 
                red2 {
-                       label = "red:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 17 GPIO_ACTIVE_HIGH>;
                        default-state = "off";
                };
 
                led_status_green: green2 {
-                       label = "green:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 31 GPIO_ACTIVE_HIGH>;
                        default-state = "off";
                };
 
                led_status_amber: amber2 {
-                       label = "amber:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_AMBER>;
                        gpios = <&pio 18 GPIO_ACTIVE_HIGH>;
                        default-state = "off";
                };
index 19419f593fb273245cb93f94bc48a41a9bb6de73..6e51d8847023587c41bd076693751633054a7d28 100644 (file)
@@ -43,7 +43,8 @@
 
                led_power_amber: power_amber {
                        gpios = <&pio 15 GPIO_ACTIVE_LOW>;
-                       label = "amber:power";
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_AMBER>;
                };
 
                wlan2g_green {
 
                led_power_blue: power_blue {
                        gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
-                       label = "blue:power";
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_BLUE>;
                };
 
                led_power_green: power_green {
                        gpios = <&pio 10 GPIO_ACTIVE_LOW>;
-                       label = "green:power";
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_GREEN>;
                };
 
                wlan2g_blue {
 
                lan_green {
                        gpios = <&pio 22 GPIO_ACTIVE_HIGH>;
-                       label = "green:lan";
+                       function = LED_FUNCTION_LAN;
+                       color = <LED_COLOR_ID_GREEN>;
                };
 
                lan_amber {
                        gpios = <&pio 13 GPIO_ACTIVE_LOW>;
-                       label = "amber:lan";
+                       function = LED_FUNCTION_LAN;
+                       color = <LED_COLOR_ID_AMBER>;
                };
 
                wlan5g_blue {