Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2769538rwr; Fri, 21 Apr 2023 13:54:36 -0700 (PDT) X-Google-Smtp-Source: AKy350bE8GsczlBFr8fbseMaAMOQUTeRJrrrq/qPg6RteQiauGfngOKvTKPL89LVE3YDyxISCMap X-Received: by 2002:a17:90a:1a10:b0:23b:4bce:97de with SMTP id 16-20020a17090a1a1000b0023b4bce97demr5790322pjk.4.1682110475654; Fri, 21 Apr 2023 13:54:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682110475; cv=none; d=google.com; s=arc-20160816; b=LH1V7P01lO4hTmfX00Dz1eNYPOE+qvA5A27mUARhbES+QWmB7p3IP37mX9yA44QHlv iwTIi34SfBTCRNbwJ+9HNYkj6NxKDmAky8n8IHrkqKRWMloIRnuFG1CE+EdBSlzhQLu6 Zc/makPy/dse26Lb0SYYLWK4kfMG0zf4CM4gPLWMM5cgKHagETPjh2FUI8IzdC4B3f7d rfStnnQ5u6b9tkulYoezs6puASx5GTi/+Hn86KDb5+JIg7LwRXtHxrKxh33kLaKcrU8M qtfWfBJi1hMvz1o8vvYTNtcaBM6jonxDwnvZoYTTbrXyJ4t7bm5S8KGuaCKDogLV/49B 3+IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RXNfwThjPsAnC+Qyr1ykQ/RbKbz71i3w4p/TAFsNpnI=; b=krocurgQNIb2G5mBRku3u18FDwy/D+NuFbbOXbyvf7Q1/zcBBVpsHrxlVnJRizrjvY 2ceK26gT1nZSZ0dW44T8JHYTe9gHysXznq4QBwEoSbYMWxeoBBb76fxob05AaFYc0pDh x5Jzxm7mWsWf2GSdqID0ezh7WO2r5prLnMPWemo3C3SlJ5mtqENFfaegZKhH34nc0gQN 7nfovDtQRCGBL0FUPHpT4KkU4B+RwY34nHuyzIBK9q0DvnsV8Sk0v3lbkIHxS4Tv5pIR w9L0PmpP26g3Hr0ycLzyObHpmLQnGh+kb808LkWDQSEWm6dARPGFXVLq7of4nSz8riP5 FDeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PnIU0vlo; 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 o5-20020a63e345000000b0050bf617d84fsi2838500pgj.249.2023.04.21.13.54.24; Fri, 21 Apr 2023 13:54:35 -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=PnIU0vlo; 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 S230076AbjDUUxM (ORCPT + 99 others); Fri, 21 Apr 2023 16:53:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbjDUUxL (ORCPT ); Fri, 21 Apr 2023 16:53:11 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C81961FD5; Fri, 21 Apr 2023 13:53:08 -0700 (PDT) Received: from notapiano (unknown [IPv6:2600:4041:5b1a:cd00:524d:e95d:1a9c:492a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 13317660327C; Fri, 21 Apr 2023 21:53:05 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1682110387; bh=fnT9RDQavvIKBkmdeIY564q2m/UajYumE4RK3iuUElc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PnIU0vlo5rtx9wiuXhFSN4epaUL3RfZISYxZuHDKXz0WogABPf3NvgRNS8FTcOf4C y2jxn/0Ux3d8ERo0JuLzuvh9hbphi2cc1ItOkrfWRQUDqyQx15qKKrn2clT0iIcht7 BYxrPzWZnNtgqrBeTNgSdT4EuGo0LHcowv/VgWglY4iBppyjWYz8gcnykY0kHbJXJS MsqJTDEkvDEQn+Qyh5x8XYNv6gcA4aoqN6TsbWtTY++h2P1ce4cwbqGgG5kFEXm4gM D189oWQURbDxbOljpGo2Zm1whXenUSayDykvIHESNbY4T6W3TZ/MdIbHKlMemOeBo1 yRdnUjILMGwsw== Date: Fri, 21 Apr 2023 16:53:01 -0400 From: =?utf-8?B?TsOtY29sYXMgRi4gUi4gQS4=?= Prado To: Chen-Yu Tsai Cc: AngeloGioacchino Del Regno , matthias.bgg@gmail.com, 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 Subject: Re: [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration Message-ID: <5ede9421-54d6-4dda-91af-2acbf46c2d3e@notapiano> References: <20230420094433.42794-1-angelogioacchino.delregno@collabora.com> <20230420094433.42794-2-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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,URIBL_BLOCKED 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 On Fri, Apr 21, 2023 at 03:37:52PM +0800, Chen-Yu Tsai wrote: > On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno > wrote: > > > > 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 { Not sure if that's what's causing the issue, but the thermal zone name should end with -thermal as per the binding. Also note that it needs to be under 20 characters otherwise it will fail to be registered with -22 like below. (Also, node names shouldn't contain underscore) Thanks, Nícolas > > + 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"; > > + }; > > + }; > > + }; > > I'm still getting: > > thermal_sys: Failed to find 'trips' node > thermal_sys: Failed to find trip points for thermal-sensor-t1 id=0 > generic-adc-thermal thermal-sensor-t1: Thermal zone sensor register failed: -22 > generic-adc-thermal: probe of thermal-sensor-t1 failed with error -22 > thermal_sys: Failed to find 'trips' node > thermal_sys: Failed to find trip points for thermal-sensor-t2 id=0 > generic-adc-thermal thermal-sensor-t2: Thermal zone sensor register failed: -22 > generic-adc-thermal: probe of thermal-sensor-t2 failed with error -22 > thermal_sys: Failed to find 'trips' node > thermal_sys: Failed to find trip points for thermal-sensor-t3 id=0 > generic-adc-thermal thermal-sensor-t3: Thermal zone sensor register failed: -22 > generic-adc-thermal: probe of thermal-sensor-t3 failed with error -22 > > > > > +}; > > + > > &u3phy0 { > > status = "okay"; > > }; > > -- > > 2.40.0 > > > >