ARM: dts: qcom: pm8226: Add thermal sensor and thermal zone config
authorMatti Lehtimäki <matti.lehtimaki@gmail.com>
Mon, 29 May 2023 22:14:59 +0000 (01:14 +0300)
committerBjorn Andersson <andersson@kernel.org>
Tue, 13 Jun 2023 23:28:15 +0000 (16:28 -0700)
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 <matti.lehtimaki@gmail.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230529221501.43455-2-matti.lehtimaki@gmail.com
arch/arm/boot/dts/qcom-pm8226.dtsi

index 46ba84f..3b8ad28 100644 (file)
@@ -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";
                        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>;