Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp523365rwr; Thu, 20 Apr 2023 02:48:17 -0700 (PDT) X-Google-Smtp-Source: AKy350YUmwShijVahgkEJq60irA6zblgIsqQ4c/iTSgQ8rDatd/Pd9Sv5K7QgCAp9djwMYAfEl85 X-Received: by 2002:a17:90a:1b4b:b0:23f:962e:825d with SMTP id q69-20020a17090a1b4b00b0023f962e825dmr1083343pjq.1.1681984097075; Thu, 20 Apr 2023 02:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681984097; cv=none; d=google.com; s=arc-20160816; b=ZyAl2fded+K/mNHREc0RQ10Xrx60U3LELpS4l4x+BOpFRrF5opuFGyMw1xS5xOUm8z OaSPnkP58P+y7vYjzpCNgIy+jrVdp9myToutZ0sJCQPrAZhLTvo2yeuW0uDI+Twbk5Cm b7IPm/WKAWoopiWArroPauUOZY51RH1sNmCJHfck0SIyzR7LHXW/fzZpaRqa5XFRIWAI YicMBlABC1wULINfv2O21iwhLS95KPdrzZ+pCyv6MBD8QEUA7JAFkL9OvmCDOFna0wSj P5YEq4o9eT5aKhr0A2jMpPZspK1MnrsfiDcmhxLmjD7KNHTOc7cOGXCdXYTV8cOodx4e lF9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Tdh7ek24ZSmi+j5bVgdAWjluQjV4G1M6gj6jbA0FQ3I=; b=rX05NBVv2RHQtyk6sinwXF52YjyVfapJ6mKFoaY50JbYKDUgQx9TIwlSAbhIbtTAwV Xtod/L2hhR2At+DYcb2YWWkOANsriUPI7+1/Das/W1ExvA3fSWYn0fH42F1/T2GBgzwl utmorl4mefiwXD+1OOvQsEcBrjXyTzUAn80NXVsP+dku+/m56KcaKPLAQezse0hS0Ex4 8XAfdpOSIXnZvg9UIr9urRBgO/nqZJAX0wugmqf+KUHADzqZj++/7UkGBQitBcULutzM yth6Ec5QPDbOHhUk7OdPguGqukEHfttwJD7rpk3+5tPk6JIbySZ4j5A+kDvDBwLX2dt1 TpIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=b4S+8bt+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga19-20020a17090b039300b00244930ffe45si1613958pjb.0.2023.04.20.02.48.03; Thu, 20 Apr 2023 02:48:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=b4S+8bt+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234551AbjDTJqB (ORCPT + 99 others); Thu, 20 Apr 2023 05:46:01 -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: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- .../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/boot/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; }; + /* Murata NCP03WF104F05RL */ + tboard_thermistor1: thermal-sensor-t1 { + compatible = "generic-adc-thermal"; + #thermal-sensor-cells = <0>; + io-channels = <&auxadc 0>; + io-channel-names = "sensor-channel"; + temperature-lookup-table = < (-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 = "generic-adc-thermal"; + #thermal-sensor-cells = <0>; + io-channels = <&auxadc 1>; + io-channel-names = "sensor-channel"; + temperature-lookup-table = < (-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 = "regulator-fixed"; regulator-name = "usb-vbus"; @@ -260,6 +331,10 @@ &gpu { mali-supply = <&mt6315_7_vbuck1>; }; +&auxadc { + status = "okay"; +}; + &i2c0 { status = "okay"; @@ -1098,6 +1173,36 @@ mt6315_7_vbuck1: vbuck1 { }; }; +&thermal_zones { + soc_area_ntc { + polling-delay = <1000>; + polling-delay-passive = <250>; + thermal-sensors = <&tboard_thermistor1>; + + trips { + trip-crit { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + pmic_area_ntc { + polling-delay = <1000>; + polling-delay-passive = <0>; + thermal-sensors = <&tboard_thermistor2>; + + trips { + trip-crit { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; +}; + &u3phy0 { status = "okay"; }; -- 2.40.0