From patchwork Sun Sep 22 11:21:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Klink X-Patchwork-Id: 13809033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3E98CF9C64 for ; Sun, 22 Sep 2024 11:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=irFJ+mydDcYJ8yxlFkhYFXgnyin7zsCJxODQq/VT6d4=; b=IOGIC8K1041rbK iiV62bYdQky6SNKO4/OAOHUARBwX89QR0MxtSmmsjwGIFr8tcEsGHhizEqneOLtm1hI/w7Mf15CIa SyUUtqk1buB353EZjHZ7TM2fOLva+NKGzU0e2pvJ/d1yR1aGoy9EhGv1HCWOXXfMHoa3mvmg8dl/M b2sUFVpZEbUAj9RnxEoBu/mxFkh1CVjwIbZB90IS2djjt8oQfn/vaYuhth6knEyGKhCHnU5wWCvAM UoNvvDj0ODoyil4WnMQGI+lBeweG8gozMUJZqbjONj4pWEwi1++NAMor1kvX8czMWkC9WNXEHvzh1 6pgQTPe+geaY56rt0s/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1ssKfl-0000000F39D-2P9g; Sun, 22 Sep 2024 11:22:37 +0000 Received: from mail.flokli.de ([2a01:4f8:1c1e:e12f::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1ssKec-0000000F34h-28TG; Sun, 22 Sep 2024 11:21:28 +0000 From: Florian Klink DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flokli.de; s=mail; t=1727004081; bh=GuRo2k0T9oiOFVzmZlE5UWzPH3hTNSPfo+s1LYF8J38=; h=From:To:Cc:Subject:Date; b=UtGneW1D2ul2axDXdozrtFWvUGfQCDuiXu1h0PdFHUc+XZx/AfVMrfD9roNuP2JbQ sxWuFSYDM4Ars5fUvHd8D1no56FoFYcYYtQ+nnmMc9wX0EJDvSafukxTx5hU4R9ZkY dDJV1nNBAN662PTZDcXRI+oD1/B+OaUuiDogFDjQ= To: Cc: Florian Klink , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Sebastian Reichel , Dragan Simic , =?utf-8?b?VGFtw6FzIFN6xbFjcw==?= , Ondrej Jirman , Muhammed Efe Cetin , FUKAUMI Naoki , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: dts: rockchip: enable automatic fan control on Orange Pi 5+ Date: Sun, 22 Sep 2024 14:21:03 +0300 Message-ID: <20240922112113.251431-1-flokli@flokli.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240922_042126_820469_E730CEB2 X-CRM114-Status: UNSURE ( 8.16 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org This links the PWM fan on Orange Pi 5+ as an active cooling device managed automatically by the thermal subsystem, with a target SoC temperature of 65C and a minimum-spin interval from 55C to 65C to ensure airflow when the system gets warm. This is pretty much the same as '4a152231b050 ("arm64: dts: rockchip: enable automatic fan control on Rock 5B")', except for the Orange Pi 5+ board. Signed-off-by: Florian Klink Reviewed-by: Dragan Simic --- .../dts/rockchip/rk3588-orangepi-5-plus.dts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts index e74871491ef5..d91438752006 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts @@ -351,6 +351,36 @@ &i2s2m0_sdi status = "okay"; }; +&package_thermal { + polling-delay = <1000>; + + trips { + package_fan0: package-fan0 { + temperature = <55000>; + hysteresis = <2000>; + type = "active"; + }; + + package_fan1: package-fan1 { + temperature = <65000>; + hysteresis = <2000>; + type = "active"; + }; + }; + + cooling-maps { + map0 { + trip = <&package_fan0>; + cooling-device = <&fan THERMAL_NO_LIMIT 1>; + }; + + map1 { + trip = <&package_fan1>; + cooling-device = <&fan 2 THERMAL_NO_LIMIT>; + }; + }; +}; + /* phy1 - M.KEY socket */ &pcie2x1l0 { reset-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;