/* * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include #include #include #include #include &spmi_bus { qcom,pm6150@0 { compatible = "qcom,spmi-pmic"; reg = <0x0 SPMI_USID>; #address-cells = <1>; #size-cells = <1>; pm6150_revid: qcom,revid@100 { compatible = "qcom,qpnp-revid"; reg = <0x100 0x100>; }; qcom,power-on@800 { compatible = "qcom,qpnp-power-on"; reg = <0x800 0x100>; interrupts = <0x0 0x8 0x0 IRQ_TYPE_NONE>, <0x0 0x8 0x1 IRQ_TYPE_NONE>; interrupt-names = "kpdpwr", "resin"; qcom,pon-dbc-delay = <15625>; qcom,kpdpwr-sw-debounce; qcom,system-reset; qcom,store-hard-reset-reason; qcom,pon_1 { qcom,pon-type = ; qcom,pull-up; linux,code = ; }; qcom,pon_2 { qcom,pon-type = ; qcom,pull-up; linux,code = ; }; }; pm6150_vadc: vadc@3100 { compatible = "qcom,spmi-adc5"; reg = <0x3100 0x100>, <0x3700 0x100>; reg-names = "adc5-usr-base", "adc5-cal-base"; #address-cells = <1>; #size-cells = <0>; interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; interrupt-names = "eoc-int-en-set"; qcom,adc-vdd-reference = <1875>; #io-channel-cells = <1>; io-channel-ranges; qcom,pmic-revid = <&pm6150_revid>; /* Channel nodes */ ref_gnd { reg = ; label = "ref_gnd"; qcom,pre-scaling = <1 1>; }; vref_1p25 { reg = ; label = "vref_1p25"; qcom,pre-scaling = <1 1>; }; die_temp { reg = ; label = "die_temp"; qcom,pre-scaling = <1 1>; }; vph_pwr { reg = ; label = "vph_pwr"; qcom,pre-scaling = <1 3>; }; vbat_sns { reg = ; label = "vbat_sns"; qcom,pre-scaling = <1 3>; }; vcoin { reg = ; label = "vcoin"; qcom,pre-scaling = <1 3>; }; usb_in_i_uv { reg = ; label = "usb_in_i_uv"; qcom,pre-scaling = <1 1>; }; usb_in_v_div_16 { reg = ; label = "usb_in_v_div_16"; qcom,pre-scaling = <1 16>; }; chg_temp { reg = ; label = "chg_temp"; qcom,pre-scaling = <1 1>; }; bat_therm { reg = ; label = "bat_therm"; qcom,ratiometric; qcom,hw-settle-time = <200>; qcom,pre-scaling = <1 1>; }; bat_therm_30k { reg = ; label = "bat_therm_30k"; qcom,ratiometric; qcom,hw-settle-time = <200>; qcom,pre-scaling = <1 1>; }; bat_therm_400k { reg = ; label = "bat_therm_400k"; qcom,ratiometric; qcom,hw-settle-time = <200>; qcom,pre-scaling = <1 1>; }; bat_id { reg = ; label = "bat_id"; qcom,ratiometric; qcom,hw-settle-time = <200>; qcom,pre-scaling = <1 1>; }; xo_therm { reg = ; label = "xo_therm"; qcom,ratiometric; qcom,hw-settle-time = <200>; qcom,pre-scaling = <1 1>; }; chg_sbux { reg = ; label = "chg_sbux"; qcom,pre-scaling = <1 3>; }; mid_chg_div6 { reg = ; label = "chg_mid"; qcom,pre-scaling = <1 6>; }; v_i_int_ext { reg = ; label = "v_i_int_vbat_vdata"; qcom,pre-scaling = <1 1>; }; v_i_parallel { reg = ; label = "v_i_parallel_vbat_vdata"; qcom,pre-scaling = <1 1>; }; }; pm6150_adc_tm: adc_tm@3500 { compatible = "qcom,adc-tm5"; reg = <0x3500 0x100>; interrupts = <0x0 0x35 0x0 IRQ_TYPE_EDGE_RISING>; interrupt-names = "thr-int-en"; #address-cells = <1>; #size-cells = <0>; #thermal-sensor-cells = <1>; }; pm6150_misc: qcom,misc@900 { compatible = "qcom,qpnp-misc"; reg = <0x900 0x100>; }; pm6150_charger: qcom,qpnp-smb5 { compatible = "qcom,qpnp-smb5"; #address-cells = <1>; #size-cells = <1>; #cooling-cells = <2>; qcom,pmic-revid = <&pm6150_revid>; qcom,chgr@1000 { reg = <0x1000 0x100>; interrupts = <0x0 0x10 0x0 IRQ_TYPE_EDGE_RISING>, <0x0 0x10 0x1 IRQ_TYPE_EDGE_RISING>, <0x0 0x10 0x2 IRQ_TYPE_EDGE_RISING>, <0x0 0x10 0x3 IRQ_TYPE_EDGE_RISING>, <0x0 0x10 0x4 IRQ_TYPE_EDGE_RISING>, <0x0 0x10 0x5 IRQ_TYPE_EDGE_RISING>, <0x0 0x10 0x6 IRQ_TYPE_EDGE_RISING>, <0x0 0x10 0x7 IRQ_TYPE_EDGE_RISING>; interrupt-names = "chgr-error", "chg-state-change", "step-chg-state-change", "step-chg-soc-update-fail", "step-chg-soc-update-req", "fg-fvcal-qualified", "vph-alarm", "vph-drop-prechg"; }; qcom,dcdc@1100 { reg = <0x1100 0x100>; interrupts = <0x0 0x11 0x0 IRQ_TYPE_EDGE_RISING>, <0x0 0x11 0x1 IRQ_TYPE_EDGE_RISING>, <0x0 0x11 0x2 IRQ_TYPE_EDGE_RISING>, <0x0 0x11 0x3 IRQ_TYPE_EDGE_BOTH>, <0x0 0x11 0x4 IRQ_TYPE_EDGE_BOTH>, <0x0 0x11 0x5 IRQ_TYPE_EDGE_BOTH>, <0x0 0x11 0x6 IRQ_TYPE_EDGE_RISING>, <0x0 0x11 0x7 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "otg-fail", "otg-oc-disable-sw", "otg-oc-hiccup", "bsm-active", "high-duty-cycle", "input-current-limiting", "concurrent-mode-disable", "switcher-power-ok"; }; qcom,batif@1200 { reg = <0x1200 0x100>; interrupts = <0x0 0x12 0x0 IRQ_TYPE_EDGE_RISING>, <0x0 0x12 0x2 IRQ_TYPE_EDGE_BOTH>, <0x0 0x12 0x3 IRQ_TYPE_EDGE_BOTH>, <0x0 0x12 0x4 IRQ_TYPE_EDGE_BOTH>, <0x0 0x12 0x5 IRQ_TYPE_EDGE_BOTH>, <0x0 0x12 0x6 IRQ_TYPE_EDGE_BOTH>, <0x0 0x12 0x7 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "bat-temp", "bat-ov", "bat-low", "bat-therm-or-id-missing", "bat-terminal-missing", "buck-oc", "vph-ov"; }; qcom,usb@1300 { reg = <0x1300 0x100>; interrupts = <0x0 0x13 0x0 IRQ_TYPE_EDGE_BOTH>, <0x0 0x13 0x1 IRQ_TYPE_EDGE_BOTH>, <0x0 0x13 0x2 IRQ_TYPE_EDGE_BOTH>, <0x0 0x13 0x3 IRQ_TYPE_EDGE_BOTH>, <0x0 0x13 0x4 IRQ_TYPE_EDGE_BOTH>, <0x0 0x13 0x5 IRQ_TYPE_EDGE_RISING>, <0x0 0x13 0x6 IRQ_TYPE_EDGE_RISING>, <0x0 0x13 0x7 IRQ_TYPE_EDGE_RISING>; interrupt-names = "usbin-collapse", "usbin-vashdn", "usbin-uv", "usbin-ov", "usbin-plugin", "usbin-revi-change", "usbin-src-change", "usbin-icl-change"; }; qcom,dc@1400 { reg = <0x1400 0x100>; interrupts = <0x0 0x14 0x1 IRQ_TYPE_EDGE_BOTH>, <0x0 0x14 0x2 IRQ_TYPE_EDGE_BOTH>, <0x0 0x14 0x3 IRQ_TYPE_EDGE_BOTH>, <0x0 0x14 0x4 IRQ_TYPE_EDGE_BOTH>, <0x0 0x14 0x5 IRQ_TYPE_EDGE_RISING>, <0x0 0x14 0x6 IRQ_TYPE_EDGE_RISING>, <0x0 0x14 0x7 IRQ_TYPE_EDGE_RISING>; interrupt-names = "dcin-vashdn", "dcin-uv", "dcin-ov", "dcin-plugin", "dcin-revi", "dcin-pon", "dcin-en"; }; qcom,typec@1500 { reg = <0x1500 0x100>; interrupts = <0x0 0x15 0x0 IRQ_TYPE_EDGE_RISING>, <0x0 0x15 0x1 IRQ_TYPE_EDGE_RISING>, <0x0 0x15 0x2 IRQ_TYPE_EDGE_RISING>, <0x0 0x15 0x3 IRQ_TYPE_EDGE_RISING>, <0x0 0x15 0x4 IRQ_TYPE_EDGE_RISING>, <0x0 0x15 0x5 IRQ_TYPE_EDGE_RISING>, <0x0 0x15 0x6 IRQ_TYPE_EDGE_RISING>, <0x0 0x15 0x7 IRQ_TYPE_EDGE_RISING>; interrupt-names = "typec-or-rid-detect-change", "typec-vpd-detect", "typec-cc-state-change", "typec-vconn-oc", "typec-vbus-change", "typec-attach-detach", "typec-legacy-cable-detect", "typec-try-snk-src-detect"; }; qcom,misc@1600 { reg = <0x1600 0x100>; interrupts = <0x0 0x16 0x0 IRQ_TYPE_EDGE_RISING>, <0x0 0x16 0x1 IRQ_TYPE_EDGE_RISING>, <0x0 0x16 0x2 IRQ_TYPE_EDGE_RISING>, <0x0 0x16 0x3 IRQ_TYPE_EDGE_RISING>, <0x0 0x16 0x4 IRQ_TYPE_EDGE_BOTH>, <0x0 0x16 0x5 IRQ_TYPE_EDGE_RISING>, <0x0 0x16 0x6 IRQ_TYPE_EDGE_RISING>, <0x0 0x16 0x7 IRQ_TYPE_EDGE_RISING>; interrupt-names = "wdog-snarl", "wdog-bark", "aicl-fail", "aicl-done", "smb-en", "imp-trigger", "temp-change", "temp-change-smb"; }; qcom,sdam@b100 { reg = <0xb100 0x100>; interrupts = <0x0 0xb1 0x1 IRQ_TYPE_EDGE_RISING>; interrupt-names = "sdam-sts"; }; smb5_vbus: qcom,smb5-vbus { regulator-name = "smb5-vbus"; }; smb5_vconn: qcom,smb5-vconn { regulator-name = "smb5-vconn"; }; }; pm6150_pdphy: qcom,usb-pdphy@1700 { compatible = "qcom,qpnp-pdphy"; reg = <0x1700 0x100>; vdd-pdphy-supply = <&pm6150_l17>; vbus-supply = <&smb5_vbus>; vconn-supply = <&smb5_vconn>; interrupts = <0x0 0x17 0x0 IRQ_TYPE_EDGE_RISING>, <0x0 0x17 0x1 IRQ_TYPE_EDGE_RISING>, <0x0 0x17 0x2 IRQ_TYPE_EDGE_RISING>, <0x0 0x17 0x3 IRQ_TYPE_EDGE_RISING>, <0x0 0x17 0x4 IRQ_TYPE_EDGE_RISING>, <0x0 0x17 0x5 IRQ_TYPE_EDGE_RISING>, <0x0 0x17 0x6 IRQ_TYPE_EDGE_RISING>, <0x0 0x17 0x7 IRQ_TYPE_EDGE_RISING>; interrupt-names = "sig-tx", "sig-rx", "msg-tx", "msg-rx", "msg-tx-failed", "msg-tx-discarded", "msg-rx-discarded", "fr-swap"; qcom,default-sink-caps = <5000 3000>, /* 5V @ 3A */ <9000 3000>, /* 9V @ 3A */ <12000 2250>; /* 12V @ 2.25A */ }; pm6150_qg: qpnp,qg { compatible = "qcom,qpnp-qg"; #address-cells = <1>; #size-cells = <1>; qcom,vbatt-cutoff-mv = <3200>; qcom,vbatt-low-mv = <3300>; qcom,vbatt-low-cold-mv = <3700>; qcom,vbatt-empty-mv = <3000>; qcom,vbatt-empty-cold-mv = <3000>; qcom,s3-entry-fifo-length = <2>; qcom,s3-entry-ibat-ua = <15000>; qcom,s3-exit-ibat-ua = <35000>; qcom,pmic-revid = <&pm6150_revid>; io-channels = <&pm6150_vadc ADC_BAT_THERM_PU2>, <&pm6150_vadc ADC_BAT_ID_PU2>; io-channel-names = "batt-therm", "batt-id"; qcom,qgauge@4800 { status = "okay"; reg = <0x4800 0x100>; interrupts = <0x0 0x48 0x0 IRQ_TYPE_EDGE_BOTH>, <0x0 0x48 0x1 IRQ_TYPE_EDGE_BOTH>, <0x0 0x48 0x2 IRQ_TYPE_EDGE_RISING>, <0x0 0x48 0x3 IRQ_TYPE_EDGE_RISING>, <0x0 0x48 0x4 IRQ_TYPE_EDGE_RISING>; interrupt-names = "qg-batt-missing", "qg-vbat-low", "qg-vbat-empty", "qg-fifo-done", "qg-good-ocv"; }; qcom,qg-sdam@b600 { status = "okay"; reg = <0xb600 0x100>; }; }; pm6150_bcl: bcl@1d00 { compatible = "qcom,bcl-v5"; reg = <0x1d00 0x100>; interrupts = <0x0 0x1d 0x0 IRQ_TYPE_NONE>, <0x0 0x1d 0x1 IRQ_TYPE_NONE>, <0x0 0x1d 0x2 IRQ_TYPE_NONE>; interrupt-names = "bcl-lvl0", "bcl-lvl1", "bcl-lvl2"; #thermal-sensor-cells = <1>; }; bcl_soc:bcl-soc { compatible = "qcom,msm-bcl-soc"; #thermal-sensor-cells = <0>; }; pm6150_tz: qcom,temp-alarm@2400 { compatible = "qcom,spmi-temp-alarm"; reg = <0x2400 0x100>; interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>; #thermal-sensor-cells = <0>; qcom,temperature-threshold-set = <1>; }; pm6150_clkdiv: clock-controller@5b00 { compatible = "qcom,spmi-clkdiv"; reg = <0x5b00 0x100>; #clock-cells = <1>; qcom,num-clkdivs = <1>; clock-output-names = "pm6150_div_clk1"; clocks = <&clock_rpmh RPMH_CXO_CLK>; clock-names = "xo"; assigned-clocks = <&pm6150_clkdiv 1>; assigned-clock-rates = <19200000>; }; pm6150_gpios: pinctrl@c000 { compatible = "qcom,spmi-gpio"; reg = <0xc000 0xa00>; interrupts = <0x0 0xc0 0 IRQ_TYPE_NONE>, <0x0 0xc1 0 IRQ_TYPE_NONE>, <0x0 0xc2 0 IRQ_TYPE_NONE>, <0x0 0xc3 0 IRQ_TYPE_NONE>, <0x0 0xc6 0 IRQ_TYPE_NONE>, <0x0 0xc7 0 IRQ_TYPE_NONE>; interrupt-names = "pm6150_gpio1", "pm6150_gpio2", "pm6150_gpio3", "pm6150_gpio4", "pm6150_gpio7", "pm6150_gpio8"; gpio-controller; #gpio-cells = <2>; qcom,gpios-disallowed = <5 6 9 10>; afc_switch { gpio1_afc_switch_default: gpio1_afc_switch_default { pins = "gpio1"; /* GPIO 1 */ function = "normal"; /* normal output */ power-source = <0>; /* VIN0 */ output-low; /* digital output, no invert */ input-disable; /* prevent GPIO from being set to DIO */ }; }; }; pm6150_rtc: qcom,pm6150_rtc { compatible = "qcom,qpnp-rtc"; #address-cells = <1>; #size-cells = <1>; qcom,qpnp-rtc-write = <0>; qcom,qpnp-rtc-alarm-pwrup = <0>; qcom,pm6150_rtc_rw@6000 { reg = <0x6000 0x100>; }; qcom,pm6150_rtc_alarm@6100 { reg = <0x6100 0x100>; interrupts = <0x0 0x61 0x1 IRQ_TYPE_NONE>; }; }; }; qcom,pm6150@1 { compatible ="qcom,spmi-pmic"; reg = <0x1 SPMI_USID>; #address-cells = <1>; #size-cells = <1>; pm6150_vib: qcom,vibrator@5300 { compatible = "qcom,qpnp-vibrator-ldo"; reg = <0x5300 0x100>; qcom,vib-ldo-volt-uv = <3300000>; qcom,disable-overdrive; }; }; }; &thermal_zones { pm6150_temp_alarm: pm6150-tz { polling-delay-passive = <0>; polling-delay = <0>; thermal-governor = "step_wise"; thermal-sensors = <&pm6150_tz>; wake-capable-sensor; trips { pm6150_trip0: trip0 { temperature = <95000>; hysteresis = <0>; type = "passive"; }; pm6150_trip1: trip1 { temperature = <115000>; hysteresis = <0>; type = "passive"; }; trip2 { temperature = <145000>; hysteresis = <0>; type = "passive"; }; }; }; pm6150-ibat-lvl0 { polling-delay-passive = <0>; polling-delay = <0>; thermal-governor = "step_wise"; thermal-sensors = <&pm6150_bcl 0>; wake-capable-sensor; trips { ibat_lvl0:ibat-lvl0 { temperature = <5500>; hysteresis = <200>; type = "passive"; }; }; }; pm6150-ibat-lvl1 { polling-delay-passive = <0>; polling-delay = <0>; thermal-governor = "step_wise"; thermal-sensors = <&pm6150_bcl 1>; wake-capable-sensor; trips { ibat_lvl1:ibat-lvl1 { temperature = <6000>; hysteresis = <200>; type = "passive"; }; }; }; pm6150-vbat-lvl0 { polling-delay-passive = <0>; polling-delay = <0>; thermal-governor = "low_limits_cap"; thermal-sensors = <&pm6150_bcl 2>; wake-capable-sensor; tracks-low; trips { vbat_lvl0: vbat-lvl0 { temperature = <3000>; hysteresis = <200>; type = "passive"; }; }; }; pm6150-vbat-lvl1 { polling-delay-passive = <0>; polling-delay = <0>; thermal-governor = "low_limits_cap"; thermal-sensors = <&pm6150_bcl 3>; wake-capable-sensor; tracks-low; trips { vbat_lvl1:vbat-lvl1 { temperature = <2800>; hysteresis = <200>; type = "passive"; }; }; }; pm6150-vbat-lvl2 { polling-delay-passive = <0>; polling-delay = <0>; thermal-governor = "low_limits_cap"; thermal-sensors = <&pm6150_bcl 4>; wake-capable-sensor; tracks-low; trips { vbat_lvl2:vbat-lvl2 { temperature = <2600>; hysteresis = <200>; type = "passive"; }; }; }; pm6150-bcl-lvl0 { disable-thermal-zone; polling-delay-passive = <100>; polling-delay = <0>; thermal-governor = "step_wise"; thermal-sensors = <&pm6150_bcl 5>; wake-capable-sensor; trips { bcl_lvl0: bcl-lvl0 { temperature = <1>; hysteresis = <1>; type = "passive"; }; }; }; pm6150-bcl-lvl1 { disable-thermal-zone; polling-delay-passive = <100>; polling-delay = <0>; thermal-governor = "step_wise"; thermal-sensors = <&pm6150_bcl 6>; wake-capable-sensor; trips { bcl_lvl1: bcl-lvl1 { temperature = <1>; hysteresis = <1>; type = "passive"; }; }; }; pm6150-bcl-lvl2 { disable-thermal-zone; polling-delay-passive = <100>; polling-delay = <0>; thermal-governor = "step_wise"; thermal-sensors = <&pm6150_bcl 7>; wake-capable-sensor; trips { bcl_lvl2: bcl-lvl2 { temperature = <1>; hysteresis = <1>; type = "passive"; }; }; }; soc { polling-delay-passive = <100>; polling-delay = <0>; thermal-governor = "low_limits_cap"; thermal-sensors = <&bcl_soc>; wake-capable-sensor; tracks-low; trips { soc_trip:soc-trip { temperature = <10>; hysteresis = <0>; type = "passive"; }; }; }; };