From 86a09d8fcaaeb358f589d41115da2dfb505fec6a Mon Sep 17 00:00:00 2001 From: Jishnu Prakash Date: Wed, 5 May 2021 15:22:59 +0530 Subject: [PATCH] ARM: dts: msm: Add ADC support for PM5100 Add ADC5 Gen3 device with ADC channel nodes for PM5100. Also add ADC channels and thermal zones for ADC thermistors on monaco. Change-Id: I9f92730608d34157ed57e53ba44bb5bcd97512ff --- qcom/monaco-pmic.dtsi | 95 ++++++++++++++++++++++++++++++++++++++++++ qcom/monaco.dtsi | 2 + qcom/pm5100.dtsi | 96 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 193 insertions(+) diff --git a/qcom/monaco-pmic.dtsi b/qcom/monaco-pmic.dtsi index 6b56202bbbec..4f160924154f 100644 --- a/qcom/monaco-pmic.dtsi +++ b/qcom/monaco-pmic.dtsi @@ -32,3 +32,98 @@ }; }; }; + +&pm5100_adc { + pm5100_xo_therm { + qcom,adc-tm-type = <1>; + }; + + pm5100_pa_therm_0 { + reg = ; + label = "pm5100_pa_therm_0"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + qcom,adc-tm-type = <1>; + }; + + pm5100_quiet_therm { + reg = ; + label = "pm5100_quiet_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + qcom,adc-tm-type = <1>; + }; + + pm5100_msm_therm { + reg = ; + label = "pm5100_msm_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + qcom,adc-tm-type = <1>; + }; +}; + +&thermal_zones { + xo-therm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pm5100_adc PM5100_ADC5_GEN3_AMUX1_THM_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + pa-therm0-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pm5100_adc PM5100_ADC5_GEN3_AMUX4_THM_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + quiet-therm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pm5100_adc PM5100_ADC5_GEN3_AMUX5_THM_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + sdm-skin-therm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pm5100_adc PM5100_ADC5_GEN3_AMUX6_THM_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; +}; diff --git a/qcom/monaco.dtsi b/qcom/monaco.dtsi index 204fe4039a33..a34b6e59b0d3 100644 --- a/qcom/monaco.dtsi +++ b/qcom/monaco.dtsi @@ -895,6 +895,8 @@ cell-index = <0>; }; + thermal_zones: thermal-zones {}; + slim_aud: slim@a5c0000 { cell-index = <1>; compatible = "qcom,slim-ngd"; diff --git a/qcom/pm5100.dtsi b/qcom/pm5100.dtsi index ff498fe835f7..5fbe48b0fca5 100644 --- a/qcom/pm5100.dtsi +++ b/qcom/pm5100.dtsi @@ -1,6 +1,8 @@ #include #include #include +#include +#include &spmi_bus { #address-cells = <2>; @@ -39,6 +41,100 @@ #thermal-sensor-cells = <0>; }; + pm5100_adc: vadc@8000 { + compatible = "qcom,spmi-adc5-gen3"; + reg = <0x8000>, <0x8300>; + reg-names = "adc5-gen3-base", "adc5-gen3-debug-base"; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <0x0 0x80 0x1 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "adc"; + #io-channel-cells = <1>; + status = "disabled"; + + pm5100_ref_gnd { + reg = ; + label = "pm5100_ref_gnd"; + qcom,pre-scaling = <1 1>; + }; + + pm5100_vref_1p25 { + reg = ; + label = "pm5100_vref_1p25"; + qcom,pre-scaling = <1 1>; + }; + + pm5100_die_temp { + reg = ; + label = "pm5100_die_temp"; + qcom,pre-scaling = <1 1>; + }; + + pm5100_xo_therm { + reg = ; + label = "pm5100_xo_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <700>; + qcom,pre-scaling = <1 1>; + }; + + pm5100_usb_in_i_uv { + reg = ; + label = "pm5100_usb_in_i_uv"; + qcom,pre-scaling = <1 1>; + qcom,scale-fn-type = ; + }; + + pm5100_chg_temp { + reg = ; + label = "pm5100_chg_temp"; + qcom,pre-scaling = <1 1>; + qcom,scale-fn-type = ; + }; + + pm5100_usb_in_v { + reg = ; + label = "pm5100_usb_in_v"; + qcom,pre-scaling = <1 16>; + }; + + pm5100_boost_out_v { + reg = ; + label = "pm5100_boost_out_v"; + qcom,pre-scaling = <1 6>; + }; + + pm5100_bat_therm { + reg = ; + label = "pm5100_bat_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + qcom,scale-fn-type = ; + }; + + pm5100_bat_id { + reg = ; + label = "pm5100_bat_id"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + qcom,scale-fn-type = ; + }; + + pm5100_vph_pwr { + reg = ; + label = "pm5100_vph_pwr"; + qcom,pre-scaling = <1 3>; + }; + + pm5100_vbat_sns { + reg = ; + label = "pm5100_vbat_sns"; + qcom,pre-scaling = <1 3>; + }; + }; + pm5100_gpios: pinctrl@8800 { compatible = "qcom,pm5100-gpio"; reg = <0x8800>;