diff mbox series

[3/3] arm64: dts: ten64: add configuration for fan controller

Message ID 20220914053030.8929-4-matt@traverse.com.au
State New
Headers show
Series [1/3] hwmon: (emc230x) add Microchip (SMSC) EMC230X fan controller support | expand

Commit Message

Mathew McBride Sept. 14, 2022, 5:30 a.m. UTC
The Ten64 desktop appliance has a Noctua NF-A4x20 PWM fan,
controlled by a Microchip EMC2301 PWM fan controller.

This binding allows the fan speed to be slowed to a
quieter level when the system is not busy.

Reference: https://ten64doc.traverse.com.au/hardware/fan-control/

Signed-off-by: Mathew McBride <matt@traverse.com.au>
---
 .../boot/dts/freescale/fsl-ls1088a-ten64.dts  | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts b/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts
index ef6c8967533e..fd8261c9a186 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts
@@ -87,6 +87,35 @@  sfp_xg1: dpmac1-sfp {
 		los-gpios = <&sfpgpio 7 GPIO_ACTIVE_HIGH>;
 		maximum-power-milliwatt = <2000>;
 	};
+
+	thermal-zones {
+		soc {
+			trips {
+				fanmid0: fanmid0 {
+					temperature = <60000>;
+					hysteresis = <2000>;
+					type = "active";
+				};
+
+				fanmax0: fanmax0 {
+					temperature = <70000>;
+					hysteresis = <2000>;
+					type = "active";
+				};
+			};
+
+			cooling-maps {
+				map2 {
+					trip = <&fanmid0>;
+					cooling-device = <&case_fan 0 6>;
+				};
+				map3 {
+					trip = <&fanmax0>;
+					cooling-device = <&case_fan 7 THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+	};
 };
 
 /* XG1 - Upper SFP */
@@ -231,6 +260,20 @@  at97sc: tpm@29 {
 		compatible = "atmel,at97sc3204t";
 		reg = <0x29>;
 	};
+
+	fanctrl: emc2301@2f {
+		reg = <0x2f>;
+		compatible = "microchip,emc2301";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		case_fan: fan@0 {
+			reg = <0>;
+			min-rpm = /bits/ 16 <3000>;
+			max-rpm = /bits/ 16 <5500>;
+			#cooling-cells = <2>;
+		};
+	};
 };
 
 &i2c2 {