* [PATCH] arm64: dts: rockchip: Add PWM fan for RockPro64
@ 2019-07-24 19:17 Andrius Štikonas
[not found] ` <20190724191715.7668-1-andrius-4ZmsDwijFH7sq35pWSNszA@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Andrius Štikonas @ 2019-07-24 19:17 UTC (permalink / raw)
To: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Heiko Stuebner
Cc: Andrius Štikonas
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>
---
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
index eb5594062006..02cf5d0dbaed 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
@@ -169,6 +169,14 @@
regulator-max-microvolt = <1400000>;
vin-supply = <&vcc5v0_sys>;
};
+
+ fan: pwm-fan {
+ compatible = "pwm-fan";
+ #cooling-cells = <2>;
+ fan-supply = <&vcc12v_dcin>;
+ pwms = <&pwm1 0 50000 0>;
+ };
+
};
&cpu_l0 {
@@ -602,6 +610,10 @@
status = "okay";
};
+&pwm1 {
+ status = "okay";
+};
+
&pwm2 {
status = "okay";
};
--
2.21.0
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] arm64: dts: rockchip: Add PWM fan for RockPro64
[not found] ` <20190724191715.7668-1-andrius-4ZmsDwijFH7sq35pWSNszA@public.gmane.org>
@ 2019-07-25 20:12 ` Heiko Stuebner
0 siblings, 0 replies; 2+ messages in thread
From: Heiko Stuebner @ 2019-07-25 20:12 UTC (permalink / raw)
To: Andrius Štikonas; +Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Am Mittwoch, 24. Juli 2019, 21:17:15 CEST schrieb Andrius Štikonas:
> 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.
patches welcome ;-)
> Signed-off-by: Andrius Štikonas <andrius@stikonas.eu>
applied for 5.4
Thanks
Heiko
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-25 20:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-24 19:17 [PATCH] arm64: dts: rockchip: Add PWM fan for RockPro64 Andrius Štikonas
[not found] ` <20190724191715.7668-1-andrius-4ZmsDwijFH7sq35pWSNszA@public.gmane.org>
2019-07-25 20:12 ` Heiko Stuebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).