ramips: define Yuncore AX820 switch LEDs
authorThibaut VARÈNE <hacks@slashdirt.org>
Wed, 17 Aug 2022 17:36:41 +0000 (19:36 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Mon, 29 Aug 2022 14:23:26 +0000 (16:23 +0200)
This patch defines the two switch LED to bring them under user control.

Fixes: 158a5af80102d ("ramips: improve YunCore AX820 LEDs")
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
[rmilecki: leave "label"s in place]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 7bee10a7d2d16251113147c28dd4548af5c14bab)

target/linux/ramips/dts/mt7621_yuncore_ax820.dts
target/linux/ramips/mt7621/base-files/etc/board.d/01_leds

index 9638f1f060909b1cb778172f0b76e6e2d7c86b5d..bd28c1668ec700e7dd9b273c467bd7851ca2174f 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        compatible = "yuncore,ax820", "mediatek,mt7621-soc";
                        gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "phy1radio";
                };
+
+               wan {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_WAN;
+                       gpios = <&switch0 0 GPIO_ACTIVE_LOW>;
+               };
+
+               lan {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_LAN;
+                       gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
+               };
        };
 
        watchdog {
 };
 
 &switch0 {
+       gpio-controller;
+       #gpio-cells = <2>;
+
        ports {
                port@0 {
                        status = "okay";
index bffb7c18c8fa1bb617d4e1e661972d5c1e590379..15e33e2f16b04d74d3cf7b3da70b77c6580fcf27 100644 (file)
@@ -148,6 +148,10 @@ xiaomi,redmi-router-ac2100)
 youhua,wr1200js)
        ucidef_set_led_netdev "internet" "INTERNET" "green:wan" "wan"
        ;;
+yuncore,ax820)
+       ucidef_set_led_netdev "lan" "LAN" "green:lan" "lan"
+       ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
+       ;;
 zbtlink,zbt-wg1608-16m)
        ucidef_set_led_netdev "lan1" "LAN1" "green:lan-1" "lan1"
        ucidef_set_led_netdev "lan2" "LAN2" "green:lan-2" "lan2"