blob: 772471455e75f40690a1758e853e5ec101fdf3b6 [file] [log] [blame]
/* Copyright (c) 2016-2018, 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 <dt-bindings/spmi/spmi.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/thermal/thermal.h>
&spmi_bus {
pm660_0: qcom,pm660@0 {
compatible ="qcom,spmi-pmic";
reg = <0x0 SPMI_USID>;
#address-cells = <2>;
#size-cells = <0>;
pm660_revid: qcom,revid@100 {
compatible = "qcom,qpnp-revid";
reg = <0x100 0x100>;
qcom,fab-id-valid;
};
pm660_misc: qcom,misc@900 {
compatible = "qcom,qpnp-misc";
reg = <0x900 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>,
<0x0 0x8 0x4 IRQ_TYPE_NONE>,
<0x0 0x8 0x5 IRQ_TYPE_NONE>;
interrupt-names = "kpdpwr", "resin",
"resin-bark", "kpdpwr-resin-bark";
qcom,pon-dbc-delay = <15625>;
qcom,kpdpwr-sw-debounce;
qcom,system-reset;
qcom,store-hard-reset-reason;
qcom,pon_1 {
qcom,pon-type = <0>;
qcom,pull-up = <1>;
linux,code = <116>;
};
qcom,pon_2 {
qcom,pon-type = <1>;
qcom,pull-up = <1>;
linux,code = <114>;
};
};
pm660_tz: qcom,temp-alarm@2400 {
compatible = "qcom,qpnp-temp-alarm";
reg = <0x2400 0x100>;
interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
label = "pm660_tz";
qcom,channel-num = <6>;
qcom,temp_alarm-vadc = <&pm660_vadc>;
#thermal-sensor-cells = <0>;
};
pm660_gpios: pinctrl@c000 {
compatible = "qcom,spmi-gpio";
reg = <0xc000 0xd00>;
interrupts = <0x0 0xc1 0 IRQ_TYPE_NONE>,
<0x0 0xc2 0 IRQ_TYPE_NONE>,
<0x0 0xc3 0 IRQ_TYPE_NONE>,
<0x0 0xc8 0 IRQ_TYPE_NONE>,
<0x0 0xca 0 IRQ_TYPE_NONE>,
<0x0 0xcb 0 IRQ_TYPE_NONE>,
<0x0 0xcc 0 IRQ_TYPE_NONE>;
interrupt-names = "pm660_gpio2", "pm660_gpio3",
"pm660_gpio4", "pm660_gpio9",
"pm660_gpio11", "pm660_gpio12",
"pm660_gpio13";
gpio-controller;
#gpio-cells = <2>;
qcom,gpios-disallowed = <1 5 6 7 8 10>;
};
pm660_coincell: qcom,coincell@2800 {
compatible = "qcom,qpnp-coincell";
reg = <0x2800 0x100>;
};
pm660_rtc: qcom,pm660_rtc {
compatible = "qcom,qpnp-rtc";
#address-cells = <1>;
#size-cells = <1>;
qcom,qpnp-rtc-write = <0>;
qcom,qpnp-rtc-alarm-pwrup = <0>;
qcom,pm660_rtc_rw@6000 {
reg = <0x6000 0x100>;
};
qcom,pm660_rtc_alarm@6100 {
reg = <0x6100 0x100>;
interrupts = <0x0 0x61 0x1 IRQ_TYPE_NONE>;
};
};
pm660_vadc: vadc@3100 {
compatible = "qcom,qpnp-vadc-hc";
reg = <0x3100 0x100>;
#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>;
chan@6 {
label = "die_temp";
reg = <6>;
qcom,decimation = <2>;
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,cal-val = <0>;
};
chan@0 {
label = "ref_gnd";
reg = <0>;
qcom,decimation = <2>;
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,cal-val = <0>;
};
chan@1 {
label = "ref_1250v";
reg = <1>;
qcom,decimation = <2>;
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,cal-val = <0>;
};
chan@83 {
label = "vph_pwr";
reg = <0x83>;
qcom,decimation = <2>;
qcom,pre-div-channel-scaling = <1>;
qcom,calibration-type = "absolute";
qcom,scale-function = <0>;
qcom,hw-settle-time = <0>;
qcom,fast-avg-setup = <0>;
};
chan@85 {
label = "vcoin";
reg = <0x85>;
qcom,decimation = <2>;
qcom,pre-div-channel-scaling = <1>;
qcom,calibration-type = "absolute";
qcom,scale-function = <0>;
qcom,hw-settle-time = <0>;
qcom,fast-avg-setup = <0>;
};
chan@4c {
label = "xo_therm";
reg = <0x4c>;
qcom,decimation = <2>;
qcom,pre-div-channel-scaling = <0>;
qcom,calibration-type = "ratiometric";
qcom,scale-function = <4>;
qcom,hw-settle-time = <2>;
qcom,fast-avg-setup = <0>;
};
chan@4d {
label = "msm_therm";
reg = <0x4d>;
qcom,decimation = <2>;
qcom,pre-div-channel-scaling = <0>;
qcom,calibration-type = "ratiometric";
qcom,scale-function = <2>;
qcom,hw-settle-time = <2>;
qcom,fast-avg-setup = <0>;
};
chan@51 {
label = "quiet_therm";
reg = <0x51>;
qcom,decimation = <2>;
qcom,pre-div-channel-scaling = <0>;
qcom,calibration-type = "ratiometric";
qcom,scale-function = <2>;
qcom,hw-settle-time = <2>;
qcom,fast-avg-setup = <0>;
};
chan@4e {
label = "emmc_therm";
reg = <0x4e>;
qcom,decimation = <2>;
qcom,pre-div-channel-scaling = <0>;
qcom,calibration-type = "ratiometric";
qcom,scale-function = <2>;
qcom,hw-settle-time = <2>;
qcom,fast-avg-setup = <0>;
};
chan@4f {
label = "pa_therm0";
reg = <0x4f>;
qcom,decimation = <2>;
qcom,pre-div-channel-scaling = <0>;
qcom,calibration-type = "ratiometric";
qcom,scale-function = <2>;
qcom,hw-settle-time = <2>;
qcom,fast-avg-setup = <0>;
};
chan@1d {
label = "drax_temp";
reg = <0x1d>;
qcom,decimation = <2>;
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,cal-val = <0>;
};
};
pm660_pdphy: qcom,usb-pdphy@1700 {
compatible = "qcom,qpnp-pdphy";
reg = <0x1700 0x100>;
vdd-pdphy-supply = <&pm660l_l7>;
vbus-supply = <0>;
vconn-supply = <0>;
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>;
interrupt-names = "sig-tx",
"sig-rx",
"msg-tx",
"msg-rx",
"msg-tx-failed",
"msg-tx-discarded",
"msg-rx-discarded";
qcom,default-sink-caps = <5000 3000>, /* 5V @ 3A */
<9000 3000>; /* 9V @ 3A */
};
pm660_adc_tm: vadc@3400 {
compatible = "qcom,qpnp-adc-tm-hc";
reg = <0x3400 0x100>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "eoc-int-en-set";
qcom,adc-vdd-reference = <1875>;
qcom,adc_tm-vadc = <&pm660_vadc>;
qcom,decimation = <0>;
qcom,fast-avg-setup = <0>;
#thermal-sensor-cells = <1>;
chan@83 {
label = "vph_pwr";
reg = <0x83>;
qcom,pre-div-channel-scaling = <1>;
qcom,calibration-type = "absolute";
qcom,scale-function = <0>;
qcom,hw-settle-time = <0>;
qcom,btm-channel-number = <0x60>;
};
chan@4d {
label = "msm_therm";
reg = <0x4d>;
qcom,pre-div-channel-scaling = <0>;
qcom,calibration-type = "ratiometric";
qcom,scale-function = <2>;
qcom,hw-settle-time = <2>;
qcom,btm-channel-number = <0x68>;
qcom,thermal-node;
};
chan@51 {
label = "quiet_therm";
reg = <0x51>;
qcom,pre-div-channel-scaling = <0>;
qcom,calibration-type = "ratiometric";
qcom,scale-function = <2>;
qcom,hw-settle-time = <2>;
qcom,btm-channel-number = <0x70>;
qcom,thermal-node;
};
chan@4c {
label = "xo_therm";
reg = <0x4c>;
qcom,pre-div-channel-scaling = <0>;
qcom,calibration-type = "ratiometric";
qcom,scale-function = <4>;
qcom,hw-settle-time = <2>;
qcom,btm-channel-number = <0x78>;
qcom,thermal-node;
};
chan@4e {
label = "emmc_therm";
reg = <0x4e>;
qcom,pre-div-channel-scaling = <0>;
qcom,calibration-type = "ratiometric";
qcom,scale-function = <2>;
qcom,hw-settle-time = <2>;
qcom,btm-channel-number = <0x80>;
qcom,thermal-node;
};
chan@4f {
label = "pa_therm0";
reg = <0x4f>;
qcom,pre-div-channel-scaling = <0>;
qcom,calibration-type = "ratiometric";
qcom,scale-function = <2>;
qcom,hw-settle-time = <2>;
qcom,btm-channel-number = <0x88>;
qcom,thermal-node;
};
};
bcl_sensor: bcl@4200 {
compatible = "qcom,msm-bcl-lmh";
reg = <0x4200 0xff>,
<0x4300 0xff>;
reg-names = "fg_user_adc",
"fg_lmh";
interrupts = <0x0 0x42 0x0 IRQ_TYPE_NONE>,
<0x0 0x42 0x1 IRQ_TYPE_NONE>,
<0x0 0x42 0x2 IRQ_TYPE_NONE>,
<0x0 0x42 0x3 IRQ_TYPE_NONE>,
<0x0 0x42 0x4 IRQ_TYPE_NONE>;
interrupt-names = "bcl-high-ibat",
"bcl-very-high-ibat",
"bcl-low-vbat",
"bcl-very-low-vbat",
"bcl-crit-low-vbat";
#thermal-sensor-cells = <1>;
};
pm660_div_clk: qcom,clkdiv@5b00 {
compatible = "qcom,qpnp-clkdiv";
reg = <0x5b00 0x100>;
#clock-cells = <1>;
qcom,cxo-freq = <19200000>;
qcom,clkdiv-id = <1>;
qcom,clkdiv-init-freq = <9600000>;
status = "disabled";
};
};
pm660_1: qcom,pm660@1 {
compatible ="qcom,spmi-pmic";
reg = <0x1 SPMI_USID>;
#address-cells = <2>;
#size-cells = <0>;
};
};
&thermal_zones {
xo-therm-adc {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-sensors = <&pm660_adc_tm 0x4c>;
thermal-governor = "user_space";
trips {
active-config0 {
temperature = <65000>;
hysteresis = <1000>;
type = "passive";
};
};
};
msm-therm-adc {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-sensors = <&pm660_adc_tm 0x4d>;
thermal-governor = "user_space";
trips {
active-config0 {
temperature = <65000>;
hysteresis = <1000>;
type = "passive";
};
};
};
emmc-therm-adc {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-sensors = <&pm660_adc_tm 0x4e>;
thermal-governor = "user_space";
trips {
active-config0 {
temperature = <65000>;
hysteresis = <1000>;
type = "passive";
};
};
};
pa-therm0-adc {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-sensors = <&pm660_adc_tm 0x4f>;
thermal-governor = "user_space";
trips {
active-config0 {
temperature = <65000>;
hysteresis = <1000>;
type = "passive";
};
};
};
quiet-therm-adc {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-sensors = <&pm660_adc_tm 0x51>;
thermal-governor = "user_space";
trips {
active-config0 {
temperature = <65000>;
hysteresis = <1000>;
type = "passive";
};
};
};
ibat-high {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "step_wise";
thermal-sensors = <&bcl_sensor 0>;
trips {
ibat-high {
temperature = <4200>;
hysteresis = <200>;
type = "passive";
};
};
};
ibat-vhigh {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "step_wise";
thermal-sensors = <&bcl_sensor 1>;
trips {
ibat-vhigh {
temperature = <4300>;
hysteresis = <100>;
type = "passive";
};
};
};
vbat_adc {
polling-delay-passive = <100>;
polling-delay = <0>;
thermal-governor = "low_limits_cap";
thermal-sensors = <&bcl_sensor 2>;
tracks-low;
trips {
pm660_vbat_adc: vbat-adc {
temperature = <3200>;
hysteresis = <100>;
type = "passive";
};
};
cooling-maps {
vbat_map6 {
trip = <&pm660_vbat_adc>;
cooling-device =
<&CPU6 THERMAL_MAX_LIMIT
THERMAL_MAX_LIMIT>;
};
vbat_map7 {
trip = <&pm660_vbat_adc>;
cooling-device =
<&CPU7 THERMAL_MAX_LIMIT
THERMAL_MAX_LIMIT>;
};
};
};
vbat_low {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "low_limits_cap";
thermal-sensors = <&bcl_sensor 3>;
tracks-low;
trips {
vbat-low {
temperature = <2800>;
hysteresis = <0>;
type = "passive";
};
};
};
vbat_too_low {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "low_limits_cap";
thermal-sensors = <&bcl_sensor 4>;
tracks-low;
trips {
vbat-too-low {
temperature = <2600>;
hysteresis = <0>;
type = "passive";
};
};
};
soc {
polling-delay-passive = <100>;
polling-delay = <0>;
thermal-governor = "low_limits_cap";
thermal-sensors = <&bcl_sensor 5>;
tracks-low;
trips {
pm660_low_soc: low-soc {
temperature = <10>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
soc_map6 {
trip = <&pm660_low_soc>;
cooling-device =
<&CPU6 THERMAL_MAX_LIMIT
THERMAL_MAX_LIMIT>;
};
soc_map7 {
trip = <&pm660_low_soc>;
cooling-device =
<&CPU7 THERMAL_MAX_LIMIT
THERMAL_MAX_LIMIT>;
};
};
};
pm660_temp_alarm: pm660_tz {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "step_wise";
thermal-sensors = <&pm660_tz>;
trips {
pm660_trip0: pm660-trip0 {
temperature = <105000>;
hysteresis = <0>;
type = "passive";
};
pm660_trip1: pm660-trip1 {
temperature = <125000>;
hysteresis = <0>;
type = "passive";
};
pm660_trip2: pm660-trip2 {
temperature = <145000>;
hysteresis = <0>;
type = "critical";
};
};
cooling-maps {
trip0_cpu0 {
trip = <&pm660_trip0>;
cooling-device =
<&CPU0 (THERMAL_MAX_LIMIT-1)
(THERMAL_MAX_LIMIT-1)>;
};
trip0_cpu1 {
trip = <&pm660_trip0>;
cooling-device =
<&CPU1 (THERMAL_MAX_LIMIT-1)
(THERMAL_MAX_LIMIT-1)>;
};
trip0_cpu2 {
trip = <&pm660_trip0>;
cooling-device =
<&CPU2 (THERMAL_MAX_LIMIT-1)
(THERMAL_MAX_LIMIT-1)>;
};
trip0_cpu3 {
trip = <&pm660_trip0>;
cooling-device =
<&CPU3 (THERMAL_MAX_LIMIT-1)
(THERMAL_MAX_LIMIT-1)>;
};
trip0_cpu4 {
trip = <&pm660_trip0>;
cooling-device =
<&CPU4 (THERMAL_MAX_LIMIT-1)
(THERMAL_MAX_LIMIT-1)>;
};
trip0_cpu5 {
trip = <&pm660_trip0>;
cooling-device =
<&CPU5 (THERMAL_MAX_LIMIT-1)
(THERMAL_MAX_LIMIT-1)>;
};
trip0_cpu6 {
trip = <&pm660_trip0>;
cooling-device =
<&CPU6 (THERMAL_MAX_LIMIT-1)
(THERMAL_MAX_LIMIT-1)>;
};
trip0_cpu7 {
trip = <&pm660_trip0>;
cooling-device =
<&CPU7 (THERMAL_MAX_LIMIT-1)
(THERMAL_MAX_LIMIT-1)>;
};
trip1_cpu1 {
trip = <&pm660_trip1>;
cooling-device =
<&CPU1 THERMAL_MAX_LIMIT
THERMAL_MAX_LIMIT>;
};
trip1_cpu2 {
trip = <&pm660_trip1>;
cooling-device =
<&CPU2 THERMAL_MAX_LIMIT
THERMAL_MAX_LIMIT>;
};
trip1_cpu3 {
trip = <&pm660_trip1>;
cooling-device =
<&CPU3 THERMAL_MAX_LIMIT
THERMAL_MAX_LIMIT>;
};
trip1_cpu4 {
trip = <&pm660_trip1>;
cooling-device =
<&CPU4 THERMAL_MAX_LIMIT
THERMAL_MAX_LIMIT>;
};
trip1_cpu5 {
trip = <&pm660_trip1>;
cooling-device =
<&CPU5 THERMAL_MAX_LIMIT
THERMAL_MAX_LIMIT>;
};
trip1_cpu6 {
trip = <&pm660_trip1>;
cooling-device =
<&CPU6 THERMAL_MAX_LIMIT
THERMAL_MAX_LIMIT>;
};
trip1_cpu7 {
trip = <&pm660_trip1>;
cooling-device =
<&CPU7 THERMAL_MAX_LIMIT
THERMAL_MAX_LIMIT>;
};
};
};
};