mvebu: rb5009: fix QCA8081 LED polarity
authorRobert Marko <robimarko@gmail.com>
Thu, 11 Jul 2024 13:02:28 +0000 (15:02 +0200)
committerRobert Marko <robimarko@gmail.com>
Fri, 12 Jul 2024 07:51:46 +0000 (09:51 +0200)
Currently, QCA8081 LED is never configured and the default configuration
has the LED polarity inverted so it will be lit when there is nothing
connected to the PHY.

So lets define the LED as active-low and configure the trigger via 01_leds.

Fixes: 85d9fd6f0ec7 ("mvebu: add support for RB5009UG+S+IN")
Link: https://github.com/openwrt/openwrt/pull/15927
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/mvebu/cortexa72/base-files/etc/board.d/01_leds
target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts

index 809a64a60e1b966dda274467893eb95de96d44d3..b958c2fdab28037bb7aace97b33ef25d1158f025 100644 (file)
@@ -13,6 +13,9 @@ iei,puzzle-m901)
 iei,puzzle-m902)
        ucidef_set_led_netdev "wan" "WAN" "white:network" "eth2" "link"
        ;;
+mikrotik,rb5009)
+       ucidef_set_led_netdev "wan-port-link" "WAN-PORT-LINK" "!cp0!config-space@f2000000!mdio@12a200!switch@0!mdio1:00:green:" "p1" "tx rx link_10 link_100 link_1000 link_2500"
+       ;;
 esac
 
 board_config_flush
index 8cd744f64d5d90e3662645d9dd9758b6460478a3..ca13e6aa8931565ff2c1821a98cabfb6551cc7d8 100644 (file)
@@ -5,6 +5,7 @@
 #include "armada-7040.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        model = "MikroTik RB5009";
 
                        qca8081: qca8081@0 {
                                reg = <0>;
+
+                               leds {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       led@1 {
+                                               reg = <1>;
+                                               color = <LED_COLOR_ID_GREEN>;
+                                               function = LED_FUNCTION_WAN;
+                                               default-state = "keep";
+                                               active-low;
+                                       };
+                               };
                        };
                };
        };