From 624c9ee57f1e9179c6805c57a2200ef05a30e790 Mon Sep 17 00:00:00 2001 From: Veera Vegivada Date: Tue, 17 Aug 2021 11:44:26 +0530 Subject: [PATCH] ARM: dts: msm: Add ADC support for SA8155 Add VADC and ADC_TM nodes and user thermal zones for ADC thermistors on SA8155. Change-Id: I819fad835c5e92cb2eb420d56456517417ce68fd --- qcom/sa8155-pmic-overlay.dtsi | 104 ++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/qcom/sa8155-pmic-overlay.dtsi b/qcom/sa8155-pmic-overlay.dtsi index 36fea69d..f0ec5376 100644 --- a/qcom/sa8155-pmic-overlay.dtsi +++ b/qcom/sa8155-pmic-overlay.dtsi @@ -15,6 +15,27 @@ pm8150_1_rtc: &pm8150_rtc { pm8150_1_gpios: &pm8150_gpios { }; +pm8150_1_vadc: &pm8150_vadc { + xo_therm { + reg = ; + label = "xo_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <1>; + qcom,pre-scaling = <1 1>; + }; +}; + +pm8150_1_adc_tm: &pm8150_adc_tm { + io-channels = <&pm8150_1_vadc ADC5_XO_THERM_100K_PU>; + + xo_therm@0 { + reg = <0>; + io-channels = <&pm8150_1_vadc ADC5_XO_THERM_100K_PU>; + qcom,ratiometric; + qcom,hw-settle-time = <1>; + }; +}; + /* PM8150_2: */ &spmi_bus { #address-cells = <2>; @@ -90,6 +111,48 @@ pm8150_1_gpios: &pm8150_gpios { label = "die_temp"; qcom,pre-scaling = <1 1>; }; + + ufs_therm { + reg = ; + label = "ufs_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + soc_therm { + reg = ; + label = "soc_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + }; + + pm8150_2_adc_tm: adc_tm@3500 { + compatible = "qcom,spmi-adc-tm5"; + reg = <0x3500>; + interrupts = <0x4 0x35 0x0 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "threshold"; + #address-cells = <1>; + #size-cells = <0>; + #thermal-sensor-cells = <1>; + io-channels = <&pm8150_2_vadc ADC5_XO_THERM_100K_PU>, + <&pm8150_2_vadc ADC5_AMUX_THM1_100K_PU>; + + ufs_therm@0 { + reg = <0>; + io-channels = <&pm8150_2_vadc ADC5_XO_THERM_100K_PU>; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + }; + + soc_therm@1 { + reg = <1>; + io-channels = <&pm8150_2_vadc ADC5_AMUX_THM1_100K_PU>; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + }; }; }; @@ -166,4 +229,45 @@ pm8150_1_gpios: &pm8150_gpios { }; + xo-therm { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pm8150_1_adc_tm 0>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + ufs-therm { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pm8150_2_adc_tm 0>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + soc-therm { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pm8150_2_adc_tm 1>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; };