Skip to contentSkip to conversation

arm64: dts: qcom: pm6350: add temp sensor and thermal zone config

PATCH Applied Luca Weiss 2 participants 3 messages Oct 28, 2022 – Nov 8, 2022

Subsystems (3)
lore
Share & tools
lore

Luca Weiss

author
#0 lore raw

PATCH v2 1/2 arm64: dts: qcom: pm6350: add temp sensor and thermal zone config

Add temp-alarm device tree node and a default configuration for the corresponding thermal zone for this PMIC. Temperatures are based on downstream values, except for trip2 where 125°C is used instead of 145°C due to limitations without a configured ADC.

---
Changes in v2:
* Decrease trip2 temp to 125degC from 145degC after discussion with Matthias

 arch/arm64/boot/dts/qcom/pm6350.dtsi | 38 ++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
arch/arm64/boot/dts/qcom/pm6350.dtsi +38 -0
index ecf9b9919182..c9575cf0f518 100644
@@ -5,6 +5,37 @@
 
 #include <dt-bindings/spmi/spmi.h>
 
+/ {
+	thermal-zones {
+		pm6350-thermal {
+			polling-delay-passive = <100>;
+			polling-delay = <0>;
+
+			thermal-sensors = <&pm6350_temp>;
+
+			trips {
+				trip0 {
+					temperature = <95000>;
+					hysteresis = <0>;
+					type = "passive";
+				};
+
+				trip1 {
+					temperature = <115000>;
+					hysteresis = <0>;
+					type = "hot";
+				};
+
+				trip2 {
+					temperature = <125000>;
+					hysteresis = <0>;
+					type = "critical";
+				};
+			};
+		};
+	};
+};
+
 &spmi_bus {
 	pmic@0 {
 		compatible = "qcom,pm6350", "qcom,spmi-pmic";
@@ -35,6 +66,13 @@ pm6350_resin: resin {
 			};
 		};
 
+		pm6350_temp: temp-alarm@2400 {
+			compatible = "qcom,spmi-temp-alarm";
+			reg = <0x2400>;
+			interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
+			#thermal-sensor-cells = <0>;
+		};
+
 		pm6350_gpios: gpios@c000 {
 			compatible = "qcom,pm6350-gpio", "qcom,spmi-gpio";
 			reg = <0xc000>;
Signature · 1 line
2.38.1
author
#1 lore raw

PATCH v2 2/2 arm64: dts: qcom: pm6150l: add temp sensor and thermal zone config

Add temp-alarm device tree node and a default configuration for the corresponding thermal zone for this PMIC. Temperatures are based on downstream values, except for trip2 where 125°C is used instead of 145°C due to limitations without a configured ADC.

---
Changes in v2:
* new patch, very similar to pm6350 one

 arch/arm64/boot/dts/qcom/pm6150l.dtsi | 38 +++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
arch/arm64/boot/dts/qcom/pm6150l.dtsi +38 -0
index f02c223ef448..3f7e047cfc06 100644
@@ -5,6 +5,37 @@
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
 
+/ {
+	thermal-zones {
+		pm6150l-thermal {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+
+			thermal-sensors = <&pm6150l_temp>;
+
+			trips {
+				trip0 {
+					temperature = <95000>;
+					hysteresis = <0>;
+					type = "passive";
+				};
+
+				trip1 {
+					temperature = <115000>;
+					hysteresis = <0>;
+					type = "hot";
+				};
+
+				trip2 {
+					temperature = <125000>;
+					hysteresis = <0>;
+					type = "critical";
+				};
+			};
+		};
+	};
+};
+
 &spmi_bus {
 	pm6150l_lsid4: pmic@4 {
 		compatible = "qcom,pm6150l", "qcom,spmi-pmic";
@@ -12,6 +43,13 @@ pm6150l_lsid4: pmic@4 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		pm6150l_temp: temp-alarm@2400 {
+			compatible = "qcom,spmi-temp-alarm";
+			reg = <0x2400>;
+			interrupts = <0x4 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
+			#thermal-sensor-cells = <0>;
+		};
+
 		pm6150l_adc: adc@3100 {
 			compatible = "qcom,spmi-adc5";
 			reg = <0x3100>;
Signature · 1 line
2.38.1
maintainer Applied
#2 lore raw

Re: (subset) [PATCH v2 1/2] arm64: dts: qcom: pm6350: add temp sensor and thermal zone config

In reply to Luca Weiss
Quoted 6 lines · Luca Weiss

Add temp-alarm device tree node and a default configuration for the corresponding thermal zone for this PMIC. Temperatures are based on downstream values, except for trip2 where 125°C is used instead of 145°C due to limitations without a configured ADC.

Applied, thanks!

[1/2] arm64: dts: qcom: pm6350: add temp sensor and thermal zone config

      commit: 16c0c46f38183573de5361d278772cfed2090b1c
[2/2] arm64: dts: qcom: pm6150l: add temp sensor and thermal zone config
      commit: ce1b5eb74b3ef042b1c797f04e8683e7cad34ae6

Best regards,

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