| 1 |
// SPDX-License-Identifier: BSD-3-Clause |
| 2 |
/* |
| 3 |
* Copyright (c) 2020, Konrad Dybcio |
| 4 |
*/ |
| 5 |
|
| 6 |
#include <dt-bindings/iio/qcom,spmi-vadc.h> |
| 7 |
#include <dt-bindings/input/linux-event-codes.h> |
| 8 |
#include <dt-bindings/interrupt-controller/irq.h> |
| 9 |
#include <dt-bindings/spmi/spmi.h> |
| 10 |
#include <dt-bindings/thermal/thermal.h> |
| 11 |
|
| 12 |
/ { |
| 13 |
thermal-zones { |
| 14 |
pm660-thermal { |
| 15 |
polling-delay-passive = <250>; |
| 16 |
|
| 17 |
thermal-sensors = <&pm660_temp>; |
| 18 |
|
| 19 |
trips { |
| 20 |
pm660_alert0: pm660-alert0 { |
| 21 |
temperature = <95000>; |
| 22 |
hysteresis = <2000>; |
| 23 |
type = "passive"; |
| 24 |
}; |
| 25 |
pm660_crit: pm660-crit { |
| 26 |
temperature = <125000>; |
| 27 |
hysteresis = <2000>; |
| 28 |
type = "critical"; |
| 29 |
}; |
| 30 |
}; |
| 31 |
}; |
| 32 |
}; |
| 33 |
}; |
| 34 |
|
| 35 |
&spmi_bus { |
| 36 |
|
| 37 |
pmic@0 { |
| 38 |
compatible = "qcom,pm660", "qcom,spmi-pmic"; |
| 39 |
reg = <0x0 SPMI_USID>; |
| 40 |
#address-cells = <1>; |
| 41 |
#size-cells = <0>; |
| 42 |
|
| 43 |
rtc@6000 { |
| 44 |
compatible = "qcom,pm8941-rtc"; |
| 45 |
reg = <0x6000>, <0x6100>; |
| 46 |
reg-names = "rtc", "alarm"; |
| 47 |
interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>; |
| 48 |
}; |
| 49 |
|
| 50 |
pon: pon@800 { |
| 51 |
compatible = "qcom,pm8998-pon"; |
| 52 |
reg = <0x800>; |
| 53 |
mode-bootloader = <0x2>; |
| 54 |
mode-recovery = <0x1>; |
| 55 |
|
| 56 |
pon_pwrkey: pwrkey { |
| 57 |
compatible = "qcom,pm8941-pwrkey"; |
| 58 |
interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>; |
| 59 |
debounce = <15625>; |
| 60 |
bias-pull-up; |
| 61 |
linux,code = <KEY_POWER>; |
| 62 |
|
| 63 |
status = "disabled"; |
| 64 |
}; |
| 65 |
|
| 66 |
pon_resin: resin { |
| 67 |
compatible = "qcom,pm8941-resin"; |
| 68 |
interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; |
| 69 |
debounce = <15625>; |
| 70 |
bias-pull-up; |
| 71 |
|
| 72 |
status = "disabled"; |
| 73 |
}; |
| 74 |
}; |
| 75 |
|
| 76 |
pm660_charger: charger@1000 { |
| 77 |
compatible = "qcom,pm660-charger"; |
| 78 |
reg = <0x1000>; |
| 79 |
|
| 80 |
interrupts = <0x0 0x13 0x4 IRQ_TYPE_EDGE_BOTH>, |
| 81 |
<0x0 0x12 0x2 IRQ_TYPE_EDGE_BOTH>, |
| 82 |
<0x0 0x16 0x1 IRQ_TYPE_EDGE_RISING>, |
| 83 |
<0x0 0x13 0x6 IRQ_TYPE_EDGE_RISING>; |
| 84 |
interrupt-names = "usb-plugin", "bat-ov", "wdog-bark", "usbin-icl-change"; |
| 85 |
|
| 86 |
io-channels = <&pm660_rradc 3>, |
| 87 |
<&pm660_rradc 4>; |
| 88 |
io-channel-names = "usbin_i", "usbin_v"; |
| 89 |
|
| 90 |
status = "disabled"; |
| 91 |
}; |
| 92 |
|
| 93 |
pm660_temp: temp-alarm@2400 { |
| 94 |
compatible = "qcom,spmi-temp-alarm"; |
| 95 |
reg = <0x2400>; |
| 96 |
interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>; |
| 97 |
io-channels = <&pm660_adc ADC5_DIE_TEMP>; |
| 98 |
io-channel-names = "thermal"; |
| 99 |
#thermal-sensor-cells = <0>; |
| 100 |
}; |
| 101 |
|
| 102 |
pm660_adc: adc@3100 { |
| 103 |
compatible = "qcom,spmi-adc-rev2"; |
| 104 |
reg = <0x3100>; |
| 105 |
interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; |
| 106 |
#address-cells = <1>; |
| 107 |
#size-cells = <0>; |
| 108 |
#io-channel-cells = <1>; |
| 109 |
|
| 110 |
channel@0 { |
| 111 |
reg = <ADC5_REF_GND>; |
| 112 |
qcom,decimation = <1024>; |
| 113 |
qcom,pre-scaling = <1 1>; |
| 114 |
label = "ref_gnd"; |
| 115 |
}; |
| 116 |
|
| 117 |
channel@1 { |
| 118 |
reg = <ADC5_1P25VREF>; |
| 119 |
qcom,decimation = <1024>; |
| 120 |
qcom,pre-scaling = <1 1>; |
| 121 |
label = "vref_1p25"; |
| 122 |
}; |
| 123 |
|
| 124 |
channel@6 { |
| 125 |
reg = <ADC5_DIE_TEMP>; |
| 126 |
qcom,decimation = <1024>; |
| 127 |
qcom,pre-scaling = <1 1>; |
| 128 |
label = "die_temp"; |
| 129 |
}; |
| 130 |
|
| 131 |
channel@4c { |
| 132 |
reg = <ADC5_XO_THERM_100K_PU>; |
| 133 |
qcom,pre-scaling = <1 1>; |
| 134 |
qcom,decimation = <1024>; |
| 135 |
qcom,hw-settle-time = <200>; |
| 136 |
qcom,ratiometric; |
| 137 |
label = "xo_therm"; |
| 138 |
}; |
| 139 |
|
| 140 |
channel@4d { |
| 141 |
reg = <ADC5_AMUX_THM1_100K_PU>; |
| 142 |
qcom,pre-scaling = <1 1>; |
| 143 |
qcom,decimation = <1024>; |
| 144 |
qcom,hw-settle-time = <200>; |
| 145 |
qcom,ratiometric; |
| 146 |
label = "msm_therm"; |
| 147 |
}; |
| 148 |
|
| 149 |
channel@4e { |
| 150 |
reg = <ADC5_AMUX_THM2_100K_PU>; |
| 151 |
qcom,pre-scaling = <1 1>; |
| 152 |
qcom,decimation = <1024>; |
| 153 |
qcom,hw-settle-time = <200>; |
| 154 |
qcom,ratiometric; |
| 155 |
label = "emmc_therm"; |
| 156 |
}; |
| 157 |
|
| 158 |
channel@4f { |
| 159 |
reg = <ADC5_AMUX_THM3_100K_PU>; |
| 160 |
qcom,pre-scaling = <1 1>; |
| 161 |
qcom,decimation = <1024>; |
| 162 |
qcom,hw-settle-time = <200>; |
| 163 |
qcom,ratiometric; |
| 164 |
label = "pa_therm0"; |
| 165 |
}; |
| 166 |
|
| 167 |
channel@50 { |
| 168 |
reg = <ADC5_AMUX_THM4_100K_PU>; |
| 169 |
qcom,pre-scaling = <1 1>; |
| 170 |
qcom,decimation = <1024>; |
| 171 |
qcom,hw-settle-time = <200>; |
| 172 |
qcom,ratiometric; |
| 173 |
label = "pa_therm1"; |
| 174 |
}; |
| 175 |
|
| 176 |
channel@51 { |
| 177 |
reg = <ADC5_AMUX_THM5_100K_PU>; |
| 178 |
qcom,pre-scaling = <1 1>; |
| 179 |
qcom,decimation = <1024>; |
| 180 |
qcom,hw-settle-time = <200>; |
| 181 |
qcom,ratiometric; |
| 182 |
label = "quiet_therm"; |
| 183 |
}; |
| 184 |
|
| 185 |
channel@83 { |
| 186 |
reg = <ADC5_VPH_PWR>; |
| 187 |
qcom,decimation = <1024>; |
| 188 |
qcom,pre-scaling = <1 3>; |
| 189 |
label = "vph_pwr"; |
| 190 |
}; |
| 191 |
|
| 192 |
channel@85 { |
| 193 |
reg = <ADC5_VCOIN>; |
| 194 |
qcom,decimation = <1024>; |
| 195 |
qcom,pre-scaling = <1 3>; |
| 196 |
label = "vcoin"; |
| 197 |
}; |
| 198 |
}; |
| 199 |
|
| 200 |
pm660_rradc: adc@4500 { |
| 201 |
compatible = "qcom,pm660-rradc"; |
| 202 |
reg = <0x4500>; |
| 203 |
#io-channel-cells = <1>; |
| 204 |
|
| 205 |
status = "disabled"; |
| 206 |
}; |
| 207 |
|
| 208 |
pm660_gpios: gpio@c000 { |
| 209 |
compatible = "qcom,pm660-gpio", "qcom,spmi-gpio"; |
| 210 |
reg = <0xc000>; |
| 211 |
gpio-controller; |
| 212 |
gpio-ranges = <&pm660_gpios 0 0 13>; |
| 213 |
#gpio-cells = <2>; |
| 214 |
interrupt-controller; |
| 215 |
#interrupt-cells = <2>; |
| 216 |
}; |
| 217 |
}; |
| 218 |
|
| 219 |
pmic@1 { |
| 220 |
compatible = "qcom,pm660", "qcom,spmi-pmic"; |
| 221 |
reg = <0x1 SPMI_USID>; |
| 222 |
#address-cells = <1>; |
| 223 |
#size-cells = <0>; |
| 224 |
|
| 225 |
pm660_spmi_regulators: regulators { |
| 226 |
compatible = "qcom,pm660-regulators"; |
| 227 |
}; |
| 228 |
}; |
| 229 |
}; |