From b4f9dfcc6da5a220107901188866dd98f7b193c3 Mon Sep 17 00:00:00 2001 From: Jishnu Prakash Date: Fri, 24 Jan 2020 14:46:40 +0530 Subject: [PATCH] ARM: dts: msm: Add ADC support for Lahaina Add VADC and ADC_TM nodes with channels for Lahaina. Change-Id: Ie5be336606d56c5578fb476cd402327428cc5561 --- qcom/lahaina-pmic-overlay.dtsi | 251 +++++++++++++++++++++++++++++++++ qcom/pmk8350.dtsi | 149 ++++++++++++++++++- 2 files changed, 399 insertions(+), 1 deletion(-) diff --git a/qcom/lahaina-pmic-overlay.dtsi b/qcom/lahaina-pmic-overlay.dtsi index 41b3bb4e9f08..17377c8a7443 100644 --- a/qcom/lahaina-pmic-overlay.dtsi +++ b/qcom/lahaina-pmic-overlay.dtsi @@ -248,6 +248,257 @@ }; }; +&pm8350_gpios { + pm8350_rear_tof_therm { + pm8350_rear_tof_therm_default: pm8350_rear_tof_therm_default { + pins = "gpio1"; + bias-high-impedance; + }; + }; +}; + +&pmk8350_vadc { + pinctrl-names = "default"; + pinctrl-0 = <&pm8350_rear_tof_therm_default>; + + pm8350_msm_therm { + reg = ; + label = "pm8350_msm_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + pm8350_cam_flash_therm { + reg = ; + label = "pm8350_cam_flash_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + pm8350_hot_pocket_therm { + reg = ; + label = "pm8350_hot_pocket_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + pm8350_wide_rfc_therm { + reg = ; + label = "pm8350_wide_rfc_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + pm8350_rear_tof_therm { + reg = ; + label = "pm8350_rear_tof_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + pm8350b_usb_conn_therm { + reg = ; + label = "pm8350b_usb_conn_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + pm8350b_wl_chg_therm { + reg = ; + label = "pm8350b_wl_chg_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; +}; + +&pmk8350_adc_tm { + io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM1_100K_PU>, + <&pmk8350_vadc PM8350_ADC7_AMUX_THM2_100K_PU>, + <&pmk8350_vadc PM8350_ADC7_AMUX_THM3_100K_PU>, + <&pmk8350_vadc PM8350_ADC7_AMUX_THM4_100K_PU>, + <&pmk8350_vadc PM8350_ADC7_AMUX_THM5_100K_PU>, + <&pmk8350_vadc PM8350B_ADC7_AMUX_THM4_100K_PU>, + <&pmk8350_vadc PM8350B_ADC7_GPIO2_100K_PU>, + <&pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU>; + + pm8350_msm_therm { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + }; + + pm8350_cam_flash_therm { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + }; + + pm8350_hot_pocket_therm { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + }; + + pm8350_wide_rfc_therm { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + }; + + pm8350_rear_tof_therm { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + }; + + pm8350b_usb_conn_therm { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + }; + + pm8350b_wl_chg_therm { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + }; + + pmk8350_xo_therm { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + }; +}; + +&thermal_zones { + skin-msm-therm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM1_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + camera-therm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM2_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + hot-pock-therm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM3_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + rear-cam-therm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM4_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + tof-therm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM5_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + conn-therm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pmk8350_adc_tm PM8350B_ADC7_AMUX_THM4_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + wlc-therm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pmk8350_adc_tm PM8350B_ADC7_GPIO2_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + xo-therm-usr { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-governor = "user_space"; + thermal-sensors = <&pmk8350_adc_tm PMK8350_ADC7_AMUX_THM1_100K_PU>; + wake-capable-sensor; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; +}; + &restart { nvmem-cells = <&restart_reason>; nvmem-cell-names = "restart_reason"; diff --git a/qcom/pmk8350.dtsi b/qcom/pmk8350.dtsi index 00622806ceee..185d62edbef2 100644 --- a/qcom/pmk8350.dtsi +++ b/qcom/pmk8350.dtsi @@ -2,6 +2,11 @@ #include #include #include +#include +#include +#include +#include +#include &spmi_bus { #address-cells = <2>; @@ -9,7 +14,7 @@ interrupt-controller; #interrupt-cells = <4>; - qcom,pmk8350@0 { + pmk8350: qcom,pmk8350@0 { compatible = "qcom,spmi-pmic"; reg = <0 SPMI_USID>; #address-cells = <1>; @@ -40,6 +45,148 @@ }; }; + pmk8350_vadc: vadc@3100 { + compatible = "qcom,spmi-adc7"; + reg = <0x3100>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "eoc-int-en-set"; + #io-channel-cells = <1>; + io-channel-ranges; + + /* PMK8350 Channel nodes */ + pmk8350_ref_gnd { + reg = ; + label = "pmk8350_ref_gnd"; + qcom,pre-scaling = <1 1>; + }; + + pmk8350_vref_1p25 { + reg = ; + label = "pmk8350_vref_1p25"; + qcom,pre-scaling = <1 1>; + }; + + pmk8350_die_temp { + reg = ; + label = "pmk8350_die_temp"; + qcom,pre-scaling = <1 1>; + }; + + pmk8350_xo_therm { + reg = ; + label = "pmk8350_xo_therm"; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + }; + + /* PM8350 Channel nodes */ + pm8350_ref_gnd { + reg = ; + label = "pm8350_ref_gnd"; + qcom,pre-scaling = <1 1>; + }; + + pm8350_vref_1p25 { + reg = ; + label = "pm8350_vref_1p25"; + qcom,pre-scaling = <1 1>; + }; + + pm8350_die_temp { + reg = ; + label = "pm8350_die_temp"; + qcom,pre-scaling = <1 1>; + }; + + pm8350_vph_pwr { + reg = ; + label = "pm8350_vph_pwr"; + qcom,pre-scaling = <1 3>; + }; + + /* PM8350b Channel nodes */ + pm8350b_ref_gnd { + reg = ; + label = "pm8350b_ref_gnd"; + qcom,pre-scaling = <1 1>; + }; + + pm8350b_vref_1p25 { + reg = ; + label = "pm8350b_vref_1p25"; + qcom,pre-scaling = <1 1>; + }; + + pm8350b_die_temp { + reg = ; + label = "pm8350b_die_temp"; + qcom,pre-scaling = <1 1>; + }; + + pm8350b_vph_pwr { + reg = ; + label = "pm8350b_vph_pwr"; + qcom,pre-scaling = <1 3>; + }; + + pm8350b_vbat_sns { + reg = ; + label = "pm8350b_vbat_sns"; + qcom,pre-scaling = <1 3>; + }; + + /* PMR735a Channel nodes */ + pmr735a_ref_gnd { + reg = ; + label = "pmr735a_ref_gnd"; + qcom,pre-scaling = <1 1>; + }; + + pmr735a_vref_1p25 { + reg = ; + label = "pmr735a_vref_1p25"; + qcom,pre-scaling = <1 1>; + }; + + pmr735a_die_temp { + reg = ; + label = "pmr735a_die_temp"; + qcom,pre-scaling = <1 1>; + }; + + /* PMR735b Channel nodes */ + pmr735b_ref_gnd { + reg = ; + label = "pmr735b_ref_gnd"; + qcom,pre-scaling = <1 1>; + }; + + pmr735b_vref_1p25 { + reg = ; + label = "pmr735b_vref_1p25"; + qcom,pre-scaling = <1 1>; + }; + + pmr735b_die_temp { + reg = ; + label = "pmr735b_die_temp"; + qcom,pre-scaling = <1 1>; + }; + }; + + pmk8350_adc_tm: adc_tm@3400 { + compatible = "qcom,adc-tm7"; + reg = <0x3400>; + interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "threshold"; + #address-cells = <1>; + #size-cells = <0>; + #thermal-sensor-cells = <1>; + }; + pmk8350_sdam_2: sdam@7100 { compatible = "qcom,spmi-sdam"; reg = <0x7100>;