From patchwork Thu Feb 29 19:26:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Charkov X-Patchwork-Id: 13577575 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 4EB95C48BF6 for ; Thu, 29 Feb 2024 19:27: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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PkjtcVXipXQq/gaW+IcNnr+y2k2yfB9+eZbv8jIkcYc=; b=hh8tofbcuQ8D6G 0jl3BF/c9PzSggbO/Bc8XfHp55VuujsNZiCkeH79dj6Opml2gbY8pT6rYmcnygz6Ql0PN/msnDwGP nLp6VvlkLTDfVsikznFMpGqOerrBNWBfZw84LvMP5BonVPkI2FTJ7ntIkHVoCLLt6T6mw2nLnka0w N4LRCyFxq3VF5zJeNBfnT9IWbfkePH8iZbYMVYjF6+izARhbc1oIzB61L3z6VpoUNuzvwPIZuPaLl XyOcK3X9G2WdeJkePcmt/h7ExCJzdUxqWSbErIjv+L1ygFd7LvYzhY7JLSZLWgchKTBLoelsllnLw Hr+69vXOIGGUtReyiy5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfm45-0000000EsR2-2Ukh; Thu, 29 Feb 2024 19:27:33 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfm3h-0000000Es47-0Yto; Thu, 29 Feb 2024 19:27:10 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-412c3f4c6b9so1423355e9.0; Thu, 29 Feb 2024 11:27:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709234826; x=1709839626; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ZjF+Nm70GZV3EV5zT61+vVH9aCxdPSz8FYjQv588FDY=; b=E/cPkm/+efQZ1BCMk+n2JUJzjCHYfxyiN1/PMxz5Q00lnHQCEZ6HwoUxYAwQHwIMwV ptPrHEhbRb6VKHGmmfaobBdB+8eIo/eyVzYURpgiXBml/Rd/Rh8cE2LXZ+dNXKUOnMYs KaxfibnVF2t5UA6IosPhXFhHWhPVYvYHnkFCPXbcBeWuKBgGu0w1SswlygyvVu5Cz0Cp fR8bjwJmajAtJQyOTXNB/mtwvf3FZprmVQGI0ucURadfaii7LARR4HYoqMlaEKdeQY4o YKvv02HTonsj0T8mvE1Zcbh3+q7F2lEyJFF+wjyZWte/sYZBFUhv08cN0V5RvEi0wgUx yTyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709234826; x=1709839626; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZjF+Nm70GZV3EV5zT61+vVH9aCxdPSz8FYjQv588FDY=; b=E/wHMOJJzNUnVwjH+nCEJw4h/72aOuhAXODWX32YT4BIpPvXw+QxKNF/mIWvDPT2RE 11mlfmxtjMO6p4MSzSNUruArF8a+2FhaNqXT9ESJZADeM0zdpqldhQ76ZVi0HMCAgbNp 9VKzND+yRfTgqi/nlb6wkDtveE/SXKtQ0WwymYg/HPWwpEeHIwqn6pS6CG0n5rsPnZNA M2gFZJGCCU8G+Shg0t5H5rfbxHlKi7AMWKtUtJs6CwukzT392asm52vS/slMUJrQnL2a v045Rj2OX0r2+X6XeJv7UrxW2Z7QdcyifBY44HXiQASotF+SqX+j+ieCKJtzTj2dZJnQ I7iw== X-Forwarded-Encrypted: i=1; AJvYcCWBVj9So39rJ1qYfpjEWodAO9gSBE2ieCGGy9TjekAEUlwK257exYiVMcoO4UYwaItKmLvygHFfmoy2kPPzD68PwjlOqr1kZzG8nFznNVv//gVfbqgY4YbHk2Rrcfg0DWr+eW+RjaBJKEiy51wX8Zyy0oHwtjsRzEU= X-Gm-Message-State: AOJu0YzOdFLmREFFquHFl99BL2vKv4g8z1Al3yb24ziUdXjqCoeVz82N KeV4ea95G6U3cmoRUa02jqoGQAJ0KL0/P+zvb+r569AXRh3NKXcA X-Google-Smtp-Source: AGHT+IE5LYJ+eH6qEYpCvW2Ade7RBhtp9koyNGFhLwrJlvKvIsvwEIqIjhWPVd3V+qWr7oNTqvsdJw== X-Received: by 2002:a05:600c:4fcc:b0:412:c1d4:995f with SMTP id o12-20020a05600c4fcc00b00412c1d4995fmr622wmq.13.1709234826323; Thu, 29 Feb 2024 11:27:06 -0800 (PST) Received: from [172.30.32.188] ([2001:8f8:183b:6ebc::d35]) by smtp.gmail.com with ESMTPSA id j20-20020a05600c1c1400b00412bca49a5bsm2853944wms.42.2024.02.29.11.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 11:27:06 -0800 (PST) From: Alexey Charkov Date: Thu, 29 Feb 2024 23:26:33 +0400 Subject: [PATCH v3 2/5] arm64: dts: rockchip: enable automatic active cooling on Rock 5B MIME-Version: 1.0 Message-Id: <20240229-rk-dts-additions-v3-2-6afe8473a631@gmail.com> References: <20240229-rk-dts-additions-v3-0-6afe8473a631@gmail.com> In-Reply-To: <20240229-rk-dts-additions-v3-0-6afe8473a631@gmail.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Daniel Lezcano , Dragan Simic , Viresh Kumar , Chen-Yu Tsai , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alexey Charkov X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709234816; l=1646; i=alchark@gmail.com; s=20240125; h=from:subject:message-id; bh=Ho/8fTxDDk0oY+T8PDaCqjRH1MRLd78jPjHkNM1Fiy8=; b=9He9zzAzOU9/Q78jwrKCrcpeg4Gshhw2MArhwDVEmmq1HYUzqs/CKJUbr0yRGn7xFOFd0mBCN JLwCXW4gkE3BpRCQQ0vWCiuoNuc0WT6D/kJPiQwMDD95/m5GOi347qA X-Developer-Key: i=alchark@gmail.com; a=ed25519; pk=xRO8VeD3J5jhwe0za0aHt2LDumQr8cm0Ls7Jz3YGimk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_112709_222526_1C8E76DD X-CRM114-Status: GOOD ( 11.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This links the PWM fan on Radxa Rock 5B 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 Signed-off-by: Alexey Charkov Reviewed-by: Dragan Simic --- arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts | 30 ++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts index a0e303c3a1dc..3f7fb055c4dc 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts @@ -52,7 +52,7 @@ led_rgb_b { fan: pwm-fan { compatible = "pwm-fan"; - cooling-levels = <0 95 145 195 255>; + cooling-levels = <0 120 150 180 210 240 255>; fan-supply = <&vcc5v0_sys>; pwms = <&pwm1 0 50000 0>; #cooling-cells = <2>; @@ -173,6 +173,34 @@ &cpu_l3 { cpu-supply = <&vdd_cpu_lit_s0>; }; +&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>; + }; + }; +}; + &i2c0 { pinctrl-names = "default"; pinctrl-0 = <&i2c0m2_xfer>;