arm64: dts: meson: radxa-zero2: add pwm-fan support
authorChristian Hewitt <christianshewitt@gmail.com>
Thu, 6 Jun 2024 09:06:15 +0000 (09:06 +0000)
committerNeil Armstrong <neil.armstrong@linaro.org>
Thu, 6 Jun 2024 09:11:50 +0000 (11:11 +0200)
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.

Suggested-by: Yuntian Zhang <yt@radxa.com>
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240606090615.3946433-1-christianshewitt@gmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
arch/arm64/boot/dts/amlogic/meson-g12b-radxa-zero2.dts

index 890f5bfebb0304bead7734b3d0119022fc5ef768..8445701100d0e40e850c189c1c5a927c45ed9173 100644 (file)
                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>;
        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";
 };