]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: mediatek: mt7988a-bpi-r4: add gpio leds
authorFrank Wunderlich <frank-w@public-files.de>
Sun, 6 Jul 2025 13:22:08 +0000 (15:22 +0200)
committerAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 7 Jul 2025 09:21:23 +0000 (11:21 +0200)
Bananapi R4 has a green and a blue led which can be switched by gpio.
Green led is for running state so default on.

Green led also shares pin with eeprom writeprotect where led off allows
writing to eeprom.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20250706132213.20412-14-linux@fw-web.de
[Angelo: Fixed missing dt-bindings/leds/common.h header inclusion]
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi

index 30affedf84d4f573c3d1f1386e8a0c68d43e717e..5fd222df440d81f33ceffd501a746b75b956b04d 100644 (file)
@@ -3,6 +3,7 @@
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
 
 #include "mt7988a.dtsi"
                status = "okay";
        };
 
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               led_green: led-green {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
+                       gpios = <&pio 79 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+               };
+
+               led_blue: led-blue {
+                       function = LED_FUNCTION_WPS;
+                       color = <LED_COLOR_ID_BLUE>;
+                       gpios = <&pio 63 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+       };
+
+
        reg_1p8v: regulator-1p8v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-1.8V";