diff options
author | Asha Magadi Venkateshamurthy <c_amagad@qti.qualcomm.com> | 2021-01-26 21:48:20 +0530 |
---|---|---|
committer | Archana Sriram <c_apsrir@qti.qualcomm.com> | 2021-11-08 12:06:21 +0530 |
commit | 53d0e5b9f6a26789b8a68524dd2191cc8f4c7833 (patch) | |
tree | 9c5c240f0e9884341c9831f1f88d641c10e6193d | |
parent | 1b6b002137d34e13435bb2ed5de4e453911e152c (diff) | |
download | devicetree-53d0e5b9f6a26789b8a68524dd2191cc8f4c7833.tar.gz |
ARM: dts: msm: Update adc peripherals for SPF targets
Update SPMI based adc drivers instead of qpnp drivers for
SPF targets to take care of the driver changes for vadc,
temp-alarm, chg, bms, adc_tm, required for msm-4.19 kernel.
Change-Id: I2db5ae18c7d7aaa93079b89c261884ba8708ba75
-rw-r--r-- | qcom/pm8916.dtsi | 104 | ||||
-rw-r--r-- | qcom/pm8937.dtsi | 267 | ||||
-rw-r--r-- | qcom/pm8953.dtsi | 232 | ||||
-rw-r--r-- | qcom/qm215-pm8916.dtsi | 231 | ||||
-rw-r--r-- | qcom/qm215-qrd-smb1360.dtsi | 3 | ||||
-rw-r--r-- | qcom/sdm439-pm8953.dtsi | 4 |
6 files changed, 435 insertions, 406 deletions
diff --git a/qcom/pm8916.dtsi b/qcom/pm8916.dtsi index f10c0094..f5059b43 100644 --- a/qcom/pm8916.dtsi +++ b/qcom/pm8916.dtsi @@ -1,3 +1,4 @@ +#include <dt-bindings/iio/qcom,spmi-vadc.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/spmi/spmi.h> @@ -76,63 +77,67 @@ pm8916_vadc: vadc@3100 { compatible = "qcom,spmi-vadc"; reg = <0x3100 0x100>; + interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; #address-cells = <1>; #size-cells = <0>; - interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "eoc-int-en-set"; - qcom,adc-bit-resolution = <15>; - qcom,adc-vdd-reference = <1800>; - qcom,vadc-poll-eoc; - qcom,pmic-revid = <&pm8916_revid>; - #thermal-sensor-cells = <1>; + #io-channel-cells = <1>; - chan@8 { + die_temp { + reg = <VADC_DIE_TEMP>; label = "die_temp"; - reg = <8>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <3>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; }; - chan@9 { + ref_625mv { + reg = <VADC_REF_625MV>; label = "ref_625mv"; - reg = <9>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; }; - chan@a { + ref_1250v { + reg = <VADC_REF_1250MV>; label = "ref_1250v"; - reg = <0xa>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; + }; + + ref_buf_625mv { + reg = <VADC_SPARE1>; + label = "ref_buf_625mv"; + qcom,pre-scaling = <1 1>; + }; + + ref_vdd { + reg = <VADC_VDD_VADC>; + label = "ref_vdd"; + qcom,pre-scaling = <1 1>; + }; + + ref_gnd { + reg = <VADC_GND_REF>; + label = "ref_gnd"; + qcom,pre-scaling = <1 1>; }; }; - pm8916_tz: qcom,temp-alarm@2400 { + pm8916_tz: temp-alarm@2400 { compatible = "qcom,spmi-temp-alarm"; reg = <0x2400 0x100>; - interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>; - label = "pm8916_tz"; - qcom,channel-num = <8>; - qcom,threshold-set = <0>; - qcom,temp_alarm-vadc = <&pm8916_vadc>; + interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>; + io-channels = <&pm8916_vadc VADC_DIE_TEMP>; + io-channel-names = "thermal"; #thermal-sensor-cells = <0>; }; + pm8916_adc_tm_iio: adc_tm_iio { + compatible = "qcom,adc-tm5-iio"; + reg = <0x3500 0x100>; + #address-cells = <1>; + #size-cells = <0>; + #thermal-sensor-cells = <1>; + }; + pm8916_adc_tm: vadc@3400 { - compatible = "qcom,adc-tm-rev2"; + compatible = "qcom,qpnp-adc-tm"; reg = <0x3400 0x100>; #address-cells = <1>; #size-cells = <0>; @@ -142,10 +147,15 @@ interrupt-names = "eoc-int-en-set", "high-thr-en-set", "low-thr-en-set"; - qcom,adc-bit-resolution = <15>; qcom,adc-vdd-reference = <1800>; - qcom,adc_tm-vadc = <&pm8916_vadc>; + #thermal-sensor-cells = <1>; qcom,pmic-revid = <&pm8916_revid>; + io-channels = <&pm8916_vadc VADC_REF_625MV>, + <&pm8916_vadc VADC_REF_1250MV>, + <&pm8916_vadc VADC_VDD_VADC>, + <&pm8916_vadc VADC_GND_REF>; + io-channel-names = "ref_625mv", "ref_1250v", "ref_vdd", + "ref_gnd"; }; pm8916_chg: qcom,charger { @@ -170,7 +180,9 @@ qcom,batt-cold-percentage = <80>; qcom,tchg-mins = <232>; qcom,resume-soc = <99>; - qcom,chg-vadc = <&pm8916_vadc>; + io-channels = <&pm8916_vadc VADC_VBAT_SNS>, + <&pm8916_vadc VADC_LR_MUX1_BAT_THERM>; + io-channel-names = "vbat_sns", "batt_therm"; qcom,chg-adc_tm = <&pm8916_adc_tm>; status = "disabled"; @@ -231,7 +243,15 @@ qcom,s3-ocv-tolerence-uv = <1200>; qcom,s2-fifo-length = <5>; qcom,low-soc-fifo-length = <2>; - qcom,bms-vadc = <&pm8916_vadc>; + io-channels = <&pm8916_vadc VADC_REF_625MV>, + <&pm8916_vadc VADC_REF_1250MV>, + <&pm8916_vadc VADC_VBAT_SNS>, + <&pm8916_vadc VADC_LR_MUX1_BAT_THERM>, + <&pm8916_vadc VADC_DIE_TEMP>, + <&pm8916_vadc VADC_LR_MUX2_BAT_ID>; + io-channel-names = "ref_625mv", "ref_1250v", + "vbat_sns", "batt_therm", + "die_temp", "batt_id"; qcom,bms-adc_tm = <&pm8916_adc_tm>; qcom,pmic-revid = <&pm8916_revid>; diff --git a/qcom/pm8937.dtsi b/qcom/pm8937.dtsi index 2a9ed193..701ad1c5 100644 --- a/qcom/pm8937.dtsi +++ b/qcom/pm8937.dtsi @@ -1,3 +1,7 @@ +#include <dt-bindings/iio/qcom,spmi-vadc.h> +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/spmi/spmi.h> + &spmi_bus { qcom,pm8937@0 { @@ -37,14 +41,12 @@ }; }; - pm8937_temp_alarm: qcom,temp-alarm@2400 { + pm8937_tz: qcom,temp-alarm@2400 { compatible = "qcom,spmi-temp-alarm"; reg = <0x2400 0x100>; interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>; - label = "pm8937_tz"; - qcom,channel-num = <8>; - qcom,threshold-set = <0>; - qcom,temp_alarm-vadc = <&pm8937_vadc>; + io-channels = <&pm8937_vadc VADC_DIE_TEMP>; + io-channel-names = "thermal"; #thermal-sensor-cells = <0>; }; @@ -104,185 +106,197 @@ pm8937_vadc: vadc@3100 { compatible = "qcom,spmi-vadc"; reg = <0x3100 0x100>; + interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; #address-cells = <1>; #size-cells = <0>; - interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "eoc-int-en-set"; - qcom,adc-bit-resolution = <15>; - qcom,adc-vdd-reference = <1800>; - qcom,vadc-poll-eoc; - #thermal-sensor-cells = <1>; + #io-channel-cells = <1>; + io-channel-ranges; pinctrl-names = "default"; pinctrl-0 = <&pa_therm1_default &cas_therm_default>; - chan@5 { + /* Channel nodes */ + vcoin { + reg = <VADC_VCOIN>; label = "vcoin"; - reg = <5>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <1>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 3>; }; - chan@7 { + vph_pwr { + reg = <VADC_VSYS>; label = "vph_pwr"; - reg = <7>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <1>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 3>; }; - chan@8 { + die_temp { + reg = <VADC_DIE_TEMP>; label = "die_temp"; - reg = <8>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <3>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; }; - chan@9 { + ref_625mv { + reg = <VADC_REF_625MV>; label = "ref_625mv"; - reg = <9>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; }; - chan@a { + ref_1250v { + reg = <VADC_REF_1250MV>; label = "ref_1250v"; - reg = <0xa>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; }; - chan@c { + ref_buf_625mv { + reg = <VADC_SPARE1>; label = "ref_buf_625mv"; - reg = <0xc>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; + }; + + ref_vdd { + reg = <VADC_VDD_VADC>; + label = "ref_vdd"; + qcom,pre-scaling = <1 1>; + }; + + ref_gnd { + reg = <VADC_GND_REF>; + label = "ref_gnd"; + qcom,pre-scaling = <1 1>; }; - chan@36 { + pa_therm0 { + reg = <VADC_LR_MUX7_HW_ID>; label = "pa_therm0"; - reg = <0x36>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <2>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; - chan@11 { + pa_therm1 { + reg = <VADC_P_MUX2_1_1>; label = "pa_therm1"; - reg = <0x11>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <2>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; - qcom,vadc-thermal-node; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; - chan@32 { + xo_therm { + reg = <VADC_LR_MUX3_XO_THERM>; label = "xo_therm"; - reg = <0x32>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <4>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; - qcom,vadc-thermal-node; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; - chan@3c { + xo_therm_buf { + reg = <VADC_LR_MUX3_BUF_XO_THERM>; label = "xo_therm_buf"; - reg = <0x3c>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <4>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; - qcom,vadc-thermal-node; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; - chan@13 { + case_therm { + reg = <VADC_P_MUX4_1_1>; label = "case_therm"; - reg = <0x13>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <2>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; - qcom,vadc-thermal-node; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + }; + + pm8937_adc_tm_iio: adc_tm_iio { + compatible = "qcom,adc-tm5-iio"; + reg = <0x3500 0x100>; + #address-cells = <1>; + #size-cells = <0>; + #thermal-sensor-cells = <1>; + io-channels = <&pm8937_vadc VADC_P_MUX2_1_1>, + <&pm8937_vadc VADC_LR_MUX3_XO_THERM>, + <&pm8937_vadc + VADC_LR_MUX3_BUF_XO_THERM>, + <&pm8937_vadc VADC_P_MUX4_1_1>; + + pa_therm1 { + reg = <VADC_P_MUX2_1_1>; + label = "pa_therm1"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + xo_therm { + reg = <VADC_LR_MUX3_XO_THERM>; + label = "xo_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + xo_therm_buf { + reg = <VADC_LR_MUX3_BUF_XO_THERM>; + label = "xo_therm_buf"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + case_therm { + reg = <VADC_P_MUX4_1_1>; + label = "case_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; }; pm8937_adc_tm: vadc@3400 { - compatible = "qcom,adc-tm-rev2"; + compatible = "qcom,qpnp-adc-tm"; reg = <0x3400 0x100>; #address-cells = <1>; #size-cells = <0>; - interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>, + interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>, <0x0 0x34 0x3 IRQ_TYPE_EDGE_RISING>, <0x0 0x34 0x4 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "eoc-int-en-set", + interrupt-names = "eoc-int-en-set", "high-thr-en-set", "low-thr-en-set"; - qcom,adc-bit-resolution = <15>; - qcom,adc-vdd-reference = <1800>; - qcom,adc_tm-vadc = <&pm8937_vadc>; #thermal-sensor-cells = <1>; - - chan@36 { + qcom,adc-vdd-reference = <1800>; + io-channels = <&pm8937_vadc VADC_REF_625MV>, + <&pm8937_vadc VADC_REF_1250MV>, + <&pm8937_vadc VADC_VDD_VADC>, + <&pm8937_vadc VADC_GND_REF>; + io-channel-names = "ref_625mv", "ref_1250v", "ref_vdd", + "ref_gnd"; + + pa_therm0 { label = "pa_therm0"; - reg = <0x36>; + reg = <VADC_LR_MUX7_HW_ID>; + io-channels = <&pm8937_vadc VADC_LR_MUX7_HW_ID>; + io-channel-names = "pa_therm0"; qcom,decimation = <0>; qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <2>; + qcom,ratiometric; + qcom,scale-fn-type = <2>; qcom,hw-settle-time = <2>; qcom,fast-avg-setup = <0>; qcom,btm-channel-number = <0x48>; qcom,thermal-node; }; - chan@7 { + vph_pwr { label = "vph_pwr"; - reg = <0x7>; + reg = <VADC_VSYS>; + io-channels = <&pm8937_vadc VADC_VSYS>; + io-channel-names = "vph_pwr"; qcom,decimation = <0>; qcom,pre-div-channel-scaling = <1>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; + qcom,scale-fn-type = <0>; qcom,hw-settle-time = <0>; qcom,fast-avg-setup = <0>; qcom,btm-channel-number = <0x68>; }; }; - }; pm8937_1: qcom,pm8937@1 { @@ -307,7 +321,7 @@ pa-therm1-adc { polling-delay-passive = <0>; polling-delay = <0>; - thermal-sensors = <&pm8937_vadc 0x11>; + thermal-sensors = <&pm8937_adc_tm_iio VADC_P_MUX2_1_1>; thermal-governor = "user_space"; wake-capable-sensor; @@ -323,7 +337,7 @@ xo-therm-adc { polling-delay-passive = <0>; polling-delay = <0>; - thermal-sensors = <&pm8937_vadc 0x32>; + thermal-sensors = <&pm8937_adc_tm_iio VADC_LR_MUX3_XO_THERM>; thermal-governor = "user_space"; wake-capable-sensor; @@ -339,7 +353,8 @@ xo-therm-buf-adc { polling-delay-passive = <0>; polling-delay = <0>; - thermal-sensors = <&pm8937_vadc 0x3c>; + thermal-sensors = <&pm8937_adc_tm_iio + VADC_LR_MUX3_BUF_XO_THERM>; thermal-governor = "user_space"; wake-capable-sensor; @@ -355,7 +370,7 @@ case-therm-adc { polling-delay-passive = <0>; polling-delay = <0>; - thermal-sensors = <&pm8937_vadc 0x13>; + thermal-sensors = <&pm8937_adc_tm_iio VADC_P_MUX4_1_1>; thermal-governor = "user_space"; wake-capable-sensor; @@ -371,7 +386,7 @@ pa-therm0-adc { polling-delay-passive = <0>; polling-delay = <0>; - thermal-sensors = <&pm8937_adc_tm 0x36>; + thermal-sensors = <&pm8937_adc_tm VADC_LR_MUX7_HW_ID>; thermal-governor = "user_space"; wake-capable-sensor; @@ -385,10 +400,10 @@ }; pm8937_tz { - polling-delay-passive = <0>; + polling-delay-passive = <100>; polling-delay = <0>; thermal-governor = "step_wise"; - thermal-sensors = <&pm8937_temp_alarm>; + thermal-sensors = <&pm8937_tz>; wake-capable-sensor; trips { diff --git a/qcom/pm8953.dtsi b/qcom/pm8953.dtsi index 05a07ecf..ba8b0711 100644 --- a/qcom/pm8953.dtsi +++ b/qcom/pm8953.dtsi @@ -1,3 +1,7 @@ +#include <dt-bindings/iio/qcom,spmi-vadc.h> +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/spmi/spmi.h> + &spmi_bus { qcom,pm8953@0 { @@ -41,10 +45,8 @@ compatible = "qcom,spmi-temp-alarm"; reg = <0x2400 0x100>; interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>; - label = "pm8953_tz"; - qcom,channel-num = <8>; - qcom,threshold-set = <0>; - qcom,temp_alarm-vadc = <&pm8953_vadc>; + io-channels = <&pm8953_vadc VADC_DIE_TEMP>; + io-channel-names = "thermal"; #thermal-sensor-cells = <0>; }; @@ -103,178 +105,166 @@ pm8953_vadc: vadc@3100 { compatible = "qcom,spmi-vadc"; reg = <0x3100 0x100>; + interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; #address-cells = <1>; #size-cells = <0>; - interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "eoc-int-en-set"; - qcom,adc-bit-resolution = <15>; - qcom,adc-vdd-reference = <1800>; - qcom,vadc-poll-eoc; - #thermal-sensor-cells = <1>; + #io-channel-cells = <1>; + io-channel-ranges; pinctrl-names = "default"; pinctrl-0 = <&pa_therm1_default &cas_therm_default>; - chan@5 { + /* Channel nodes */ + vcoin { + reg = <VADC_VCOIN>; label = "vcoin"; - reg = <5>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <1>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 3>; }; - chan@7 { + vph_pwr { + reg = <VADC_VSYS>; label = "vph_pwr"; - reg = <7>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <1>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 3>; }; - chan@8 { + die_temp { + reg = <VADC_DIE_TEMP>; label = "die_temp"; - reg = <8>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <3>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; }; - chan@9 { + ref_625mv { + reg = <VADC_REF_625MV>; label = "ref_625mv"; - reg = <9>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; }; - chan@a { + ref_1250v { + reg = <VADC_REF_1250MV>; label = "ref_1250v"; - reg = <0xa>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; }; - chan@c { + ref_buf_625mv { + reg = <VADC_SPARE1>; label = "ref_buf_625mv"; - reg = <0xc>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; + }; + + ref_vdd { + reg = <VADC_VDD_VADC>; + label = "ref_vdd"; + qcom,pre-scaling = <1 1>; }; - chan@36 { + ref_gnd { + reg = <VADC_GND_REF>; + label = "ref_gnd"; + qcom,pre-scaling = <1 1>; + }; + + pa_therm0 { + reg = <VADC_LR_MUX7_HW_ID>; label = "pa_therm0"; - reg = <0x36>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <2>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; - chan@11 { + pa_therm1 { + reg = <VADC_P_MUX2_1_1>; label = "pa_therm1"; - reg = <0x11>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <2>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; - - chan@32 { + xo_therm { + reg = <VADC_LR_MUX3_XO_THERM>; label = "xo_therm"; - reg = <0x32>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <4>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; - chan@3c { + xo_therm_buf { + reg = <VADC_LR_MUX3_BUF_XO_THERM>; label = "xo_therm_buf"; - reg = <0x3c>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <4>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; - qcom,vadc-thermal-node; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; - chan@13 { + case_therm { + reg = <VADC_P_MUX4_1_1>; label = "case_therm"; - reg = <0x13>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <2>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; - qcom,vadc-thermal-node; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + }; + + pm8953_adc_tm_iio: adc_tm_iio { + compatible = "qcom,adc-tm5-iio"; + reg = <0x3500 0x100>; + #thermal-sensor-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; + io-channels = <&pm8953_vadc VADC_LR_MUX3_BUF_XO_THERM>; + + xo_therm_buf { + reg = <VADC_LR_MUX3_BUF_XO_THERM>; + label = "xo_therm_buf"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; }; pm8953_adc_tm: vadc@3400 { - compatible = "qcom,adc-tm-rev2"; + compatible = "qcom,qpnp-adc-tm"; reg = <0x3400 0x100>; #address-cells = <1>; #size-cells = <0>; - interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>, + interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>, <0x0 0x34 0x3 IRQ_TYPE_EDGE_RISING>, <0x0 0x34 0x4 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "eoc-int-en-set", + interrupt-names = "eoc-int-en-set", "high-thr-en-set", "low-thr-en-set"; - qcom,adc-bit-resolution = <15>; - qcom,adc-vdd-reference = <1800>; - qcom,adc_tm-vadc = <&pm8953_vadc>; #thermal-sensor-cells = <1>; - - chan@36 { + qcom,adc-vdd-reference = <1800>; + io-channels = <&pm8953_vadc VADC_REF_625MV>, + <&pm8953_vadc VADC_REF_1250MV>, + <&pm8953_vadc VADC_VDD_VADC>, + <&pm8953_vadc VADC_GND_REF>; + io-channel-names = "ref_625mv", "ref_1250v", "ref_vdd", + "ref_gnd"; + + pa_therm0 { label = "pa_therm0"; - reg = <0x36>; + reg = <VADC_LR_MUX7_HW_ID>; + io-channels = <&pm8953_vadc VADC_LR_MUX7_HW_ID>; + io-channel-names = "pa_therm0"; qcom,pre-div-channel-scaling = <0>; qcom,decimation = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <2>; + qcom,ratiometric; + qcom,scale-fn-type = <2>; qcom,hw-settle-time = <2>; qcom,btm-channel-number = <0x48>; qcom,fast-avg-setup = <0>; qcom,thermal-node; }; - chan@32 { + xo_therm { label = "xo_therm"; - reg = <0x32>; + reg = <VADC_LR_MUX3_XO_THERM>; + io-channels = <&pm8953_vadc + VADC_LR_MUX3_XO_THERM>; + io-channel-names = "xo_therm"; qcom,pre-div-channel-scaling = <0>; qcom,decimation = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <4>; + qcom,ratiometric; + qcom,scale-fn-type = <4>; qcom,hw-settle-time = <2>; qcom,btm-channel-number = <0x68>; qcom,fast-avg-setup = <0>; @@ -329,7 +319,7 @@ xo-therm-adc { polling-delay-passive = <0>; polling-delay = <0>; - thermal-sensors = <&pm8953_adc_tm 0x32>; + thermal-sensors = <&pm8953_adc_tm VADC_LR_MUX3_XO_THERM>; thermal-governor = "user_space"; wake-capable-sensor; @@ -345,7 +335,8 @@ xo-therm-buf-adc { polling-delay-passive = <0>; polling-delay = <0>; - thermal-sensors = <&pm8953_vadc 0x3c>; + thermal-sensors = <&pm8953_adc_tm_iio + VADC_LR_MUX3_BUF_XO_THERM>; thermal-governor = "user_space"; wake-capable-sensor; @@ -358,9 +349,10 @@ }; }; - pm8953_tz { - polling-delay-passive = <0>; + pm8953_temp_alarm: pm8953_tz { + polling-delay-passive = <100>; polling-delay = <0>; + thermal-governor = "step_wise"; thermal-sensors = <&pm8953_tz>; wake-capable-sensor; diff --git a/qcom/qm215-pm8916.dtsi b/qcom/qm215-pm8916.dtsi index 2433e885..13797f13 100644 --- a/qcom/qm215-pm8916.dtsi +++ b/qcom/qm215-pm8916.dtsi @@ -198,165 +198,159 @@ }; &pm8916_vadc { - chan@0 { + #thermal-sensor-cells = <1>; + usb_in { + reg = <VADC_USBIN>; label = "usb_in"; - reg = <0>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <7>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 10>; }; - chan@2 { + ireg_fb { + reg = <VADC_VCHG_SNS>; label = "ireg_fb"; - reg = <2>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <6>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <10 81>; }; - chan@5 { + vcoin { + reg = <VADC_VCOIN>; label = "vcoin"; - reg = <5>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <1>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 3>; }; - chan@6 { + vbat_sns { + reg = <VADC_VBAT_SNS>; label = "vbat_sns"; - reg = <6>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <1>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 3>; }; - chan@7 { + vph_pwr { + reg = <VADC_VSYS>; label = "vph_pwr"; - reg = <7>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <1>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 3>; }; - chan@b { + chg_temp { + reg = <VADC_CHG_TEMP>; label = "chg_temp"; - reg = <0xb>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <3>; - qcom,hw-settle-time = <0>; - qcom,fast-avg-setup = <0>; + qcom,pre-scaling = <1 1>; }; - chan@11 { + skin_therm { + reg = <VADC_P_MUX2_1_1>; label = "skin_therm"; - reg = <0x11>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <2>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; - qcom,vadc-thermal-node; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; - chan@30 { + batt_therm { + reg = <VADC_LR_MUX1_BAT_THERM>; label = "batt_therm"; - reg = <0x30>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; qcom,calibration-type = "ratiometric"; - qcom,scale-function = <26>; - qcom,hw-settle-time = <0xb>; - qcom,fast-avg-setup = <0>; + qcom,ratiometric; + qcom,hw-settle-time = <2000>; + qcom,pre-scaling = <1 1>; }; - chan@31 { + batt_id { + reg = <VADC_LR_MUX2_BAT_ID>; label = "batt_id"; - reg = <0x31>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <0>; - qcom,hw-settle-time = <0xb>; - qcom,fast-avg-setup = <0>; + qcom,ratiometric; + qcom,hw-settle-time = <2000>; + qcom,pre-scaling = <1 1>; }; - chan@36 { + pa_therm0 { + reg = <VADC_LR_MUX7_HW_ID>; label = "pa_therm0"; - reg = <0x36>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <2>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; - qcom,vadc-thermal-node; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; - chan@32 { + xo_therm { + reg = <VADC_LR_MUX3_XO_THERM>; label = "xo_therm"; - reg = <0x32>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <4>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; - qcom,vadc-thermal-node; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; - chan@3c { + xo_therm_buf { + reg = <VADC_LR_MUX3_BUF_XO_THERM>; label = "xo_therm_buf"; - reg = <0x3c>; - qcom,decimation = <0>; - qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <4>; - qcom,hw-settle-time = <2>; - qcom,fast-avg-setup = <0>; - qcom,vadc-thermal-node; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; +}; + +&pm8916_adc_tm_iio { + io-channels = <&pm8916_vadc VADC_LR_MUX3_BUF_XO_THERM>, + <&pm8916_vadc VADC_LR_MUX3_XO_THERM>, + <&pm8916_vadc VADC_LR_MUX7_HW_ID>, + <&pm8916_vadc VADC_P_MUX2_1_1>; + io-channel-names = "xo_therm_buf", "xo_therm", "pa_therm0", + "skin_therm"; + + pa_therm0 { + reg = <VADC_LR_MUX7_HW_ID>; + label = "pa_therm0"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + xo_therm { + reg = <VADC_LR_MUX3_XO_THERM>; + label = "xo_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + xo_therm_buf { + reg = <VADC_LR_MUX3_BUF_XO_THERM>; + label = "xo_therm_buf"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + skin_therm { + reg = <VADC_P_MUX2_1_1>; + label = "skin_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; }; }; &pm8916_adc_tm { - /* Channel Node */ - chan@30 { + /* Channel Nodes */ + batt_therm { + reg = <VADC_LR_MUX1_BAT_THERM>; label = "batt_therm"; - reg = <0x30>; - qcom,decimation = <0>; + io-channels = <&pm8916_vadc VADC_LR_MUX1_BAT_THERM>; + io-channel-names = "batt_therm"; qcom,pre-div-channel-scaling = <0>; - qcom,calibration-type = "ratiometric"; - qcom,scale-function = <8>; + qcom,decimation = <0>; + qcom,ratiometric; qcom,hw-settle-time = <0xb>; + qcom,scale-fn-type = <8>; qcom,fast-avg-setup = <0x2>; qcom,btm-channel-number = <0x48>; }; - chan@6 { + vbat_sns { + reg = <VADC_VBAT_SNS>; label = "vbat_sns"; - reg = <0x6>; - qcom,decimation = <0>; + io-channels = <&pm8916_vadc VADC_VBAT_SNS>; + io-channel-names = "vbat_sns"; qcom,pre-div-channel-scaling = <1>; - qcom,calibration-type = "absolute"; - qcom,scale-function = <0>; + qcom,decimation = <0>; qcom,hw-settle-time = <0xb>; + qcom,scale-fn-type = <0>; qcom,fast-avg-setup = <0x2>; qcom,btm-channel-number = <0x68>; }; @@ -367,7 +361,8 @@ xo-therm-buf-adc { polling-delay-passive = <0>; polling-delay = <5000>; - thermal-sensors = <&pm8916_vadc 0x3c>; + thermal-sensors = <&pm8916_adc_tm_iio + VADC_LR_MUX3_BUF_XO_THERM>; thermal-governor = "user_space"; trips { @@ -382,7 +377,8 @@ xo-therm-adc { polling-delay-passive = <0>; polling-delay = <5000>; - thermal-sensors = <&pm8916_vadc 0x32>; + thermal-sensors = <&pm8916_adc_tm_iio + VADC_LR_MUX3_XO_THERM>; thermal-governor = "user_space"; trips { @@ -397,7 +393,8 @@ pa-therm0-adc { polling-delay-passive = <0>; polling-delay = <5000>; - thermal-sensors = <&pm8916_vadc 0x36>; + thermal-sensors = <&pm8916_adc_tm_iio + VADC_LR_MUX7_HW_ID>; thermal-governor = "user_space"; trips { @@ -412,7 +409,8 @@ skin-therm-adc { polling-delay-passive = <0>; polling-delay = <5000>; - thermal-sensors = <&pm8916_vadc 0x11>; + thermal-sensors = <&pm8916_adc_tm_iio + VADC_P_MUX2_1_1>; thermal-governor = "user_space"; trips { @@ -433,7 +431,7 @@ }; pm8916_tz { - polling-delay-passive = <0>; + polling-delay-passive = <100>; polling-delay = <0>; thermal-governor = "step_wise"; thermal-sensors = <&pm8916_tz>; @@ -462,7 +460,8 @@ xo-therm-step { polling-delay-passive = <1000>; polling-delay = <5000>; - thermal-sensors = <&pm8916_vadc 0x32>; + thermal-sensors = <&pm8916_adc_tm_iio + VADC_LR_MUX3_XO_THERM>; thermal-governor = "step_wise"; trips { diff --git a/qcom/qm215-qrd-smb1360.dtsi b/qcom/qm215-qrd-smb1360.dtsi index 84e9e78b..97568702 100644 --- a/qcom/qm215-qrd-smb1360.dtsi +++ b/qcom/qm215-qrd-smb1360.dtsi @@ -1,4 +1,5 @@ #include "qm215-qrd.dtsi" +#include <dt-bindings/iio/qcom,spmi-vadc.h> &pm8916_chg { qcom,use-external-charger; @@ -71,6 +72,8 @@ qcom,cool-bat-mv = <4200>; qcom,warm-bat-ma = <1000>; qcom,cool-bat-ma = <1000>; + io-channels = <&pm8916_vadc VADC_LR_MUX2_BAT_ID>; + io-channel-names = "batt_id"; status= "okay"; }; }; diff --git a/qcom/sdm439-pm8953.dtsi b/qcom/sdm439-pm8953.dtsi index c3b2649e..27b9179e 100644 --- a/qcom/sdm439-pm8953.dtsi +++ b/qcom/sdm439-pm8953.dtsi @@ -271,7 +271,7 @@ pa-therm0 { polling-delay-passive = <0>; polling-delay = <0>; - thermal-sensors = <&pm8953_adc_tm 0x36>; + thermal-sensors = <&pm8953_adc_tm VADC_LR_MUX7_HW_ID>; thermal-governor = "user_space"; wake-capable-sensor; @@ -287,7 +287,7 @@ &pm8953_vadc { pinctrl-0 = <&pa_therm1_default>; - /delete-node/ chan@13; + /delete-node/ case_therm; }; &pm8953_mpps { |