[openwrt/openwrt] mvebu: puzzle-m901: add LEDs, fan and reset button

LEDE Commits lede-commits at lists.infradead.org
Sat Jan 1 14:31:25 PST 2022


dangole pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/a03840a1a9b9945bd25bdefc481ca877bb19bb7b

commit a03840a1a9b9945bd25bdefc481ca877bb19bb7b
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Tue Dec 21 21:50:32 2021 +0000

    mvebu: puzzle-m901: add LEDs, fan and reset button
    
    Wire up MCU driver for LEDs, fan and temperature sensor, and add
    GPIO reset button just like on the M902 also on the Puzzle M901.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
    (cherry picked from commit 3684b494ddd540b811de44497f0d11309bfd1911)
---
 .../arm64/boot/dts/marvell/cn9131-puzzle-m901.dts  | 84 ++++++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9131-puzzle-m901.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9131-puzzle-m901.dts
index 58e749490a..acf2ed6422 100644
--- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9131-puzzle-m901.dts
+++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9131-puzzle-m901.dts
@@ -8,6 +8,7 @@
 #include "cn9130.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 / {
 	model = "iEi Puzzle-M901";
@@ -31,12 +32,26 @@
 		gpio2 = &cp0_gpio2;
 		gpio3 = &cp1_gpio1;
 		gpio4 = &cp1_gpio2;
+		led-boot = &led_power;
+		led-failsafe = &led_info;
+		led-running = &led_power;
+		led-upgrade = &led_info;
 	};
 
 	memory at 00000000 {
 		device_type = "memory";
 		reg = <0x0 0x0 0x0 0x80000000>;
 	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "Reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&cp0_gpio2 4 GPIO_ACTIVE_LOW>;
+		};
+	};
 };
 
 &uart0 {
@@ -45,6 +60,75 @@
 
 &cp0_uart0 {
 	status = "okay";
+
+	puzzle-mcu {
+		compatible = "iei,wt61p803-puzzle";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		current-speed = <115200>;
+		enable-beep;
+		status = "okay";
+
+		leds {
+			compatible = "iei,wt61p803-puzzle-leds";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "okay";
+
+			led at 0 {
+				reg = <0>;
+				label = "white:network";
+				active-low;
+			};
+
+			led at 1 {
+				reg = <1>;
+				label = "green:cloud";
+				active-low;
+			};
+
+			led_info: led at 2 {
+				reg = <2>;
+				label = "orange:info";
+				active-low;
+			};
+
+			led_power: led at 3 {
+				reg = <3>;
+				label = "yellow:power";
+				active-low;
+				default-state = "on";
+			};
+		};
+
+		hwmon {
+			compatible = "iei,wt61p803-puzzle-hwmon";
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			chassis_fan_group0: fan-group at 0 {
+				#cooling-cells = <2>;
+				reg = <0x00>;
+				cooling-levels = <64 102 170 230 250>;
+			};
+		};
+	};
+};
+
+&ap_thermal_cpu1 {
+	trips {
+		cpu_active: cpu-active {
+			temperature = <44000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+	cooling-maps {
+		fan-map {
+			trip = <&cpu_active>;
+			cooling-device = <&chassis_fan_group0 64 THERMAL_NO_LIMIT>;
+		};
+	};
 };
 
 /* on-board eMMC - U9 */



More information about the lede-commits mailing list