arm64: dts: qcom: sm6125-seine: Configure additional trinket thermistors
authorMarijn Suijten <marijn.suijten@somainline.org>
Mon, 26 Sep 2022 19:01:48 +0000 (21:01 +0200)
committerBjorn Andersson <andersson@kernel.org>
Sun, 6 Nov 2022 02:47:03 +0000 (21:47 -0500)
In addition to PMIC-specific (pm6125) thermistors downstream extends
this set with the rf-pa0/rf-pa1, quiet, camera-flash and UFS/eMMC
thermistors in sm6125 (trinket) board and seine-specific DT files.  All
thermistors report sensible temperature readings in userspace.

The sensors are also added to their respective Thermal Monitor node,
with thermal zones to match where applicable: emmc-ufs and camera-flash
are not available on the TM5 block, hence cannot be configured with a
tripping point and will not have a thermal zone.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220926190148.283805-6-marijn.suijten@somainline.org
arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts

index 290842a..0de6c5b 100644 (file)
@@ -9,6 +9,7 @@
 #include "pm6125.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
        /* required for bootloader to select correct board */
                        no-map;
                };
        };
+
+       thermal-zones {
+               rf-pa0-thermal {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&pm6125_adc_tm 0>;
+
+                       trips {
+                               active-config0 {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               quiet-thermal {
+                       polling-delay-passive = <0>;
+                       polling-delay = <5000>;
+                       thermal-sensors = <&pm6125_adc_tm 1>;
+
+                       trips {
+                               active-config0 {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               xo-thermal {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&pm6125_adc_tm 2>;
+
+                       trips {
+                               active-config0 {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               rf-pa1-thermal {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&pm6125_adc_tm 3>;
+
+                       trips {
+                               active-config0 {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+       };
 };
 
 &hsusb_phy1 {
        status = "okay";
 };
 
+&pm6125_adc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&camera_flash_therm &emmc_ufs_therm &rf_pa1_therm>;
+
+       rf-pa0-therm@4d {
+               reg = <ADC5_AMUX_THM1_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time = <200>;
+               qcom,pre-scaling = <1 1>;
+       };
+
+       quiet-therm@4e {
+               reg = <ADC5_AMUX_THM2_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time = <200>;
+               qcom,pre-scaling = <1 1>;
+       };
+
+       camera-flash-therm@52 {
+               reg = <ADC5_GPIO1_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time = <200>;
+               qcom,pre-scaling = <1 1>;
+       };
+
+       emmc-ufs-therm@54 {
+               reg = <ADC5_GPIO3_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time = <200>;
+               qcom,pre-scaling = <1 1>;
+       };
+
+       rf-pa1-therm@55 {
+               reg = <ADC5_GPIO4_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time = <200>;
+               qcom,pre-scaling = <1 1>;
+       };
+};
+
+&pm6125_adc_tm {
+       status = "okay";
+
+       rf-pa0-therm@0 {
+               reg = <0>;
+               io-channels = <&pm6125_adc ADC5_AMUX_THM1_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time-us = <200>;
+       };
+
+       quiet-therm@1 {
+               reg = <1>;
+               io-channels = <&pm6125_adc ADC5_AMUX_THM2_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time-us = <200>;
+       };
+
+       xo-therm@2 {
+               reg = <2>;
+               io-channels = <&pm6125_adc ADC5_XO_THERM_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time-us = <200>;
+       };
+
+       rf-pa1-therm@3 {
+               reg = <3>;
+               io-channels = <&pm6125_adc ADC5_GPIO4_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time-us = <200>;
+       };
+};
+
+&pm6125_gpio {
+       camera_flash_therm: camera-flash-therm-state {
+               pins = "gpio3";
+               function = PMIC_GPIO_FUNC_NORMAL;
+               bias-high-impedance;
+       };
+
+       emmc_ufs_therm: emmc-ufs-therm-state {
+               pins = "gpio6";
+               function = PMIC_GPIO_FUNC_NORMAL;
+               bias-high-impedance;
+       };
+
+       rf_pa1_therm: rf-pa1-therm-state {
+               pins = "gpio7";
+               function = PMIC_GPIO_FUNC_NORMAL;
+               bias-high-impedance;
+       };
+};
+
 &pon_pwrkey {
        status = "okay";
 };