]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arm64: dts: qcom: qcs6490-rb3gen2: Add vadc and adc-tm channels
authorRakesh Kota <quic_kotarake@quicinc.com>
Wed, 12 Feb 2025 11:33:42 +0000 (17:03 +0530)
committerBjorn Andersson <andersson@kernel.org>
Fri, 21 Feb 2025 21:50:23 +0000 (15:50 -0600)
Add support for vadc and adc-tm channels which are used for
monitoring thermistors present on the platform.

- Add the necessary includes for qcom,spmi-adc7-pm7325 and
  qcom,spmi-adc7-pmk8350.
- Add thermal zones for quiet-thermal, sdm-skin-thermal, and
  xo-thermal, and define their polling delays and thermal sensors.
- Configure the pm7325_temp_alarm node to use the pmk8350_vadc
  channel for thermal monitoring.
- Configure the pmk8350_adc_tm node to enable its thermal sensors
  and define their registers and settings.
- Configure the pmk8350_vadc node to define its channels and settings

Signed-off-by: Rakesh Kota <quic_kotarake@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250212113342.873086-1-quic_kotarake@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts

index 7a36c90ad4ec8b52f30b22b1621404857d6ef336..fe2d14865a7562adf2643b48e61b905e8cc565e5 100644 (file)
@@ -9,6 +9,8 @@
 #define PM7250B_SID 8
 #define PM7250B_SID1 9
 
+#include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
+#include <dt-bindings/iio/qcom,spmi-adc7-pm7325.h>
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
                };
        };
 
+       thermal-zones {
+               sdm-skin-thermal {
+                       thermal-sensors = <&pmk8350_adc_tm 3>;
+
+                       trips {
+                               active-config0 {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               quiet-thermal {
+                       thermal-sensors = <&pmk8350_adc_tm 1>;
+
+                       trips {
+                               active-config0 {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               xo-thermal {
+                       thermal-sensors = <&pmk8350_adc_tm 0>;
+
+                       trips {
+                               active-config0 {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+       };
+
        vph_pwr: vph-pwr-regulator {
                compatible = "regulator-fixed";
                regulator-name = "vph_pwr";
        };
 };
 
+&pm7325_temp_alarm {
+       io-channels = <&pmk8350_vadc PM7325_ADC7_DIE_TEMP>;
+       io-channel-names = "thermal";
+};
+
+&pmk8350_adc_tm {
+       status = "okay";
+
+       xo-therm@0 {
+               reg = <0>;
+               io-channels = <&pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time-us = <200>;
+       };
+
+       quiet-therm@1 {
+               reg = <1>;
+               io-channels = <&pmk8350_vadc PM7325_ADC7_AMUX_THM1_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time-us = <200>;
+       };
+
+       sdm-skin-therm@3 {
+               reg = <3>;
+               io-channels = <&pmk8350_vadc PM7325_ADC7_AMUX_THM3_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time-us = <200>;
+       };
+};
+
 &pm8350c_pwm {
        nvmem = <&pmk8350_sdam_21>,
                <&pmk8350_sdam_22>;
        status = "okay";
 };
 
+&pmk8350_vadc {
+       channel@3 {
+               reg = <PMK8350_ADC7_DIE_TEMP>;
+               label = "pmk8350_die_temp";
+               qcom,pre-scaling = <1 1>;
+       };
+
+       channel@44 {
+               reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
+               label = "xo_therm";
+               qcom,hw-settle-time = <200>;
+               qcom,pre-scaling = <1 1>;
+               qcom,ratiometric;
+       };
+
+       channel@103 {
+               reg = <PM7325_ADC7_DIE_TEMP>;
+               label = "pm7325_die_temp";
+               qcom,pre-scaling = <1 1>;
+       };
+
+       channel@144 {
+               reg = <PM7325_ADC7_AMUX_THM1_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time = <200>;
+               qcom,pre-scaling = <1 1>;
+               label = "pm7325_quiet_therm";
+       };
+
+       channel@146 {
+               reg = <PM7325_ADC7_AMUX_THM3_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time = <200>;
+               qcom,pre-scaling = <1 1>;
+               label = "pm7325_sdm_skin_therm";
+       };
+};
+
 &pon_pwrkey {
        status = "okay";
 };