Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 1 | // SPDX-License-Identifier: BSD-3-Clause |
| 2 | /* |
| 3 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. |
| 4 | * Copyright (c) 2021-2023, Linaro Limited |
| 5 | */ |
| 6 | |
| 7 | #include <dt-bindings/input/input.h> |
| 8 | #include <dt-bindings/interrupt-controller/irq.h> |
| 9 | #include <dt-bindings/spmi/spmi.h> |
| 10 | #include <dt-bindings/iio/qcom,spmi-vadc.h> |
| 11 | |
| 12 | / { |
| 13 | thermal-zones { |
| 14 | pmc8180-thermal { |
| 15 | polling-delay-passive = <100>; |
| 16 | polling-delay = <0>; |
| 17 | |
| 18 | thermal-sensors = <&pmc8180_temp>; |
| 19 | |
| 20 | trips { |
| 21 | trip0 { |
| 22 | temperature = <95000>; |
| 23 | hysteresis = <0>; |
| 24 | type = "passive"; |
| 25 | }; |
| 26 | |
| 27 | trip1 { |
| 28 | temperature = <115000>; |
| 29 | hysteresis = <0>; |
| 30 | type = "hot"; |
| 31 | }; |
| 32 | |
| 33 | trip2 { |
| 34 | temperature = <145000>; |
| 35 | hysteresis = <0>; |
| 36 | type = "critical"; |
| 37 | }; |
| 38 | }; |
| 39 | }; |
| 40 | |
| 41 | pmc8180c-thermal { |
| 42 | polling-delay-passive = <100>; |
| 43 | polling-delay = <0>; |
| 44 | |
| 45 | thermal-sensors = <&pmc8180c_temp>; |
| 46 | |
| 47 | trips { |
| 48 | trip0 { |
| 49 | temperature = <95000>; |
| 50 | hysteresis = <0>; |
| 51 | type = "passive"; |
| 52 | }; |
| 53 | |
| 54 | trip1 { |
| 55 | temperature = <115000>; |
| 56 | hysteresis = <0>; |
| 57 | type = "hot"; |
| 58 | }; |
| 59 | |
| 60 | trip2 { |
| 61 | temperature = <145000>; |
| 62 | hysteresis = <0>; |
| 63 | type = "critical"; |
| 64 | }; |
| 65 | }; |
| 66 | }; |
| 67 | }; |
| 68 | }; |
| 69 | |
| 70 | &spmi_bus { |
| 71 | pmc8180_0: pmic@0 { |
| 72 | compatible = "qcom,pm8150", "qcom,spmi-pmic"; |
| 73 | reg = <0x0 SPMI_USID>; |
| 74 | #address-cells = <1>; |
| 75 | #size-cells = <0>; |
| 76 | |
| 77 | pon: pon@800 { |
| 78 | compatible = "qcom,pm8916-pon"; |
| 79 | reg = <0x0800>; |
| 80 | pwrkey { |
| 81 | compatible = "qcom,pm8941-pwrkey"; |
| 82 | interrupts = <0x0 0x8 0x0 IRQ_TYPE_EDGE_BOTH>; |
| 83 | debounce = <15625>; |
| 84 | bias-pull-up; |
| 85 | linux,code = <KEY_POWER>; |
| 86 | |
| 87 | status = "disabled"; |
| 88 | }; |
| 89 | }; |
| 90 | |
| 91 | pmc8180_temp: temp-alarm@2400 { |
| 92 | compatible = "qcom,spmi-temp-alarm"; |
| 93 | reg = <0x2400>; |
| 94 | interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_BOTH>; |
| 95 | io-channels = <&pmc8180_adc ADC5_DIE_TEMP>; |
| 96 | io-channel-names = "thermal"; |
| 97 | #thermal-sensor-cells = <0>; |
| 98 | }; |
| 99 | |
| 100 | pmc8180_adc: adc@3100 { |
| 101 | compatible = "qcom,spmi-adc5"; |
| 102 | reg = <0x3100>; |
| 103 | #address-cells = <1>; |
| 104 | #size-cells = <0>; |
| 105 | #io-channel-cells = <1>; |
| 106 | interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; |
| 107 | |
| 108 | channel@0 { |
| 109 | reg = <ADC5_REF_GND>; |
| 110 | qcom,pre-scaling = <1 1>; |
| 111 | label = "ref_gnd"; |
| 112 | }; |
| 113 | |
| 114 | channel@1 { |
| 115 | reg = <ADC5_1P25VREF>; |
| 116 | qcom,pre-scaling = <1 1>; |
| 117 | label = "vref_1p25"; |
| 118 | }; |
| 119 | |
| 120 | channel@6 { |
| 121 | reg = <ADC5_DIE_TEMP>; |
| 122 | qcom,pre-scaling = <1 1>; |
| 123 | label = "die_temp"; |
| 124 | }; |
| 125 | }; |
| 126 | |
| 127 | pmc8180_adc_tm: adc-tm@3500 { |
| 128 | compatible = "qcom,spmi-adc-tm5"; |
| 129 | reg = <0x3500>; |
| 130 | interrupts = <0x0 0x35 0x0 IRQ_TYPE_EDGE_RISING>; |
| 131 | #thermal-sensor-cells = <1>; |
| 132 | #address-cells = <1>; |
| 133 | #size-cells = <0>; |
| 134 | status = "disabled"; |
| 135 | }; |
| 136 | |
| 137 | rtc@6000 { |
| 138 | compatible = "qcom,pm8941-rtc"; |
| 139 | reg = <0x6000>; |
| 140 | reg-names = "rtc", "alarm"; |
| 141 | interrupts = <0x0 0x61 0x1 IRQ_TYPE_NONE>; |
| 142 | }; |
| 143 | |
| 144 | pmc8180_gpios: gpio@c000 { |
| 145 | compatible = "qcom,pmc8180-gpio", "qcom,spmi-gpio"; |
| 146 | reg = <0xc000>; |
| 147 | gpio-controller; |
| 148 | gpio-ranges = <&pmc8180_gpios 0 0 10>; |
| 149 | #gpio-cells = <2>; |
| 150 | interrupt-controller; |
| 151 | #interrupt-cells = <2>; |
| 152 | }; |
| 153 | }; |
| 154 | |
| 155 | pmic@1 { |
| 156 | compatible = "qcom,pmc8180", "qcom,spmi-pmic"; |
| 157 | reg = <0x1 SPMI_USID>; |
| 158 | #address-cells = <1>; |
| 159 | #size-cells = <0>; |
| 160 | }; |
| 161 | |
| 162 | pmic@2 { |
| 163 | compatible = "qcom,smb2351", "qcom,spmi-pmic"; |
| 164 | reg = <0x2 SPMI_USID>; |
| 165 | #address-cells = <1>; |
| 166 | #size-cells = <0>; |
| 167 | |
| 168 | adc@3100 { |
| 169 | compatible = "qcom,spmi-adc-rev2"; |
| 170 | reg = <0x3100>; |
| 171 | #address-cells = <1>; |
| 172 | #size-cells = <0>; |
| 173 | #io-channel-cells = <1>; |
| 174 | interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>; |
| 175 | |
| 176 | channel@0 { |
| 177 | reg = <ADC5_REF_GND>; |
| 178 | qcom,pre-scaling = <1 1>; |
| 179 | label = "ref_gnd"; |
| 180 | }; |
| 181 | |
| 182 | channel@1 { |
| 183 | reg = <ADC5_1P25VREF>; |
| 184 | qcom,pre-scaling = <1 1>; |
| 185 | label = "vref_1p25"; |
| 186 | }; |
| 187 | |
| 188 | channel@85 { |
| 189 | reg = <0x85>; |
| 190 | qcom,pre-scaling = <1 1>; |
| 191 | label = "vcoin2"; |
| 192 | }; |
| 193 | }; |
| 194 | }; |
| 195 | |
| 196 | pmic@6 { |
| 197 | compatible = "qcom,pm8150c", "qcom,spmi-pmic"; |
| 198 | reg = <0x6 SPMI_USID>; |
| 199 | #address-cells = <1>; |
| 200 | #size-cells = <0>; |
| 201 | }; |
| 202 | |
| 203 | pmic@8 { |
| 204 | compatible = "qcom,pm8150", "qcom,spmi-pmic"; |
| 205 | reg = <0x8 SPMI_USID>; |
| 206 | #address-cells = <1>; |
| 207 | #size-cells = <0>; |
| 208 | }; |
| 209 | |
| 210 | pmic@a { |
| 211 | compatible = "qcom,smb2351", "qcom,spmi-pmic"; |
| 212 | reg = <0xa SPMI_USID>; |
| 213 | #address-cells = <1>; |
| 214 | #size-cells = <0>; |
| 215 | |
| 216 | adc@3100 { |
| 217 | compatible = "qcom,spmi-adc-rev2"; |
| 218 | reg = <0x3100>; |
| 219 | #address-cells = <1>; |
| 220 | #size-cells = <0>; |
| 221 | #io-channel-cells = <1>; |
| 222 | interrupts = <0xa 0x31 0x0 IRQ_TYPE_EDGE_RISING>; |
| 223 | |
| 224 | channel@0 { |
| 225 | reg = <ADC5_REF_GND>; |
| 226 | qcom,pre-scaling = <1 1>; |
| 227 | label = "ref_gnd"; |
| 228 | }; |
| 229 | |
| 230 | channel@1 { |
| 231 | reg = <ADC5_1P25VREF>; |
| 232 | qcom,pre-scaling = <1 1>; |
| 233 | label = "vref_1p25"; |
| 234 | }; |
| 235 | |
| 236 | channel@85 { |
| 237 | reg = <0x85>; |
| 238 | qcom,pre-scaling = <1 1>; |
| 239 | label = "vcoin"; |
| 240 | }; |
| 241 | }; |
| 242 | }; |
| 243 | |
| 244 | pmic@4 { |
| 245 | compatible = "qcom,pm8150c", "qcom,spmi-pmic"; |
| 246 | reg = <0x4 SPMI_USID>; |
| 247 | #address-cells = <1>; |
| 248 | #size-cells = <0>; |
| 249 | |
| 250 | pon@800 { |
| 251 | compatible = "qcom,pm8916-pon"; |
| 252 | reg = <0x0800>; |
| 253 | |
| 254 | status = "disabled"; |
| 255 | }; |
| 256 | |
| 257 | pmc8180c_temp: temp-alarm@2400 { |
| 258 | compatible = "qcom,spmi-temp-alarm"; |
| 259 | reg = <0x2400>; |
| 260 | interrupts = <0x4 0x24 0x0 IRQ_TYPE_EDGE_BOTH>; |
| 261 | io-channels = <&pmc8180c_adc ADC5_DIE_TEMP>; |
| 262 | io-channel-names = "thermal"; |
| 263 | #thermal-sensor-cells = <0>; |
| 264 | }; |
| 265 | |
| 266 | pmc8180c_adc: adc@3100 { |
| 267 | compatible = "qcom,spmi-adc5"; |
| 268 | reg = <0x3100>; |
| 269 | #address-cells = <1>; |
| 270 | #size-cells = <0>; |
| 271 | #io-channel-cells = <1>; |
| 272 | interrupts = <0x4 0x31 0x0 IRQ_TYPE_EDGE_RISING>; |
| 273 | |
| 274 | channel@0 { |
| 275 | reg = <ADC5_REF_GND>; |
| 276 | qcom,pre-scaling = <1 1>; |
| 277 | label = "ref_gnd"; |
| 278 | }; |
| 279 | |
| 280 | channel@1 { |
| 281 | reg = <ADC5_1P25VREF>; |
| 282 | qcom,pre-scaling = <1 1>; |
| 283 | label = "vref_1p25"; |
| 284 | }; |
| 285 | |
| 286 | channel@6 { |
| 287 | reg = <ADC5_DIE_TEMP>; |
| 288 | qcom,pre-scaling = <1 1>; |
| 289 | label = "die_temp"; |
| 290 | }; |
| 291 | }; |
| 292 | |
| 293 | pmc8180c_adc_tm: adc-tm@3500 { |
| 294 | compatible = "qcom,spmi-adc-tm5"; |
| 295 | reg = <0x3500>; |
| 296 | interrupts = <0x4 0x35 0x0 IRQ_TYPE_EDGE_RISING>; |
| 297 | #thermal-sensor-cells = <1>; |
| 298 | #address-cells = <1>; |
| 299 | #size-cells = <0>; |
| 300 | status = "disabled"; |
| 301 | }; |
| 302 | |
| 303 | pmc8180c_gpios: gpio@c000 { |
| 304 | compatible = "qcom,pmc8180c-gpio", "qcom,spmi-gpio"; |
| 305 | reg = <0xc000>; |
| 306 | gpio-controller; |
| 307 | gpio-ranges = <&pmc8180c_gpios 0 0 12>; |
| 308 | #gpio-cells = <2>; |
| 309 | interrupt-controller; |
| 310 | #interrupt-cells = <2>; |
| 311 | }; |
| 312 | }; |
| 313 | |
| 314 | pmic@5 { |
| 315 | compatible = "qcom,pmc8180c", "qcom,spmi-pmic"; |
| 316 | reg = <0x5 SPMI_USID>; |
| 317 | |
| 318 | pmc8180c_lpg: pwm { |
| 319 | compatible = "qcom,pmc8180c-lpg"; |
| 320 | |
| 321 | #address-cells = <1>; |
| 322 | #size-cells = <0>; |
| 323 | #pwm-cells = <2>; |
| 324 | |
| 325 | status = "disabled"; |
| 326 | }; |
| 327 | }; |
| 328 | }; |