Luca Weiss | 9b02244 | 2023-04-14 14:47:36 +0200 | [diff] [blame^] | 1 | #include <dt-bindings/input/input.h> |
| 2 | #include <dt-bindings/input/qcom,qpnp-power-on.h> |
| 3 | #include <dt-bindings/interrupt-controller/irq.h> |
| 4 | #include <dt-bindings/spmi/spmi.h> |
| 5 | #include <dt-bindings/iio/qcom,spmi-vadc.h> |
| 6 | |
| 7 | &spmi_bus { |
| 8 | #address-cells = <2>; |
| 9 | #size-cells = <0>; |
| 10 | interrupt-controller; |
| 11 | #interrupt-cells = <4>; |
| 12 | |
| 13 | qcom,pm2250@0 { |
| 14 | compatible = "qcom,spmi-pmic"; |
| 15 | reg = <0x0 SPMI_USID>; |
| 16 | #address-cells = <2>; |
| 17 | #size-cells = <0>; |
| 18 | |
| 19 | pm2250_revid: qcom,revid@100 { |
| 20 | compatible = "qcom,qpnp-revid"; |
| 21 | reg = <0x100 0x100>; |
| 22 | }; |
| 23 | |
| 24 | qcom,power-on@800 { |
| 25 | compatible = "qcom,qpnp-power-on"; |
| 26 | reg = <0x800 0x100>; |
| 27 | interrupts = <0x0 0x8 0x0 IRQ_TYPE_EDGE_BOTH>, |
| 28 | <0x0 0x8 0x1 IRQ_TYPE_EDGE_BOTH>; |
| 29 | interrupt-names = "kpdpwr", "resin"; |
| 30 | qcom,pon-dbc-delay = <15625>; |
| 31 | qcom,kpdpwr-sw-debounce; |
| 32 | qcom,system-reset; |
| 33 | qcom,store-hard-reset-reason; |
| 34 | |
| 35 | qcom,pon_1 { |
| 36 | qcom,pon-type = <PON_POWER_ON_TYPE_KPDPWR>; |
| 37 | qcom,pull-up = <1>; |
| 38 | linux,code = <KEY_POWER>; |
| 39 | }; |
| 40 | |
| 41 | qcom,pon_2 { |
| 42 | qcom,pon-type = <PON_POWER_ON_TYPE_RESIN>; |
| 43 | qcom,pull-up = <1>; |
| 44 | linux,code = <KEY_VOLUMEDOWN>; |
| 45 | }; |
| 46 | }; |
| 47 | |
| 48 | pm2250_tz: qcom,temp-alarm@2400 { |
| 49 | compatible = "qcom,spmi-temp-alarm"; |
| 50 | reg = <0x2400 0x100>; |
| 51 | interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_BOTH>; |
| 52 | io-channels = <&pm2250_vadc ADC_DIE_TEMP>; |
| 53 | io-channel-names = "thermal"; |
| 54 | #thermal-sensor-cells = <0>; |
| 55 | qcom,temperature-threshold-set = <1>; |
| 56 | }; |
| 57 | |
| 58 | pm2250_vadc: vadc@3100 { |
| 59 | compatible = "qcom,spmi-adc5-lite"; |
| 60 | reg = <0x3100 0x100>; |
| 61 | reg-names = "adc5-usr-base"; |
| 62 | #address-cells = <1>; |
| 63 | #size-cells = <0>; |
| 64 | interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; |
| 65 | interrupt-names = "eoc-int-en-set"; |
| 66 | #io-channel-cells = <1>; |
| 67 | io-channel-ranges; |
| 68 | |
| 69 | /* Channel nodes */ |
| 70 | ref_gnd { |
| 71 | reg = <ADC_REF_GND>; |
| 72 | label = "ref_gnd"; |
| 73 | qcom,pre-scaling = <1 1>; |
| 74 | }; |
| 75 | |
| 76 | vref_1p25 { |
| 77 | reg = <ADC_1P25VREF>; |
| 78 | label = "vref_1p25"; |
| 79 | qcom,pre-scaling = <1 1>; |
| 80 | }; |
| 81 | |
| 82 | die_temp { |
| 83 | reg = <ADC_DIE_TEMP>; |
| 84 | label = "die_temp"; |
| 85 | qcom,pre-scaling = <1 1>; |
| 86 | }; |
| 87 | |
| 88 | vph_pwr { |
| 89 | reg = <ADC_VPH_PWR>; |
| 90 | label = "vph_pwr"; |
| 91 | qcom,pre-scaling = <1 3>; |
| 92 | }; |
| 93 | |
| 94 | vbat_sns { |
| 95 | reg = <ADC_VBAT_SNS>; |
| 96 | label = "vbat_sns"; |
| 97 | qcom,pre-scaling = <1 3>; |
| 98 | }; |
| 99 | |
| 100 | usb_in_v_div_16 { |
| 101 | reg = <ADC_USB_IN_V_16>; |
| 102 | label = "usb_in_v_div_16"; |
| 103 | qcom,pre-scaling = <1 16>; |
| 104 | }; |
| 105 | |
| 106 | chg_temp { |
| 107 | reg = <ADC_CHG_TEMP>; |
| 108 | label = "chg_temp"; |
| 109 | qcom,pre-scaling = <1 1>; |
| 110 | }; |
| 111 | |
| 112 | bat_therm { |
| 113 | reg = <ADC_BAT_THERM_PU2>; |
| 114 | label = "bat_therm"; |
| 115 | qcom,ratiometric; |
| 116 | qcom,hw-settle-time = <200>; |
| 117 | qcom,pre-scaling = <1 1>; |
| 118 | }; |
| 119 | |
| 120 | bat_therm_30k { |
| 121 | reg = <ADC_BAT_THERM_PU1>; |
| 122 | label = "bat_therm_30k"; |
| 123 | qcom,ratiometric; |
| 124 | qcom,hw-settle-time = <200>; |
| 125 | qcom,pre-scaling = <1 1>; |
| 126 | }; |
| 127 | |
| 128 | bat_therm_400k { |
| 129 | reg = <ADC_BAT_THERM_PU3>; |
| 130 | label = "bat_therm_400k"; |
| 131 | qcom,ratiometric; |
| 132 | qcom,hw-settle-time = <200>; |
| 133 | qcom,pre-scaling = <1 1>; |
| 134 | }; |
| 135 | |
| 136 | bat_id { |
| 137 | reg = <ADC_BAT_ID_PU2>; |
| 138 | label = "bat_id"; |
| 139 | qcom,ratiometric; |
| 140 | qcom,hw-settle-time = <200>; |
| 141 | qcom,pre-scaling = <1 1>; |
| 142 | }; |
| 143 | |
| 144 | die_temp_s3 { |
| 145 | reg = <ADC_SBUx>; |
| 146 | label = "die_temp_s3"; |
| 147 | qcom,pre-scaling = <1 3>; |
| 148 | qcom,scale-fn-type = <ADC_SCALE_HW_CALIB_PM2250_S3_DIE_TEMP>; |
| 149 | }; |
| 150 | }; |
| 151 | |
| 152 | |
| 153 | pm2250_gpios: pinctrl@c000 { |
| 154 | compatible = "qcom,spmi-gpio"; |
| 155 | reg = <0xc000 0xa00>; |
| 156 | interrupts = <0x0 0xc0 0 IRQ_TYPE_NONE>, |
| 157 | <0x0 0xc1 0 IRQ_TYPE_NONE>, |
| 158 | <0x0 0xc2 0 IRQ_TYPE_NONE>, |
| 159 | <0x0 0xc3 0 IRQ_TYPE_NONE>, |
| 160 | <0x0 0xc4 0 IRQ_TYPE_NONE>, |
| 161 | <0x0 0xc5 0 IRQ_TYPE_NONE>, |
| 162 | <0x0 0xc6 0 IRQ_TYPE_NONE>, |
| 163 | <0x0 0xc7 0 IRQ_TYPE_NONE>, |
| 164 | <0x0 0xc8 0 IRQ_TYPE_NONE>, |
| 165 | <0x0 0xc9 0 IRQ_TYPE_NONE>; |
| 166 | |
| 167 | interrupt-names = "pm2250_gpio1", "pm2250_gpio2", |
| 168 | "pm2250_gpio3", "pm2250_gpio4", |
| 169 | "pm2250_gpio5", "pm2250_gpio6", |
| 170 | "pm2250_gpio7", "pm2250_gpio8", |
| 171 | "pm2250_gpio9", "pm2250_gpio10"; |
| 172 | |
| 173 | gpio-controller; |
| 174 | #gpio-cells = <2>; |
| 175 | }; |
| 176 | |
| 177 | pm2250_rtc: qcom,pm2250_rtc { |
| 178 | compatible = "qcom,pm8941-rtc"; |
| 179 | interrupts = <0x0 0x61 0x1 IRQ_TYPE_NONE>; |
| 180 | }; |
| 181 | |
| 182 | pm2250_cdc: qcom,pm2250-cdc { |
| 183 | compatible = "qcom,pm2250-spmi"; |
| 184 | }; |
| 185 | |
| 186 | pm2250_qg: qpnp,qg { |
| 187 | compatible = "qcom,qpnp-qg-lite"; |
| 188 | #address-cells = <1>; |
| 189 | #size-cells = <1>; |
| 190 | |
| 191 | qcom,vbatt-cutoff-mv = <3400>; |
| 192 | qcom,vbatt-low-mv = <3500>; |
| 193 | qcom,vbatt-low-cold-mv = <3800>; |
| 194 | qcom,vbatt-empty-mv = <3200>; |
| 195 | qcom,vbatt-empty-cold-mv = <3000>; |
| 196 | qcom,s3-entry-fifo-length = <2>; |
| 197 | |
| 198 | qcom,pmic-revid = <&pm2250_revid>; |
| 199 | io-channels = <&pm2250_vadc ADC_BAT_THERM_PU2>, |
| 200 | <&pm2250_vadc ADC_BAT_ID_PU2>; |
| 201 | io-channel-names = "batt-therm", "batt-id"; |
| 202 | |
| 203 | qcom,qgauge@4800 { |
| 204 | status = "okay"; |
| 205 | reg = <0x4800 0x100>; |
| 206 | interrupts = |
| 207 | <0x0 0x48 0x2 IRQ_TYPE_EDGE_RISING>, |
| 208 | <0x0 0x48 0x3 IRQ_TYPE_EDGE_RISING>, |
| 209 | <0x0 0x48 0x5 IRQ_TYPE_EDGE_RISING>; |
| 210 | interrupt-names = "qg-vbat-empty", |
| 211 | "qg-fifo-done", |
| 212 | "qg-good-ocv"; |
| 213 | }; |
| 214 | |
| 215 | qcom,qg-sdam@b600 { |
| 216 | status = "okay"; |
| 217 | reg = <0xb600 0x100>; |
| 218 | }; |
| 219 | }; |
| 220 | |
| 221 | pm2250_charger: qcom,qpnp-smblite { |
| 222 | compatible = "qcom,qpnp-smblite"; |
| 223 | #address-cells = <1>; |
| 224 | #size-cells = <1>; |
| 225 | #cooling-cells = <2>; |
| 226 | |
| 227 | qcom,pmic-revid = <&pm2250_revid>; |
| 228 | qcom,chgr@1000 { |
| 229 | reg = <0x1000 0x100>; |
| 230 | interrupts = |
| 231 | <0x0 0x10 0x1 IRQ_TYPE_EDGE_RISING>, |
| 232 | <0x0 0x10 0x0 IRQ_TYPE_EDGE_RISING>, |
| 233 | <0x0 0x10 0x4 IRQ_TYPE_EDGE_RISING>, |
| 234 | <0x0 0x10 0x7 IRQ_TYPE_EDGE_RISING>; |
| 235 | |
| 236 | interrupt-names = "chgr-error", |
| 237 | "chg-state-change", |
| 238 | "buck-oc", |
| 239 | "vph-ov"; |
| 240 | }; |
| 241 | |
| 242 | qcom,dcdc@1100 { |
| 243 | reg = <0x1100 0x100>; |
| 244 | interrupts = |
| 245 | <0x0 0x11 0x0 IRQ_TYPE_EDGE_RISING>, |
| 246 | <0x0 0x11 0x1 IRQ_TYPE_EDGE_RISING>, |
| 247 | <0x0 0x11 0x2 IRQ_TYPE_EDGE_RISING>, |
| 248 | <0x0 0x11 0x6 IRQ_TYPE_EDGE_RISING>, |
| 249 | <0x0 0x11 0x7 IRQ_TYPE_EDGE_BOTH>; |
| 250 | |
| 251 | interrupt-names = "otg-fail", |
| 252 | "otg-fault", |
| 253 | "skip-mode", |
| 254 | "input-current-limiting", |
| 255 | "switcher-power-ok"; |
| 256 | }; |
| 257 | |
| 258 | qcom,batif@1200 { |
| 259 | reg = <0x1200 0x100>; |
| 260 | interrupts = |
| 261 | <0x0 0x12 0x0 IRQ_TYPE_EDGE_BOTH>, |
| 262 | <0x0 0x12 0x1 IRQ_TYPE_EDGE_BOTH>, |
| 263 | <0x0 0x12 0x2 IRQ_TYPE_EDGE_BOTH>, |
| 264 | <0x0 0x12 0x3 IRQ_TYPE_EDGE_BOTH>, |
| 265 | <0x0 0x12 0x4 IRQ_TYPE_EDGE_RISING>; |
| 266 | |
| 267 | interrupt-names = "bat-temp", |
| 268 | "bat-therm-or-id-missing", |
| 269 | "bat-low", |
| 270 | "bat-ov", |
| 271 | "bsm-active"; |
| 272 | }; |
| 273 | |
| 274 | qcom,usb@1300 { |
| 275 | reg = <0x1300 0x100>; |
| 276 | interrupts = |
| 277 | <0x0 0x13 0x0 IRQ_TYPE_EDGE_BOTH>, |
| 278 | <0x0 0x13 0x1 IRQ_TYPE_EDGE_BOTH>, |
| 279 | <0x0 0x13 0x2 IRQ_TYPE_EDGE_BOTH>, |
| 280 | <0x0 0x13 0x3 IRQ_TYPE_EDGE_BOTH>, |
| 281 | <0x0 0x13 0x4 IRQ_TYPE_EDGE_RISING>, |
| 282 | <0x0 0x13 0x6 IRQ_TYPE_EDGE_RISING>; |
| 283 | |
| 284 | interrupt-names = "usbin-plugin", |
| 285 | "usbin-collapse", |
| 286 | "usbin-uv", |
| 287 | "usbin-ov", |
| 288 | "usbin-gtvt", |
| 289 | "usbin-icl-change"; |
| 290 | }; |
| 291 | |
| 292 | qcom,typec@1500 { |
| 293 | reg = <0x1500 0x100>; |
| 294 | interrupts = |
| 295 | <0x0 0x15 0x0 IRQ_TYPE_EDGE_BOTH>, |
| 296 | <0x0 0x15 0x1 IRQ_TYPE_EDGE_BOTH>, |
| 297 | <0x0 0x15 0x2 IRQ_TYPE_EDGE_RISING>, |
| 298 | <0x0 0x15 0x4 IRQ_TYPE_EDGE_BOTH>, |
| 299 | <0x0 0x15 0x5 IRQ_TYPE_EDGE_RISING>, |
| 300 | <0x0 0x15 0x6 IRQ_TYPE_EDGE_RISING>, |
| 301 | <0x0 0x15 0x7 IRQ_TYPE_EDGE_RISING>; |
| 302 | |
| 303 | interrupt-names = "typec-or-rid-detect-change", |
| 304 | "typec-vpd-detect", |
| 305 | "typec-cc-state-change", |
| 306 | "typec-vbus-change", |
| 307 | "typec-attach-detach", |
| 308 | "typec-legacy-cable-detect", |
| 309 | "typec-try-snk-src-detect"; |
| 310 | }; |
| 311 | |
| 312 | qcom,misc@1600 { |
| 313 | reg = <0x1600 0x100>; |
| 314 | interrupts = |
| 315 | <0x0 0x16 0x0 IRQ_TYPE_EDGE_RISING>, |
| 316 | <0x0 0x16 0x1 IRQ_TYPE_EDGE_RISING>, |
| 317 | <0x0 0x16 0x2 IRQ_TYPE_EDGE_RISING>, |
| 318 | <0x0 0x16 0x3 IRQ_TYPE_EDGE_RISING>, |
| 319 | <0x0 0x16 0x4 IRQ_TYPE_EDGE_RISING>, |
| 320 | <0x0 0x16 0x5 IRQ_TYPE_EDGE_RISING>, |
| 321 | <0x0 0x16 0x6 IRQ_TYPE_EDGE_BOTH>; |
| 322 | |
| 323 | interrupt-names = "wdog-snarl", |
| 324 | "wdog-bark", |
| 325 | "aicl-fail", |
| 326 | "aicl-done", |
| 327 | "imp-trigger", |
| 328 | "all-chnl-cond-done", |
| 329 | "temp-change"; |
| 330 | }; |
| 331 | |
| 332 | qcom,schgm-flashlite@a600 { |
| 333 | reg = <0xa600 0x100>; |
| 334 | interrupts = |
| 335 | <0x0 0xa6 0x2 IRQ_TYPE_EDGE_RISING>, |
| 336 | <0x0 0xa6 0x5 IRQ_TYPE_EDGE_RISING>, |
| 337 | <0x0 0xa6 0x6 IRQ_TYPE_EDGE_RISING>, |
| 338 | <0x0 0xa6 0x7 IRQ_TYPE_EDGE_BOTH>; |
| 339 | |
| 340 | interrupt-names = "flash-state-change", |
| 341 | "ilim1-s1", |
| 342 | "ilim2-s2", |
| 343 | "vreg-ok"; |
| 344 | }; |
| 345 | }; |
| 346 | }; |
| 347 | |
| 348 | pm2250_1: qcom,pm2250@1 { |
| 349 | compatible = "qcom,spmi-pmic"; |
| 350 | reg = <0x1 SPMI_USID>; |
| 351 | #address-cells = <2>; |
| 352 | #size-cells = <0>; |
| 353 | |
| 354 | pm2250_vib: qcom,vibrator@5600 { |
| 355 | compatible = "qcom,qpnp-vibrator-ldo"; |
| 356 | reg = <0x5600 0x100>; |
| 357 | qcom,vib-ldo-volt-uv = <3000000>; |
| 358 | qcom,disable-overdrive; |
| 359 | }; |
| 360 | |
| 361 | pm2250_pwm1: qcom,pwms@bc00 { |
| 362 | compatible = "qcom,pwm-lpg"; |
| 363 | reg = <0xbc00 0x100>; |
| 364 | reg-names = "lpg-base"; |
| 365 | qcom,num-lpg-channels = <1>; |
| 366 | #pwm-cells = <2>; |
| 367 | }; |
| 368 | |
| 369 | pm2250_pwm2: qcom,pwms@bd00 { |
| 370 | compatible = "qcom,pwm-lpg"; |
| 371 | reg = <0xbd00 0x100>; |
| 372 | reg-names = "lpg-base"; |
| 373 | qcom,num-lpg-channels = <1>; |
| 374 | #pwm-cells = <2>; |
| 375 | }; |
| 376 | |
| 377 | pm2250_pwm3: qcom,pwms@be00 { |
| 378 | compatible = "qcom,pwm-lpg"; |
| 379 | reg = <0xbe00 0x100>; |
| 380 | reg-names = "lpg-base"; |
| 381 | qcom,num-lpg-channels = <1>; |
| 382 | #pwm-cells = <2>; |
| 383 | }; |
| 384 | |
| 385 | pm2250_rg_leds: qcom,rg_leds { |
| 386 | compatible = "pwm-leds"; |
| 387 | |
| 388 | red { |
| 389 | label = "red"; |
| 390 | pwms = <&pm2250_pwm1 0 1000000>; |
| 391 | max-brightness = <255>; |
| 392 | linux,default-trigger = "timer"; |
| 393 | }; |
| 394 | |
| 395 | green { |
| 396 | label = "green"; |
| 397 | pwms = <&pm2250_pwm2 0 1000000>; |
| 398 | max-brightness = <255>; |
| 399 | linux,default-trigger = "timer"; |
| 400 | }; |
| 401 | }; |
| 402 | |
| 403 | pm2250_flash: qcom,flash_led@d300 { |
| 404 | compatible = "qcom,pm2250-flash-led"; |
| 405 | reg = <0xd300>; |
| 406 | interrupts = <0x1 0xd3 0x0 IRQ_TYPE_EDGE_RISING>, |
| 407 | <0x1 0xd3 0x3 IRQ_TYPE_EDGE_RISING>, |
| 408 | <0x1 0xd3 0x4 IRQ_TYPE_EDGE_RISING>; |
| 409 | interrupt-names = "led-fault-irq", |
| 410 | "all-ramp-down-done-irq", |
| 411 | "all-ramp-up-done-irq"; |
| 412 | |
| 413 | pm2250_flash0: qcom,flash_0 { |
| 414 | label = "flash"; |
| 415 | qcom,led-name = "led:flash_0"; |
| 416 | qcom,max-current-ma = <1000>; |
| 417 | qcom,default-led-trigger = "flash0_trigger"; |
| 418 | qcom,id = <0>; |
| 419 | qcom,duration-ms = <1280>; |
| 420 | qcom,ires-ua = <12500>; |
| 421 | }; |
| 422 | |
| 423 | pm2250_torch0: qcom,torch_0 { |
| 424 | label = "torch"; |
| 425 | qcom,led-name = "led:torch_0"; |
| 426 | qcom,max-current-ma = <200>; |
| 427 | qcom,default-led-trigger = "torch0_trigger"; |
| 428 | qcom,id = <0>; |
| 429 | qcom,ires-ua = <12500>; |
| 430 | }; |
| 431 | |
| 432 | pm2250_switch0: qcom,led_switch_0 { |
| 433 | label = "switch"; |
| 434 | qcom,led-name = "led:switch_0"; |
| 435 | qcom,led-mask = <1>; |
| 436 | qcom,default-led-trigger = "switch0_trigger"; |
| 437 | }; |
| 438 | }; |
| 439 | |
| 440 | bcl_soc: bcl-soc { |
| 441 | compatible = "qcom,msm-bcl-soc"; |
| 442 | #thermal-sensor-cells = <0>; |
| 443 | }; |
| 444 | }; |
| 445 | }; |
| 446 | |
| 447 | &thermal_zones { |
| 448 | pm2250-tz { |
| 449 | polling-delay-passive = <100>; |
| 450 | polling-delay = <0>; |
| 451 | thermal-governor = "step_wise"; |
| 452 | thermal-sensors = <&pm2250_tz>; |
| 453 | wake-capable-sensor; |
| 454 | |
| 455 | trips { |
| 456 | pm2250_trip0: trip0 { |
| 457 | temperature = <95000>; |
| 458 | hysteresis = <0>; |
| 459 | type = "passive"; |
| 460 | }; |
| 461 | |
| 462 | pm2250_trip1: trip1 { |
| 463 | temperature = <115000>; |
| 464 | hysteresis = <0>; |
| 465 | type = "passive"; |
| 466 | }; |
| 467 | |
| 468 | trip2 { |
| 469 | temperature = <145000>; |
| 470 | hysteresis = <0>; |
| 471 | type = "passive"; |
| 472 | }; |
| 473 | }; |
| 474 | }; |
| 475 | |
| 476 | soc { |
| 477 | polling-delay-passive = <100>; |
| 478 | polling-delay = <0>; |
| 479 | thermal-governor = "low_limits_cap"; |
| 480 | thermal-sensors = <&bcl_soc>; |
| 481 | wake-capable-sensor; |
| 482 | tracks-low; |
| 483 | |
| 484 | trips { |
| 485 | pm2250_low_soc: low-soc { |
| 486 | temperature = <10>; |
| 487 | hysteresis = <0>; |
| 488 | type = "passive"; |
| 489 | }; |
| 490 | }; |
| 491 | }; |
| 492 | }; |