Skip to contentSkip to conversation

arm64: dts: meson: radxa-zero2: add pwm-fan support

PATCH Applied Christian Hewitt 2 participants 3 messages Jun 6, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm64: dts: meson: radxa-zero2: add pwm-fan support

The A311D on Zero2 needs active cooling and the board includes a header to connect a simple fan. Add pwm-fan support with basic thermal properties so the fan runs when connected.

---
Changes since v1: [0]
- Drop min/max state to comply with bindings
- Drop ddr_thermal node
- Add cpu_thermal trips
- Use cooling map2 to avoid clashing with dtsi inherited maps

[0] https://patchwork.kernel.org/project/linux-amlogic/patch/[email protected]/

 .../dts/amlogic/meson-g12b-radxa-zero2.dts    | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12b-radxa-zero2.dts +24 -0
index 890f5bfebb03..8445701100d0 100644
@@ -33,6 +33,13 @@ memory@0 {
 		reg = <0x0 0x0 0x0 0x80000000>;
 	};
 
+	fan0: pwm-fan {
+		compatible = "pwm-fan";
+		#cooling-cells = <2>;
+		cooling-levels = <0 64 128 192 255>;
+		pwms = <&pwm_AO_ab 0 40000 0>;
+	};
+
 	gpio-keys-polled {
 		compatible = "gpio-keys-polled";
 		poll-interval = <100>;
@@ -286,6 +293,23 @@ &cpu103 {
 	clock-latency = <50000>;
 };
 
+&cpu_thermal {
+	trips {
+		cpu_active: cpu-active {
+			temperature = <70000>; /* millicelsius */
+			hysteresis = <2000>; /* millicelsius */
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu_active>;
+			cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+		};
+	};
+};
+
 &frddr_a {
 	status = "okay";
 };
Signature · 1 line
2.34.1
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 50 lines · Christian Hewitt

The A311D on Zero2 needs active cooling and the board includes a header to connect a simple fan. Add pwm-fan support with basic thermal properties so the fan runs when connected.

---
Changes since v1: [0]
- Drop min/max state to comply with bindings
- Drop ddr_thermal node
- Add cpu_thermal trips
- Use cooling map2 to avoid clashing with dtsi inherited maps

[0] https://patchwork.kernel.org/project/linux-amlogic/patch/[email protected]/

  .../dts/amlogic/meson-g12b-radxa-zero2.dts    | 24 +++++++++++++++++++
  1 file changed, 24 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12b-radxa-zero2.dts +17 -0
index 890f5bfebb03..8445701100d0 100644
@@ -33,6 +33,13 @@ memory@0 {
  		reg = <0x0 0x0 0x0 0x80000000>;
  	};
 
+	fan0: pwm-fan {
+		compatible = "pwm-fan";
+		#cooling-cells = <2>;
+		cooling-levels = <0 64 128 192 255>;
+		pwms = <&pwm_AO_ab 0 40000 0>;
+	};
+
  	gpio-keys-polled {
  		compatible = "gpio-keys-polled";
  		poll-interval = <100>;
@@ -286,6 +293,23 @@ &cpu103 {
  	clock-latency = <50000>;
  };
 
+&cpu_thermal {
+	trips {
+		cpu_active: cpu-active {
+			temperature = <70000>; /* millicelsius */
+			hysteresis = <2000>; /* millicelsius */
+			type = "active";
+		};
+	};
+
+	cooling-maps {

arch/arm64/boot/dts/amlogic/meson-g12b-radxa-zero2.dts &cpu103 { · line 315

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12b-radxa-zero2.dts +7 -0
+		map2 {
+			trip = <&cpu_active>;
+			cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+		};
+	};
+};
+
  &frddr_a {
  	status = "okay";
  };
maintainer Applied
#2 lore raw
In reply to Christian Hewitt

Hi,

Quoted 5 lines · Christian Hewitt

The A311D on Zero2 needs active cooling and the board includes a header to connect a simple fan. Add pwm-fan support with basic thermal properties so the fan runs when connected.

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.11/arm64-dt)

[1/1] arm64: dts: meson: radxa-zero2: add pwm-fan support

      https://git.kernel.org/amlogic/c/1d1239a1b0e502faffe43b97d530232285b9f061

These changes has been applied on the intermediate git tree [1].

The v6.11/arm64-dt branch will then be sent via a formal Pull Request to the Linux SoC maintainers for inclusion in their intermediate git branches in order to be sent to Linus during the next merge window, or sooner if it's a set of fixes.

In the cases of fixes, those will be merged in the current release candidate kernel and as soon they appear on the Linux master branch they will be backported to the previous Stable and Long-Stable kernels [2].

The intermediate git branches are merged daily in the linux-next tree [3], people are encouraged testing these pre-release kernels and report issues on the relevant mailing-lists.

If problems are discovered on those changes, please submit a signed-off-by revert patch followed by a corrective changeset.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

Signature · 1 line
Neil