From ae0ac3c589d1ee60a281514c94b18b3b3a5b356a Mon Sep 17 00:00:00 2001 From: Jishnu Prakash Date: Fri, 17 Sep 2021 21:46:12 +0530 Subject: [PATCH] ARM: dts: msm: Add PMIC support for cape Add spmi-pmic-arb devices for the primary and secondary SPMI buses. Add an SPMI debug bus device and associated child devices. Add volume up gpio-keys device for all platforms. Add PMIC Glink devices and their client devices and Glink SPMI debug controller device. Add configurations for haptics, flash, ADC, temp-alarm, battery-charger and PON devices. Change-Id: I7bd12e900ba31d48fdda15f59a6fb768bec94bea --- qcom/cape-cdp.dtsi | 44 ++++- qcom/cape-mtp.dtsi | 50 ++++- qcom/cape-pmic-overlay.dtsi | 382 ++++++++++++++++++++++++++++++++++++ qcom/cape.dtsi | 191 ++++++++++++++++++ 4 files changed, 665 insertions(+), 2 deletions(-) create mode 100644 qcom/cape-pmic-overlay.dtsi diff --git a/qcom/cape-cdp.dtsi b/qcom/cape-cdp.dtsi index b4726b01..cda2ad3b 100644 --- a/qcom/cape-cdp.dtsi +++ b/qcom/cape-cdp.dtsi @@ -1 +1,43 @@ -&soc { }; +#include +#include + +#include "cape-pmic-overlay.dtsi" + +&soc { + gpio_keys { + compatible = "gpio-keys"; + label = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&key_vol_up_default>; + + vol_up { + label = "volume_up"; + gpios = <&pm8350_gpios 6 GPIO_ACTIVE_LOW>; + linux,input-type = <1>; + linux,code = ; + gpio-key,wakeup; + debounce-interval = <15>; + linux,can-disable; + }; + }; +}; + +&pm8350c_switch0 { + qcom,led-mask = <9>; /* Channels 1 & 4 */ + qcom,symmetry-en; +}; + +&pm8350c_switch1 { + qcom,led-mask = <6>; /* Channels 2 & 3 */ + qcom,symmetry-en; +}; + +&pm8350c_switch2 { + qcom,led-mask = <15>; /* All Channels */ + qcom,symmetry-en; +}; + +&pm8350c_flash { + status = "ok"; +}; diff --git a/qcom/cape-mtp.dtsi b/qcom/cape-mtp.dtsi index b4726b01..c47f1ed2 100644 --- a/qcom/cape-mtp.dtsi +++ b/qcom/cape-mtp.dtsi @@ -1 +1,49 @@ -&soc { }; +#include +#include + +#include "cape-pmic-overlay.dtsi" + +&soc { + gpio_keys { + compatible = "gpio-keys"; + label = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&key_vol_up_default>; + + vol_up { + label = "volume_up"; + gpios = <&pm8350_gpios 6 GPIO_ACTIVE_LOW>; + linux,input-type = <1>; + linux,code = ; + gpio-key,wakeup; + debounce-interval = <15>; + linux,can-disable; + }; + }; +}; + +&pm8350c_switch0 { + qcom,led-mask = <9>; /* Channels 1 & 4 */ + qcom,symmetry-en; +}; + +&pm8350c_switch1 { + qcom,led-mask = <6>; /* Channels 2 & 3 */ + qcom,symmetry-en; +}; + +&pm8350c_switch2 { + qcom,led-mask = <15>; /* All Channels */ + qcom,symmetry-en; +}; + +&pm8350c_flash { + status = "ok"; +}; + +&battery_charger { + qcom,thermal-mitigation = <3000000 1500000 1000000 500000>; + qcom,wireless-fw-name = "idt9415.bin"; + qcom,shutdown-voltage = <3100>; +}; diff --git a/qcom/cape-pmic-overlay.dtsi b/qcom/cape-pmic-overlay.dtsi new file mode 100644 index 00000000..c4cf9ae2 --- /dev/null +++ b/qcom/cape-pmic-overlay.dtsi @@ -0,0 +1,382 @@ +#include +#include + +#include "pmk8350.dtsi" +#include "pm8350.dtsi" +#include "pm8350c.dtsi" +#include "pm8350b.dtsi" +#include "pmr735a.dtsi" +#include "pmr735b.dtsi" +#include "pm8450.dtsi" + +&pmk8350 { + /delete-node/ pon_pbs@800; + /delete-node/ pon_hlos@1300; + + pon_hlos@1300 { + compatible = "qcom,pm8998-pon"; + reg = <0x1300>, <0x800>; + reg-names = "pon_hlos", "pon_pbs"; + + pwrkey { + compatible = "qcom,pmk8350-pwrkey"; + interrupts = <0x0 0x13 0x7 IRQ_TYPE_EDGE_BOTH>; + linux,code = ; + }; + + resin { + compatible = "qcom,pmk8350-resin"; + interrupts = <0x0 0x13 0x6 IRQ_TYPE_EDGE_BOTH>; + linux,code = ; + }; + }; +}; + +&pm8350_gpios { + pm8350_rear_tof_therm { + pm8350_rear_tof_therm_default: pm8350_rear_tof_therm_default { + pins = "gpio1"; + bias-high-impedance; + }; + }; + + key_vol_up { + key_vol_up_default: key_vol_up_default { + pins = "gpio6"; + function = "normal"; + input-enable; + bias-pull-up; + power-source = <1>; + }; + }; +}; + +&pmk8350_sdam_2 { + hap_cl_brake: cl_brake@7c { + reg = <0x7c 0x1>; + bits = <0 8>; + }; +}; + +&pm8350b_haptics { + status = "ok"; + nvmem-cell-names = "hap_cl_brake"; + nvmem-cells = <&hap_cl_brake>; + nvmem-names = "hap_cfg_sdam"; + nvmem = <&pmk8350_sdam_46>; + qcom,pbs-client = <&pm8350b_pbs2>; +}; + +&soc { + pmic-pon-log { + compatible = "qcom,pmic-pon-log"; + nvmem = <&pmk8350_sdam_5>; + nvmem-names = "pon_log"; + }; +}; + +&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>; + }; + + pm8350b_chg_temp { + reg = ; + label = "pm8350b_chg_temp"; + qcom,pre-scaling = <1 1>; + }; + + pm8350b_iin_fb { + reg = ; + label = "pm8350b_iin_fb"; + qcom,pre-scaling = <32 100>; + }; + + pm8350b_ichg_fb { + reg = ; + label = "pm8350b_ichg_fb"; + qcom,pre-scaling = <1000 305185>; + }; + + pm8350b_usb_in_v_div_16 { + reg = ; + label = "pm8350b_usb_in_v_div_16"; + qcom,pre-scaling = <1 16>; + }; + + smb139x_1_smb_temp { + reg = ; + label = "smb139x_1_smb_temp"; + qcom,hw-settle-time = <200>; + }; + + smb139x_1_ichg_smb { + reg = ; + label = "smb139x_1_ichg_smb"; + qcom,hw-settle-time = <200>; + }; + + smb139x_1_iin_smb { + reg = ; + label = "smb139x_1_iin_smb"; + qcom,hw-settle-time = <200>; + }; + + smb139x_2_smb_temp { + reg = ; + label = "smb139x_2_smb_temp"; + qcom,hw-settle-time = <200>; + }; + + smb139x_2_ichg_smb { + reg = ; + label = "smb139x_2_ichg_smb"; + qcom,hw-settle-time = <200>; + }; + + smb139x_2_iin_smb { + reg = ; + label = "smb139x_2_iin_smb"; + qcom,hw-settle-time = <200>; + }; +}; + +&pm8350_tz { + io-channels = <&pmk8350_vadc PM8350_ADC7_DIE_TEMP>; + io-channel-names = "thermal"; +}; + +&pm8350b_tz { + io-channels = <&pmk8350_vadc PM8350B_ADC7_DIE_TEMP>; + io-channel-names = "thermal"; +}; + +&pmr735a_tz { + io-channels = <&pmk8350_vadc PMR735A_ADC7_DIE_TEMP>; + io-channel-names = "thermal"; +}; + +&pmr735b_tz { + io-channels = <&pmk8350_vadc PMR735B_ADC7_DIE_TEMP>; + io-channel-names = "thermal"; +}; + +&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 { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM1_100K_PU>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + camera-therm { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM2_100K_PU>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + hot-pock-therm { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM3_100K_PU>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + rear-cam-therm { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM4_100K_PU>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + tof-therm { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM5_100K_PU>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + conn-therm { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pmk8350_adc_tm PM8350B_ADC7_AMUX_THM4_100K_PU>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + wlc-therm { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pmk8350_adc_tm PM8350B_ADC7_GPIO2_100K_PU>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + xo-therm { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pmk8350_adc_tm PMK8350_ADC7_AMUX_THM1_100K_PU>; + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; +}; diff --git a/qcom/cape.dtsi b/qcom/cape.dtsi index df38d414..3ce874ab 100644 --- a/qcom/cape.dtsi +++ b/qcom/cape.dtsi @@ -1,5 +1,6 @@ #include #include +#include / { model = "Qualcomm Technologies, Inc. Cape"; compatible = "qcom,cape"; @@ -473,6 +474,196 @@ interrupt-controller; }; + thermal_zones: thermal-zones { + }; + + spmi_bus: spmi0_bus: qcom,spmi@c42d000 { + compatible = "qcom,spmi-pmic-arb"; + reg = <0xc42d000 0x4000>, + <0xc400000 0x3000>, + <0xc500000 0x400000>, + <0xc440000 0x80000>, + <0xc4c0000 0x10000>; + reg-names = "cnfg", "core", "chnls", "obsrvr", "intr"; + interrupts-extended = <&pdc 1 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "periph_irq"; + interrupt-controller; + #interrupt-cells = <4>; + #address-cells = <2>; + #size-cells = <0>; + cell-index = <0>; + qcom,channel = <0>; + qcom,ee = <0>; + qcom,bus-id = <0>; + }; + + spmi1_bus: qcom,spmi@c432000 { + compatible = "qcom,spmi-pmic-arb"; + reg = <0xc432000 0x4000>, + <0xc400000 0x3000>, + <0xc500000 0x400000>, + <0xc440000 0x80000>, + <0xc4d0000 0x10000>; + reg-names = "cnfg", "core", "chnls", "obsrvr", "intr"; + interrupts-extended = <&pdc 3 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "periph_irq"; + interrupt-controller; + #interrupt-cells = <4>; + #address-cells = <2>; + #size-cells = <0>; + cell-index = <0>; + qcom,channel = <0>; + qcom,ee = <0>; + qcom,bus-id = <1>; + depends-on-supply = <&spmi0_bus>; + }; + + spmi0_debug_bus: qcom,spmi-debug@10b14000 { + compatible = "qcom,spmi-pmic-arb-debug"; + reg = <0x10b14000 0x60>, <0x221c8784 0x4>; + reg-names = "core", "fuse"; + clock-names = "core_clk"; + qcom,fuse-enable-bit = <18>; + #address-cells = <2>; + #size-cells = <0>; + depends-on-supply = <&spmi1_bus>; + depends-on2-supply = <&smb1394_glink_debug>; + + qcom,pmk8350-debug@0 { + compatible = "qcom,spmi-pmic"; + reg = <0 SPMI_USID>; + #address-cells = <2>; + #size-cells = <0>; + qcom,can-sleep; + }; + + qcom,pm8350-debug@1 { + compatible = "qcom,spmi-pmic"; + reg = <1 SPMI_USID>; + #address-cells = <2>; + #size-cells = <0>; + qcom,can-sleep; + }; + + qcom,pm8350c-debug@2 { + compatible = "qcom,spmi-pmic"; + reg = <2 SPMI_USID>; + #address-cells = <2>; + #size-cells = <0>; + qcom,can-sleep; + }; + + qcom,pm8350b-debug@3 { + compatible = "qcom,spmi-pmic"; + reg = <3 SPMI_USID>; + #address-cells = <2>; + #size-cells = <0>; + qcom,can-sleep; + }; + + qcom,pmr735a-debug@4 { + compatible = "qcom,spmi-pmic"; + reg = <4 SPMI_USID>; + #address-cells = <2>; + #size-cells = <0>; + qcom,can-sleep; + }; + + qcom,pmr735b-debug@5 { + compatible = "qcom,spmi-pmic"; + reg = <5 SPMI_USID>; + #address-cells = <2>; + #size-cells = <0>; + qcom,can-sleep; + }; + + qcom,pm8450-debug@7 { + compatible = "qcom,spmi-pmic"; + reg = <7 SPMI_USID>; + #address-cells = <2>; + #size-cells = <0>; + qcom,can-sleep; + }; + }; + + qcom,pmic_glink { + compatible = "qcom,pmic-glink"; + qcom,pmic-glink-channel = "PMIC_RTR_ADSP_APPS"; + qcom,subsys-name = "lpass"; + qcom,protection-domain = "tms/servreg", "msm/adsp/charger_pd"; + depends-on-supply = <&ipcc_mproc>; + + battery_charger: qcom,battery_charger { + compatible = "qcom,battery-charger"; + }; + + ucsi: qcom,ucsi { + compatible = "qcom,ucsi-glink"; + }; + + altmode: qcom,altmode { + compatible = "qcom,altmode-glink"; + #altmode-cells = <1>; + }; + }; + + qcom,pmic_glink_log { + compatible = "qcom,pmic-glink"; + qcom,pmic-glink-channel = "PMIC_LOGS_ADSP_APPS"; + + qcom,battery_debug { + compatible = "qcom,battery-debug"; + }; + + qcom,charger_ulog_glink { + compatible = "qcom,charger-ulog-glink"; + }; + + qcom,spmi_glink_debug { + compatible = "qcom,spmi-glink-debug"; + #address-cells = <1>; + #size-cells = <0>; + depends-on-supply = <&spmi1_bus>; + + /* Primary SPMI bus */ + spmi@0 { + reg = <0>; + #address-cells = <2>; + #size-cells = <0>; + + qcom,pm8350b-debug@3 { + compatible = "qcom,spmi-pmic"; + reg = <3 SPMI_USID>; + qcom,can-sleep; + }; + }; + + /* Secondary SPMI bus */ + spmi@1 { + reg = <1>; + #address-cells = <2>; + #size-cells = <0>; + smb1394_glink_debug: qcom,smb1394-debug@9 { + compatible = "qcom,spmi-pmic"; + reg = <9 SPMI_USID>; + qcom,can-sleep; + }; + + qcom,smb1394-debug@b { + compatible = "qcom,spmi-pmic"; + reg = <11 SPMI_USID>; + qcom,can-sleep; + }; + + qcom,smb1396-debug@d { + compatible = "qcom,spmi-pmic"; + reg = <13 SPMI_USID>; + qcom,can-sleep; + }; + }; + }; + }; + soc-sleep-stats@c3f0000 { compatible = "qcom,rpmh-sleep-stats"; reg = <0xc3f0000 0x400>;