[openwrt/openwrt] mvebu: add LED support for GL.iNet GL-MV1000
LEDE Commits
lede-commits at lists.infradead.org
Mon Mar 22 20:05:52 GMT 2021
adrian pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/db6ff390b03f8e5de06ecf9540dcbd74c0aef67f
commit db6ff390b03f8e5de06ecf9540dcbd74c0aef67f
Author: Jeff Collins <jeffcollins9292 at gmail.com>
AuthorDate: Thu Feb 25 11:11:58 2021 -0500
mvebu: add LED support for GL.iNet GL-MV1000
This patch enables LED support for the GL.iNet GL-MV1000
Signed-off-by: Jeff Collins <jeffcollins9292 at gmail.com>
[add SPDX identifier on new file, add aliases, minor cosmetic issues]
Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
(cherry picked from commit 6e0c780eb3b4ba1e52216c1d671897749dd81829)
---
.../mvebu/cortexa53/base-files/etc/board.d/01_leds | 18 ++++++++++++++
.../boot/dts/marvell/armada-3720-gl-mv1000.dts | 29 +++++++++++++++++++++-
2 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/target/linux/mvebu/cortexa53/base-files/etc/board.d/01_leds b/target/linux/mvebu/cortexa53/base-files/etc/board.d/01_leds
new file mode 100755
index 0000000000..42f4deb88a
--- /dev/null
+++ b/target/linux/mvebu/cortexa53/base-files/etc/board.d/01_leds
@@ -0,0 +1,18 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+board=$(board_name)
+
+case "$board" in
+glinet,gl-mv1000)
+ ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
+ ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
index 86c33fa100..0e15debdea 100644
--- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
+++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
@@ -8,6 +8,13 @@
model = "GL.iNet GL-MV1000";
compatible = "glinet,gl-mv1000", "marvell,armada3720";
+ aliases {
+ led-boot = &led_power;
+ led-failsafe = &led_power;
+ led-running = &led_power;
+ led-upgrade = &led_power;
+ };
+
chosen {
stdout-path = "serial0:115200n8";
};
@@ -23,12 +30,32 @@
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
-
+
gpios-states = <0>;
states = <1800000 0x1
3300000 0x0>;
enable-active-high;
};
+
+ leds {
+ compatible = "gpio-leds";
+
+ vpn {
+ label = "green:vpn";
+ gpios = <&gpionb 11 GPIO_ACTIVE_LOW>;
+ };
+
+ wan {
+ label = "green:wan";
+ gpios = <&gpionb 12 GPIO_ACTIVE_LOW>;
+ };
+
+ led_power: power {
+ label = "green:power";
+ gpios = <&gpionb 13 GPIO_ACTIVE_LOW>;
+ default-state = "on";
+ };
+ };
};
&spi0 {
More information about the lede-commits
mailing list