2023-05-29 22:19:36

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 0/3] Thermal zones for pm8226, pm8841 and pm8941

Add thermal sensor for pm8226, which is using on chip VADC channel to
report PMIC die temperature. Add thermal zone configurations for
PMIC thermal sensors found in pm8226, pm8841 and pm8941.

Matti Lehtimäki (3):
ARM: dts: qcom: pm8226: Add thermal sensor and thermal zone config
ARM: dts: qcom: pm8841: Add thermal zone config
ARM: dts: qcom: pm8941: Add thermal zone config

arch/arm/boot/dts/qcom-pm8226.dtsi | 39 ++++++++++++++++++++++++++++++
arch/arm/boot/dts/qcom-pm8841.dtsi | 33 ++++++++++++++++++++++++-
arch/arm/boot/dts/qcom-pm8941.dtsi | 31 ++++++++++++++++++++++++
3 files changed, 102 insertions(+), 1 deletion(-)

--
2.34.1



2023-05-29 22:38:04

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 3/3] ARM: dts: qcom: pm8941: Add thermal zone config

Add thermal zone for the PMIC thermal sensor.

Signed-off-by: Matti Lehtimäki <[email protected]>
---
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 <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>

+
+/ {
+ 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 {
--
2.34.1


2023-05-29 22:38:19

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 1/3] ARM: dts: qcom: pm8226: Add thermal sensor and thermal zone config

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 <[email protected]>
---
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 <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>

+/ {
+ 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>;
--
2.34.1


2023-05-29 22:38:40

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 2/3] ARM: dts: qcom: pm8841: Add thermal zone config

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 <[email protected]>
---
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 <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>

+
+/ {
+ 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>;
--
2.34.1


2023-06-13 23:55:41

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 0/3] Thermal zones for pm8226, pm8841 and pm8941

On Tue, 30 May 2023 01:14:58 +0300, Matti Lehtimäki wrote:
> Add thermal sensor for pm8226, which is using on chip VADC channel to
> report PMIC die temperature. Add thermal zone configurations for
> PMIC thermal sensors found in pm8226, pm8841 and pm8941.
>
> Matti Lehtimäki (3):
> ARM: dts: qcom: pm8226: Add thermal sensor and thermal zone config
> ARM: dts: qcom: pm8841: Add thermal zone config
> ARM: dts: qcom: pm8941: Add thermal zone config
>
> [...]

Applied, thanks!

[1/3] ARM: dts: qcom: pm8226: Add thermal sensor and thermal zone config
commit: 1b118df488f2be09b846994a4135d57f634e564b
[2/3] ARM: dts: qcom: pm8841: Add thermal zone config
commit: 84e72ea467db83043858b48fcd97de4c9e68881a
[3/3] ARM: dts: qcom: pm8941: Add thermal zone config
commit: 637cc974046abe5718bf045a1bc66a238778a145

Best regards,
--
Bjorn Andersson <[email protected]>