arm64: dts: qcom: sc8280xp-x13s: Add thermal zone support
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thu, 3 Nov 2022 09:58:10 +0000 (15:28 +0530)
committerBjorn Andersson <andersson@kernel.org>
Mon, 7 Nov 2022 03:11:11 +0000 (21:11 -0600)
Add thermal zone support by making use of the thermistor SYS_THERM6.
Based on experiments, this thermistor seems to reflect the actual
surface temperature of the laptop.

For the cooling device, all BIG CPU cores are throttled down to keep the
temperature at a sane level.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221103095810.64606-13-manivannan.sadhasivam@linaro.org
arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts

index 6d96f0b54880ee8e6908ade161fb6affca4d9b16..66ca0136eb9612788ebf964c758e101cdf33ad46 100644 (file)
                pinctrl-0 = <&edp_bl_en>, <&edp_bl_pwm>;
        };
 
+       thermal-zones {
+               skin-temp-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&pmk8280_adc_tm 5>;
+
+                       trips {
+                               skin_temp_alert0: trip-point0 {
+                                       temperature = <55000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               skin_temp_alert1: trip-point1 {
+                                       temperature = <58000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               skin-temp-crit {
+                                       temperature = <73000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&skin_temp_alert0>;
+                                       cooling-device = <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+
+                               map1 {
+                                       trip = <&skin_temp_alert1>;
+                                       cooling-device = <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+       };
+
        vreg_edp_bl: regulator-edp-bl {
                compatible = "regulator-fixed";