Skip to contentSkip to conversation

Thermal zones for pm8226, pm8841 and pm8941

PATCH Applied Matti Lehtimäki 2 participants 5 messages May 29, 2023 – Jun 13, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
2.34.1
#1 lore raw

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.

---
 arch/arm/boot/dts/qcom-pm8226.dtsi | 39 ++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
arch/arm/boot/dts/qcom-pm8226.dtsi +39 -0
index 46ba84f86c9f..3b8ad28cecb0 100644
@@ -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>;
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/3 ARM: dts: qcom: pm8841: Add thermal zone config

In reply to Matti Lehtimäki

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.

---
 arch/arm/boot/dts/qcom-pm8841.dtsi | 33 +++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)
arch/arm/boot/dts/qcom-pm8841.dtsi +32 -1
index b5cdde034d18..3bf2ce5c86a6 100644
@@ -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>;
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/3 ARM: dts: qcom: pm8941: Add thermal zone config

In reply to Matti Lehtimäki

Add thermal zone for the PMIC thermal sensor.

---
 arch/arm/boot/dts/qcom-pm8941.dtsi | 31 ++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/qcom-pm8941.dtsi +31 -0
index a821f0368a28..b3e246bacd78 100644
@@ -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 {
Signature · 1 line
2.34.1
#4 lore raw
In reply to Matti Lehtimäki
Quoted 10 lines · Matti Lehtimäki

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,

Signature · 1 line
Bjorn Andersson <[email protected]>