From patchwork Mon May 29 22:14:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 13258994 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 B9371C7EE32 for ; Mon, 29 May 2023 22:16:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229838AbjE2WP6 (ORCPT ); Mon, 29 May 2023 18:15:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbjE2WP5 (ORCPT ); Mon, 29 May 2023 18:15:57 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9BEF106; Mon, 29 May 2023 15:15:37 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4f505aace48so1175369e87.0; Mon, 29 May 2023 15:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685398536; x=1687990536; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+8fHtScnljw4UXuGT71iTdy546mGdF0un71thTjFMBs=; b=SzaictF88UivYzZk7rdaCd1yg5cBEoRPLffcNBgQKvXbvL1FW4NXuVAh0tog9g8ftT h0bLc+ASoFGPLR4L8yJpaEWpdSbhmghWX9JwQ2kNl6m1WIdJOLUXJzimpo6+iEUKGsob oLk5+S5HeZwQIGX6CytilufT7FKtExwdEuniX4Z7JOByjAf1UAcphtkDskah+V2WK1ia EQv5KNwNw+vCKk4MZGIsNsWQerE9vqv+vZ3PB7xFOQmZhR7ZbicGbMCucbR7eXVWrDVB b22AdmOqQqI5T+GD4HnOCqT/XQ8f3c8jYajDaXJONzC4ElqvcaY4rxsZywuvgbD9kW8R Mdxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685398536; x=1687990536; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+8fHtScnljw4UXuGT71iTdy546mGdF0un71thTjFMBs=; b=ZnJnGcJzYJC2w02CBs8dCTWMev4SxiLHc/mdJQkaZ9E8pM4+HIAZw93cCHZZw8oK7t B8UdpEiqsfkU8CfotuxBE996tFun/6sgOdX9nEs/MvO8qidBkM64F353e1kgG1Km+Nl+ NL4jDHf17Q78IOBVMzWNZ1LHH33cz3HnfgJmdApclBNNU8GJC/dKopJTq+/DJ3rtrSCh U+Q8hCVt3X1LFIQ0S7CzbB/5kOILzB92P0ROKnr9xojzVUsmhGEc2wJkkkzl4kvIsgMW xixczAKst75VhiLtlOwde/IhQjqzbkQPlTjBczwuszajOUBvQjlg0dpqacxlxDCtTY3s k/Vw== X-Gm-Message-State: AC+VfDz0GyVqSHpX+sxH2xRU6zD/4iRAaSUhHHv8tfDbP5N2niwMMljL 1USZ9KUB1G2cCM/91GwXh9Mf8345oWFXpQ== X-Google-Smtp-Source: ACHHUZ7m7GLRlSjEOLjdBR+p2hC4IFJnzGPgsTVEthvAwixE6uONiRgK0YSTRSXb7YurGNFIO/TOFA== X-Received: by 2002:a05:6512:481:b0:4f3:8c0d:41c2 with SMTP id v1-20020a056512048100b004f38c0d41c2mr16751lfq.54.1685398535856; Mon, 29 May 2023 15:15:35 -0700 (PDT) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id c20-20020ac24154000000b004eb12850c40sm132993lfi.14.2023.05.29.15.15.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 15:15:35 -0700 (PDT) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] ARM: dts: qcom: pm8226: Add thermal sensor and thermal zone config Date: Tue, 30 May 2023 01:14:59 +0300 Message-Id: <20230529221501.43455-2-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230529221501.43455-1-matti.lehtimaki@gmail.com> References: <20230529221501.43455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add thermal sensor, which is using on chip VADC channel to report PMIC die temperature. Also add the corresponding thermal zone. Signed-off-by: Matti Lehtimäki --- arch/arm/boot/dts/qcom-pm8226.dtsi | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm/boot/dts/qcom-pm8226.dtsi b/arch/arm/boot/dts/qcom-pm8226.dtsi index 46ba84f86c9f..3b8ad28cecb0 100644 --- a/arch/arm/boot/dts/qcom-pm8226.dtsi +++ b/arch/arm/boot/dts/qcom-pm8226.dtsi @@ -4,6 +4,36 @@ #include #include +/ { + thermal-zones { + pm8226-thermal { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-sensors = <&pm8226_temp>; + + trips { + trip0 { + temperature = <105000>; + hysteresis = <2000>; + type = "passive"; + }; + + trip1 { + temperature = <125000>; + hysteresis = <2000>; + type = "hot"; + }; + + crit { + temperature = <145000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; +}; + &spmi_bus { pm8226_0: pm8226@0 { compatible = "qcom,pm8226", "qcom,spmi-pmic"; @@ -55,6 +85,15 @@ smbb: charger@1000 { chg_otg: otg-vbus { }; }; + pm8226_temp: temp-alarm@2400 { + compatible = "qcom,spmi-temp-alarm"; + reg = <0x2400>; + interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>; + io-channels = <&pm8226_vadc VADC_DIE_TEMP>; + io-channel-names = "thermal"; + #thermal-sensor-cells = <0>; + }; + pm8226_vadc: adc@3100 { compatible = "qcom,spmi-vadc"; reg = <0x3100>; From patchwork Mon May 29 22:15:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 13258995 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 16888C7EE37 for ; Mon, 29 May 2023 22:16:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229866AbjE2WQA (ORCPT ); Mon, 29 May 2023 18:16:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229833AbjE2WP6 (ORCPT ); Mon, 29 May 2023 18:15:58 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E744FF; Mon, 29 May 2023 15:15:40 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4eed764a10cso3922965e87.0; Mon, 29 May 2023 15:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685398538; x=1687990538; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tmlJr9255kWhzt9IbTlRjHFJizJ8Idr5O0YOfzVhjSk=; b=sYITLYmGSawdm8kiiiMjyvlHX0qvVL9z8uaz7kFbWzQwrsLLdzVME2YZIDbgvh05Xv 1Kp/dCGIaxve32gBHeIhpkEgnS/8b9EBY+ksB61vQ++QI9FVT2RbPHthDqx4CJFQPY0q ELmy0iqFQi1Dg9CERW1AWlU+BfBTeYU1IPPo16Llobrz+4Qqm2MyrQRuy+eVVM81KuZk TzNbXT6EK2yE1ID1FAFL55v0v+tR2jM4pq/KhHorxitGOW6q79YebnB6lUenqwYJtSWL C4WK8FqziqMSA/5rS6vpolEJCvCFc+dhaoYtiDdVb8mcJzwX1XZLOUCFNBMzF+OLErVh NjIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685398538; x=1687990538; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tmlJr9255kWhzt9IbTlRjHFJizJ8Idr5O0YOfzVhjSk=; b=CIaHYeDAAvIKaQA0ETFdzYcZvsseHvgJ3ro3IKUlmF7yuPdjnWuKjRIsHX2c6dR6VE xlJfMZBlnof45aRddczqsBE6AsYFycgqHVVodXiyNmLedr4hbqbd8dPTvMr2vNH0nPVN f1uxWXJzsqlSyZ6eZGMIXx0i/avobRG1Za2MUcHLw7U2lIRMSqWYmU2m2oSfYQQfAtxH cla+SBP+t2q1HcldtpIHdB9ySPStd76oGSMA7f3tY++WgpZJOE8CCV/ows0zo8P20WQr E0SbOV57wrQzBBofGT5x/pUcyFQitkyy7la63A+8IF2QjNyrCP9qPUAtBIIPnzQfCLDq BMdQ== X-Gm-Message-State: AC+VfDx8ejWTE41xQ1EtZznzA7jOH11t8h344VTINC2JjxqOI7XinHni AE7MdkyxGVSzfwUNHWkL1usOiDGXKhJbqg== X-Google-Smtp-Source: ACHHUZ7XvUl5Fal5p/aF2zN6yfWyuWeQZkCXnWiPDGdUgtmWyALh+TmbVjIWaokF9ePdkCFNGD7B1g== X-Received: by 2002:a19:7516:0:b0:4f3:bb84:a775 with SMTP id y22-20020a197516000000b004f3bb84a775mr15499lfe.47.1685398538339; Mon, 29 May 2023 15:15:38 -0700 (PDT) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id c20-20020ac24154000000b004eb12850c40sm132993lfi.14.2023.05.29.15.15.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 15:15:37 -0700 (PDT) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] ARM: dts: qcom: pm8841: Add thermal zone config Date: Tue, 30 May 2023 01:15:00 +0300 Message-Id: <20230529221501.43455-3-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230529221501.43455-1-matti.lehtimaki@gmail.com> References: <20230529221501.43455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add thermal zone for the PMIC thermal sensor. Temperatures are based on downstream values, except for critical trip point where 140°C is used instead of 145°C due to limitations without a configured ADC. Signed-off-by: Matti Lehtimäki --- arch/arm/boot/dts/qcom-pm8841.dtsi | 33 +++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/qcom-pm8841.dtsi b/arch/arm/boot/dts/qcom-pm8841.dtsi index b5cdde034d18..3bf2ce5c86a6 100644 --- a/arch/arm/boot/dts/qcom-pm8841.dtsi +++ b/arch/arm/boot/dts/qcom-pm8841.dtsi @@ -2,6 +2,37 @@ #include #include + +/ { + thermal-zones { + pm8841-thermal { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-sensors = <&pm8841_temp>; + + trips { + trip0 { + temperature = <105000>; + hysteresis = <2000>; + type = "passive"; + }; + + trip1 { + temperature = <125000>; + hysteresis = <2000>; + type = "hot"; + }; + + crit { + temperature = <140000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; +}; + &spmi_bus { pm8841_0: pm8841@4 { @@ -20,7 +51,7 @@ pm8841_mpps: mpps@a000 { #interrupt-cells = <2>; }; - temp-alarm@2400 { + pm8841_temp: temp-alarm@2400 { compatible = "qcom,spmi-temp-alarm"; reg = <0x2400>; interrupts = <4 0x24 0 IRQ_TYPE_EDGE_RISING>; From patchwork Mon May 29 22:15:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 13258996 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 01308C7EE3A for ; Mon, 29 May 2023 22:16:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbjE2WQB (ORCPT ); Mon, 29 May 2023 18:16:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbjE2WQA (ORCPT ); Mon, 29 May 2023 18:16:00 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E7F5120; Mon, 29 May 2023 15:15:41 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f3b9e54338so4246137e87.0; Mon, 29 May 2023 15:15:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685398540; x=1687990540; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AqYkfa5sDJgAMTWjlOv2KfLblT5wPAPNCKQ3KCIe074=; b=SbjrkF9wlug1TUgUyIl+ptIUjtXZLUSEU+mKA9hy8iP/IYdaEuk4WIVHKJa+kPlVM9 AYqBuXrEeMS+NaF7Zw63BKXhbQhPEjn2RhsW7QmTi0kxnwP986IMW7YgAedFc4E6hSL4 RiwyJU5iQT6C+1GGh5mDkpQogDTcG8mhXxYgsmf145q9u1B/6fuvrH7HXX5MYEUI9qMm Q4eGitAL0eQSk1K2ULVjEyZ/g0+lyJ66anMm7ByH6gnSeEJZ86m2pqgvw5NRdwHCPdef hvMbSn76zLCzjHWPCoxJpnfK7BTWLG1G9F303Er0EgV/Vwi8nH+FGCWmfbKaunu+SGv+ crMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685398540; x=1687990540; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AqYkfa5sDJgAMTWjlOv2KfLblT5wPAPNCKQ3KCIe074=; b=ZD1TOWelI3QhOxYPSTg0WtpzSFg6Pau66PT76kfQdLlvXBXpt/VJy4lG8ILmGDmMou MXE68sJeQs05b6EEcYO1+F+l3pUhRNR3wz4DlaLegrTrt3rPsjQIdNVhTlxN6XrEMRQ0 8E1zQoHQU069P2V2WjP6/sCjXRO2w2IARTm7yuqdFYkbkqhuaotovQxCR6TzBqsQrvT9 ix0ghHONohUBWKvu10fLdSTo5vj57S7AsQL+UGWBkdEzJLiGnlmhALJWmJt7GesmHDg1 3+5KMk4uTnsr0itwqxAfbR+gXcubcHrHeb/4yGGv08xO+R8l5oQ2hgg+P8kkeJm+j34L aUFA== X-Gm-Message-State: AC+VfDxK4IiRZna94nIgG3sGmkM9btDTrry/WcHfrSaodL1RFF6mrAin cWvL0+glQKrMDtiMMuT+LZ2veaBZXSL0ew== X-Google-Smtp-Source: ACHHUZ6Mfd9AZLyIGNfOj5sv2Lt7e9LVTCTXeVYrnqr6Vg4aoeoL3DR83Q6prMThRXl9YQMLj/a8SA== X-Received: by 2002:ac2:4d10:0:b0:4f2:5393:b7c with SMTP id r16-20020ac24d10000000b004f253930b7cmr12095lfi.67.1685398539899; Mon, 29 May 2023 15:15:39 -0700 (PDT) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id c20-20020ac24154000000b004eb12850c40sm132993lfi.14.2023.05.29.15.15.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 15:15:39 -0700 (PDT) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] ARM: dts: qcom: pm8941: Add thermal zone config Date: Tue, 30 May 2023 01:15:01 +0300 Message-Id: <20230529221501.43455-4-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230529221501.43455-1-matti.lehtimaki@gmail.com> References: <20230529221501.43455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add thermal zone for the PMIC thermal sensor. Signed-off-by: Matti Lehtimäki --- arch/arm/boot/dts/qcom-pm8941.dtsi | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm/boot/dts/qcom-pm8941.dtsi b/arch/arm/boot/dts/qcom-pm8941.dtsi index a821f0368a28..b3e246bacd78 100644 --- a/arch/arm/boot/dts/qcom-pm8941.dtsi +++ b/arch/arm/boot/dts/qcom-pm8941.dtsi @@ -3,6 +3,37 @@ #include #include + +/ { + thermal-zones { + pm8941-thermal { + polling-delay-passive = <100>; + polling-delay = <0>; + thermal-sensors = <&pm8941_temp>; + + trips { + trip0 { + temperature = <105000>; + hysteresis = <2000>; + type = "passive"; + }; + + trip1 { + temperature = <125000>; + hysteresis = <2000>; + type = "hot"; + }; + + crit { + temperature = <145000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; +}; + &spmi_bus { pm8941_0: pm8941@0 {