arm64: dts: rockchip: Add PWM fan for RockPro64
authorAndrius Štikonas <andrius@stikonas.eu>
Wed, 24 Jul 2019 19:17:15 +0000 (20:17 +0100)
committerHeiko Stuebner <heiko@sntech.de>
Thu, 25 Jul 2019 20:08:51 +0000 (22:08 +0200)
RockPro64 has a dedicated circuit for driving a 12V fan from PWM1.

At the moment this makes fan spin at full speed. fancontrol can be used
to control fan speed. E.g. the following config file works well:

INTERVAL=10
DEVPATH=hwmon0=devices/platform/pwm-fan
DEVNAME=hwmon0=pwmfan
FCTEMPS=hwmon0/device/pwm1=../thermal/thermal_zone0/temp
MINTEMP=hwmon0/device/pwm1=40
MAXTEMP=hwmon0/device/pwm1=60
MINSTART=hwmon0/device/pwm1=100
MINSTOP=hwmon0/device/pwm1=70

In the future it would be nice to define trip points in dts file,
so that kernel could adjust fan speed itself.

Signed-off-by: Andrius Štikonas <andrius@stikonas.eu>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts

index eb55940620060679b488582e9812029f16e55e0d..076fa0fd103c8255652c72287b4ee57bc73e9358 100644 (file)
                };
        };
 
+       fan: pwm-fan {
+               compatible = "pwm-fan";
+               #cooling-cells = <2>;
+               fan-supply = <&vcc12v_dcin>;
+               pwms = <&pwm1 0 50000 0>;
+       };
+
        sdio_pwrseq: sdio-pwrseq {
                compatible = "mmc-pwrseq-simple";
                clocks = <&rk808 1>;
        status = "okay";
 };
 
+&pwm1 {
+       status = "okay";
+};
+
 &pwm2 {
        status = "okay";
 };