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:21:34 +0000 (16:21 +0200)
This patch defines the two switch LED to bring them under user control.

Fixes: a0e1d3ab7b4f ("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>
target/linux/ramips/dts/mt7621_yuncore_ax820.dts
target/linux/ramips/mt7621/base-files/etc/board.d/01_leds

index 75fe3cf5818566bcc576f16373c27172baeb0e4d..6ea3c922dbd98b63909c66acde291149cd160916 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@1 {
                        status = "okay";
index 0e8244772d39459c347bcd628510bfc97c098fda..5e1e707930db4c58d3b48147ba5490e242568de8 100644 (file)
@@ -162,6 +162,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"