From: "Andrius Štikonas" <andrius-4ZmsDwijFH7sq35pWSNszA@public.gmane.org>
To: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
Cc: "Andrius Štikonas" <andrius-4ZmsDwijFH7sq35pWSNszA@public.gmane.org>
Subject: [PATCH] arm64: dts: rockchip: Add PWM fan for RockPro64
Date: Wed, 24 Jul 2019 20:17:15 +0100 [thread overview]
Message-ID: <20190724191715.7668-1-andrius@stikonas.eu> (raw)
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
next reply other threads:[~2019-07-24 19:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-24 19:17 Andrius Štikonas [this message]
[not found] ` <20190724191715.7668-1-andrius-4ZmsDwijFH7sq35pWSNszA@public.gmane.org>
2019-07-25 20:12 ` [PATCH] arm64: dts: rockchip: Add PWM fan for RockPro64 Heiko Stuebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190724191715.7668-1-andrius@stikonas.eu \
--to=andrius-4zmsdwijfh7sq35pwsnsza@public.gmane.org \
--cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.