From patchwork Sat Sep 21 18:38:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Klink X-Patchwork-Id: 13808970 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 4AD6ECF9C64 for ; Sat, 21 Sep 2024 18:39:43 +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=nIcJzqWrup/MtIf8div74AkBzJENU7/7RWm/lVXz8Vs=; b=nfnetC87mi/wRm 8DXW7c9IWZ9Estmc66X7DFJmISMwVL8GCkTWhuvqKe5WLU+uQfvA2pIrocP8koysbSfZAxlj42tM3 4MGeNzGOq5uM7bdbRTRk8i6usdgnd9ONzz8doz6CHl3oea07F9a3IXVav8K+HptqwTfCxiFL+lxVO YwDTIF9JxGMMtoXu7xS6+GWJKeF8vxDGScLc+YWQSb3vOpWC1aCf5WoE/R/h8oenbXArGn1KJ9HvK ATTCIE3Hc/DdjK3F2hQafLFfg3stbZhp1bg2Bq2VzCbe0dQGx36fkWKL4Ymky7lDA18pbS+2KXCsR SSildd3dyYEWwwyFn6cA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1ss519-0000000E1Xs-41g6; Sat, 21 Sep 2024 18:39:39 +0000 Received: from mail.flokli.de ([116.203.226.116]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1ss500-0000000E1R5-3rKN; Sat, 21 Sep 2024 18:38:30 +0000 From: Florian Klink DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flokli.de; s=mail; t=1726943902; bh=LdeSOtI+tbdp74aNkMRYpdTnLpUe4xv3Q3ma2Gb4eRQ=; h=From:To:Cc:Subject:Date; b=H842euL1DdokvOuLO/5C5y2aSaeYMuftNGmY8G8siXBGrk7MMAWECUvby8Sh1voE+ 8F3yKiIvLWcYbKrGtjTeEDSxrOSwCjlqmu8n6I4/vKDwzSLYEOPVQxCOBVsCrdrYot ISZdV1RZ/6LmzWVcI9mKJYUv6G6ByeZtAvw2kaks= To: Cc: Florian Klink , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Sebastian Reichel , Dragan Simic , Kever Yang , =?utf-8?b?VGFtw6FzIFN6xbFjcw==?= , FUKAUMI Naoki , Muhammed Efe Cetin , 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: Sat, 21 Sep 2024 21:38:00 +0300 Message-ID: <20240921183810.225322-1-flokli@flokli.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240921_113829_198491_08490718 X-CRM114-Status: UNSURE ( 8.64 ) 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 --- .../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..8569e862b6ee 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 { + map1 { + trip = <&package_fan0>; + cooling-device = <&fan THERMAL_NO_LIMIT 1>; + }; + + map2 { + trip = <&package_fan1>; + cooling-device = <&fan 2 THERMAL_NO_LIMIT>; + }; + }; +}; + /* phy1 - M.KEY socket */ &pcie2x1l0 { reset-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;