From nobody Sat Sep 21 00:11:22 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A88CEC77B72 for ; Thu, 20 Apr 2023 09:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234552AbjDTJqC (ORCPT ); Thu, 20 Apr 2023 05:46:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234320AbjDTJpR (ORCPT ); Thu, 20 Apr 2023 05:45:17 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA64D2717; Thu, 20 Apr 2023 02:44:46 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (unknown [IPv6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id A2623660325F; Thu, 20 Apr 2023 10:44:44 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1681983885; bh=PtQuyZxzHrAdWjzyoJUqzJ9rjp5UV6ThgnDDcqGxVug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b4S+8bt+073+UwfKxzK89eiqxVuRMMQgGnGr70NmyPi3J6VbHYcHCkefFnKxZpFvC z7TgkhKfSDFbAKiVVhbO2pwQIkcW1xOM6Ua2nIGFhl5ogZZSVNgc+/jVtyGpvFOBIZ C3zu0NOH1i1sFOY498TZILfd6Sb4K3/r+4AsmV17NyJFgyh0EnAGUz7c5H54K1++HE WG0865c4HPmP0VaQ/AGs6Vqqnvali8JV6M9XJEfeJ/aQqEqwAfTw2POZZVM/xzIgcb Oa+ZxdbxjKDcigvIW+B66EMwSNfxWEsIxBCKq25LZ9JhR4/1rdZwzaAonUWlT6vvfr DPF84fekwmrgw== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com, AngeloGioacchino Del Regno Subject: [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration Date: Thu, 20 Apr 2023 11:44:29 +0200 Message-Id: <20230420094433.42794-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420094433.42794-1-angelogioacchino.delregno@collabora.com> References: <20230420094433.42794-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This platform has three auxiliary NTC thermistors, connected to the SoC's ADC pins. Enable the auxadc in order to be able to read the ADC values, add a generic-adc-thermal LUT for each and finally assign them to the SoC's thermal zones. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Tested-by: Chen-Yu Tsai --- .../boot/dts/mediatek/mt8195-cherry.dtsi | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/b= oot/dts/mediatek/mt8195-cherry.dtsi index 8ac80a136c37..0820e9ba3829 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi @@ -114,6 +114,77 @@ ppvar_sys: regulator-ppvar-sys { regulator-boot-on; }; =20 + /* Murata NCP03WF104F05RL */ + tboard_thermistor1: thermal-sensor-t1 { + compatible =3D "generic-adc-thermal"; + #thermal-sensor-cells =3D <0>; + io-channels =3D <&auxadc 0>; + io-channel-names =3D "sensor-channel"; + temperature-lookup-table =3D < (-10000) 1553 + (-5000) 1485 + 0 1406 + 5000 1317 + 10000 1219 + 15000 1115 + 20000 1007 + 25000 900 + 30000 796 + 35000 697 + 40000 605 + 45000 523 + 50000 449 + 55000 384 + 60000 327 + 65000 279 + 70000 237 + 75000 202 + 80000 172 + 85000 147 + 90000 125 + 95000 107 + 100000 92 + 105000 79 + 110000 68 + 115000 59 + 120000 51 + 125000 44>; + }; + + tboard_thermistor2: thermal-sensor-t2 { + compatible =3D "generic-adc-thermal"; + #thermal-sensor-cells =3D <0>; + io-channels =3D <&auxadc 1>; + io-channel-names =3D "sensor-channel"; + temperature-lookup-table =3D < (-10000) 1553 + (-5000) 1485 + 0 1406 + 5000 1317 + 10000 1219 + 15000 1115 + 20000 1007 + 25000 900 + 30000 796 + 35000 697 + 40000 605 + 45000 523 + 50000 449 + 55000 384 + 60000 327 + 65000 279 + 70000 237 + 75000 202 + 80000 172 + 85000 147 + 90000 125 + 95000 107 + 100000 92 + 105000 79 + 110000 68 + 115000 59 + 120000 51 + 125000 44>; + }; + usb_vbus: regulator-5v0-usb-vbus { compatible =3D "regulator-fixed"; regulator-name =3D "usb-vbus"; @@ -260,6 +331,10 @@ &gpu { mali-supply =3D <&mt6315_7_vbuck1>; }; =20 +&auxadc { + status =3D "okay"; +}; + &i2c0 { status =3D "okay"; =20 @@ -1098,6 +1173,36 @@ mt6315_7_vbuck1: vbuck1 { }; }; =20 +&thermal_zones { + soc_area_ntc { + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; + thermal-sensors =3D <&tboard_thermistor1>; + + trips { + trip-crit { + temperature =3D <95000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; + + pmic_area_ntc { + polling-delay =3D <1000>; + polling-delay-passive =3D <0>; + thermal-sensors =3D <&tboard_thermistor2>; + + trips { + trip-crit { + temperature =3D <95000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; +}; + &u3phy0 { status =3D "okay"; }; --=20 2.40.0