Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame^] | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | %YAML 1.2 |
| 3 | --- |
| 4 | $id: http://devicetree.org/schemas/mfd/x-powers,axp152.yaml# |
| 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | |
| 7 | title: X-Powers AXP PMIC |
| 8 | |
| 9 | maintainers: |
| 10 | - Chen-Yu Tsai <wens@csie.org> |
| 11 | |
| 12 | allOf: |
| 13 | - if: |
| 14 | properties: |
| 15 | compatible: |
| 16 | contains: |
| 17 | enum: |
| 18 | - x-powers,axp152 |
| 19 | - x-powers,axp202 |
| 20 | - x-powers,axp209 |
| 21 | |
| 22 | then: |
| 23 | properties: |
| 24 | regulators: |
| 25 | properties: |
| 26 | x-powers,dcdc-freq: |
| 27 | minimum: 750 |
| 28 | maximum: 1875 |
| 29 | default: 1500 |
| 30 | |
| 31 | else: |
| 32 | properties: |
| 33 | regulators: |
| 34 | properties: |
| 35 | x-powers,dcdc-freq: |
| 36 | minimum: 1800 |
| 37 | maximum: 4050 |
| 38 | default: 3000 |
| 39 | |
| 40 | - if: |
| 41 | properties: |
| 42 | compatible: |
| 43 | contains: |
| 44 | enum: |
| 45 | - x-powers,axp152 |
| 46 | - x-powers,axp202 |
| 47 | - x-powers,axp209 |
| 48 | |
| 49 | then: |
| 50 | properties: |
| 51 | x-powers,drive-vbus-en: false |
| 52 | |
| 53 | - if: |
| 54 | not: |
| 55 | properties: |
| 56 | compatible: |
| 57 | contains: |
| 58 | const: x-powers,axp806 |
| 59 | |
| 60 | then: |
| 61 | properties: |
| 62 | x-powers,self-working-mode: false |
| 63 | x-powers,master-mode: false |
| 64 | |
| 65 | - if: |
| 66 | not: |
| 67 | properties: |
| 68 | compatible: |
| 69 | contains: |
| 70 | enum: |
| 71 | - x-powers,axp15060 |
| 72 | - x-powers,axp305 |
| 73 | - x-powers,axp313a |
| 74 | |
| 75 | then: |
| 76 | required: |
| 77 | - interrupts |
| 78 | |
| 79 | - if: |
| 80 | properties: |
| 81 | compatible: |
| 82 | contains: |
| 83 | enum: |
| 84 | - x-powers,axp313a |
| 85 | - x-powers,axp15060 |
| 86 | |
| 87 | then: |
| 88 | properties: |
| 89 | x-powers,dcdc-freq: false |
| 90 | |
| 91 | properties: |
| 92 | compatible: |
| 93 | oneOf: |
| 94 | - enum: |
| 95 | - x-powers,axp152 |
| 96 | - x-powers,axp192 |
| 97 | - x-powers,axp202 |
| 98 | - x-powers,axp209 |
| 99 | - x-powers,axp221 |
| 100 | - x-powers,axp223 |
| 101 | - x-powers,axp313a |
| 102 | - x-powers,axp803 |
| 103 | - x-powers,axp806 |
| 104 | - x-powers,axp809 |
| 105 | - x-powers,axp813 |
| 106 | - x-powers,axp15060 |
| 107 | - items: |
| 108 | - const: x-powers,axp228 |
| 109 | - const: x-powers,axp221 |
| 110 | - items: |
| 111 | - const: x-powers,axp805 |
| 112 | - const: x-powers,axp806 |
| 113 | - items: |
| 114 | - const: x-powers,axp305 |
| 115 | - const: x-powers,axp805 |
| 116 | - const: x-powers,axp806 |
| 117 | - items: |
| 118 | - const: x-powers,axp818 |
| 119 | - const: x-powers,axp813 |
| 120 | |
| 121 | reg: |
| 122 | maxItems: 1 |
| 123 | |
| 124 | interrupts: |
| 125 | maxItems: 1 |
| 126 | |
| 127 | interrupt-controller: true |
| 128 | |
| 129 | "#interrupt-cells": |
| 130 | const: 1 |
| 131 | |
| 132 | x-powers,drive-vbus-en: |
| 133 | type: boolean |
| 134 | description: > |
| 135 | Set this when the N_VBUSEN pin is used as an output pin to control an |
| 136 | external regulator to drive the OTG VBus, rather then as an input pin |
| 137 | which signals whether the board is driving OTG VBus or not. |
| 138 | |
| 139 | x-powers,self-working-mode: |
| 140 | type: boolean |
| 141 | description: > |
| 142 | Set this when the PMIC is wired for self-working mode through the MODESET |
| 143 | pin. |
| 144 | |
| 145 | x-powers,master-mode: |
| 146 | type: boolean |
| 147 | description: > |
| 148 | Set this when the PMIC is wired for master mode through the MODESET pin. |
| 149 | |
| 150 | vin1-supply: |
| 151 | description: > |
| 152 | DCDC1 power supply node, if present. |
| 153 | |
| 154 | vin2-supply: |
| 155 | description: > |
| 156 | DCDC2 power supply node, if present. |
| 157 | |
| 158 | vin3-supply: |
| 159 | description: > |
| 160 | DCDC3 power supply node, if present. |
| 161 | |
| 162 | vin4-supply: |
| 163 | description: > |
| 164 | DCDC4 power supply node, if present. |
| 165 | |
| 166 | vin5-supply: |
| 167 | description: > |
| 168 | DCDC5 power supply node, if present. |
| 169 | |
| 170 | vin6-supply: |
| 171 | description: > |
| 172 | DCDC6 power supply node, if present. |
| 173 | |
| 174 | vin7-supply: |
| 175 | description: > |
| 176 | DCDC7 power supply node, if present. |
| 177 | |
| 178 | vina-supply: |
| 179 | description: > |
| 180 | DCDCA power supply node, if present. |
| 181 | |
| 182 | vinb-supply: |
| 183 | description: > |
| 184 | DCDCB power supply node, if present. |
| 185 | |
| 186 | vinc-supply: |
| 187 | description: > |
| 188 | DCDCC power supply node, if present. |
| 189 | |
| 190 | vind-supply: |
| 191 | description: > |
| 192 | DCDCD power supply node, if present. |
| 193 | |
| 194 | vine-supply: |
| 195 | description: > |
| 196 | DCDCE power supply node, if present. |
| 197 | |
| 198 | acin-supply: |
| 199 | description: > |
| 200 | LDO1 power supply node, if present. |
| 201 | |
| 202 | ldo24in-supply: |
| 203 | description: > |
| 204 | LDO2 and LDO4 power supply node, if present. |
| 205 | |
| 206 | ldo3in-supply: |
| 207 | description: > |
| 208 | LDO3 power supply node, if present. |
| 209 | |
| 210 | ldo5in-supply: |
| 211 | description: > |
| 212 | LDO5 power supply node, if present. |
| 213 | |
| 214 | aldoin-supply: |
| 215 | description: > |
| 216 | ALDO* power supply node, if present. |
| 217 | |
| 218 | bldoin-supply: |
| 219 | description: > |
| 220 | BLDO* power supply node, if present. |
| 221 | |
| 222 | cldoin-supply: |
| 223 | description: > |
| 224 | CLDO* power supply node, if present. |
| 225 | |
| 226 | dldoin-supply: |
| 227 | description: > |
| 228 | DLDO* power supply node, if present. |
| 229 | |
| 230 | eldoin-supply: |
| 231 | description: > |
| 232 | ELDO* power supply node, if present. |
| 233 | |
| 234 | fldoin-supply: |
| 235 | description: > |
| 236 | FLDO* power supply node, if present. |
| 237 | |
| 238 | ips-supply: |
| 239 | description: > |
| 240 | LDO_IO0, LDO_IO1 and RTC_LDO power supply node, if present. |
| 241 | |
| 242 | drivevbus-supply: |
| 243 | description: > |
| 244 | DRIVEVBUS power supply node, if present. |
| 245 | |
| 246 | swin-supply: |
| 247 | description: > |
| 248 | SW power supply node, if present. |
| 249 | |
| 250 | adc: |
| 251 | $ref: /schemas/iio/adc/x-powers,axp209-adc.yaml# |
| 252 | |
| 253 | gpio: |
| 254 | $ref: /schemas/gpio/x-powers,axp209-gpio.yaml# |
| 255 | |
| 256 | ac-power: |
| 257 | $ref: /schemas/power/supply/x-powers,axp20x-ac-power-supply.yaml# |
| 258 | |
| 259 | battery-power: |
| 260 | $ref: /schemas/power/supply/x-powers,axp20x-battery-power-supply.yaml# |
| 261 | |
| 262 | usb-power: |
| 263 | $ref: /schemas/power/supply/x-powers,axp20x-usb-power-supply.yaml# |
| 264 | |
| 265 | regulators: |
| 266 | type: object |
| 267 | |
| 268 | properties: |
| 269 | x-powers,dcdc-freq: |
| 270 | $ref: /schemas/types.yaml#/definitions/uint32 |
| 271 | description: > |
| 272 | Defines the work frequency of DC-DC in kHz. |
| 273 | |
| 274 | patternProperties: |
| 275 | "^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|(dc1)?sw|rtc(_|-)ldo|cpusldo|drivevbus|dc5ldo)$": |
| 276 | $ref: /schemas/regulator/regulator.yaml# |
| 277 | type: object |
| 278 | unevaluatedProperties: false |
| 279 | |
| 280 | properties: |
| 281 | regulator-ramp-delay: |
| 282 | description: > |
| 283 | Only 800 and 1600 are valid for the DCDC2 and LDO3 regulators on |
| 284 | the AXP209. |
| 285 | |
| 286 | regulator-soft-start: |
| 287 | description: > |
| 288 | Only valid for the LDO3 regulator. |
| 289 | |
| 290 | x-powers,dcdc-workmode: |
| 291 | $ref: /schemas/types.yaml#/definitions/uint32 |
| 292 | enum: [0, 1] |
| 293 | description: > |
| 294 | Only valid for DCDC regulators. Setup 1 for PWM mode, 0 |
| 295 | for AUTO (PWM/PFM) mode. The DCDC regulators work in a |
| 296 | mixed PWM/PFM mode, using PFM under light loads and |
| 297 | switching to PWM for heavier loads. Forcing PWM mode |
| 298 | trades efficiency under light loads for lower output |
| 299 | noise. This probably makes sense for HiFi audio related |
| 300 | applications that aren't battery constrained. |
| 301 | |
| 302 | additionalProperties: false |
| 303 | |
| 304 | required: |
| 305 | - compatible |
| 306 | - reg |
| 307 | - "#interrupt-cells" |
| 308 | - interrupt-controller |
| 309 | |
| 310 | additionalProperties: false |
| 311 | |
| 312 | examples: |
| 313 | - | |
| 314 | i2c { |
| 315 | #address-cells = <1>; |
| 316 | #size-cells = <0>; |
| 317 | |
| 318 | pmic@30 { |
| 319 | compatible = "x-powers,axp152"; |
| 320 | reg = <0x30>; |
| 321 | interrupts = <0>; |
| 322 | interrupt-controller; |
| 323 | #interrupt-cells = <1>; |
| 324 | }; |
| 325 | }; |
| 326 | |
| 327 | - | |
| 328 | #include <dt-bindings/interrupt-controller/irq.h> |
| 329 | |
| 330 | i2c { |
| 331 | #address-cells = <1>; |
| 332 | #size-cells = <0>; |
| 333 | |
| 334 | pmic@34 { |
| 335 | compatible = "x-powers,axp209"; |
| 336 | reg = <0x34>; |
| 337 | interrupt-parent = <&nmi_intc>; |
| 338 | interrupts = <0 IRQ_TYPE_LEVEL_LOW>; |
| 339 | interrupt-controller; |
| 340 | #interrupt-cells = <1>; |
| 341 | |
| 342 | ac_power_supply: ac-power { |
| 343 | compatible = "x-powers,axp202-ac-power-supply"; |
| 344 | }; |
| 345 | |
| 346 | axp_adc: adc { |
| 347 | compatible = "x-powers,axp209-adc"; |
| 348 | #io-channel-cells = <1>; |
| 349 | }; |
| 350 | |
| 351 | axp_gpio: gpio { |
| 352 | compatible = "x-powers,axp209-gpio"; |
| 353 | gpio-controller; |
| 354 | #gpio-cells = <2>; |
| 355 | |
| 356 | gpio0-adc-pin { |
| 357 | pins = "GPIO0"; |
| 358 | function = "adc"; |
| 359 | }; |
| 360 | }; |
| 361 | |
| 362 | battery_power_supply: battery-power { |
| 363 | compatible = "x-powers,axp209-battery-power-supply"; |
| 364 | }; |
| 365 | |
| 366 | regulators { |
| 367 | /* Default work frequency for buck regulators */ |
| 368 | x-powers,dcdc-freq = <1500>; |
| 369 | |
| 370 | reg_dcdc2: dcdc2 { |
| 371 | regulator-always-on; |
| 372 | regulator-min-microvolt = <1000000>; |
| 373 | regulator-max-microvolt = <1450000>; |
| 374 | regulator-name = "vdd-cpu"; |
| 375 | }; |
| 376 | |
| 377 | reg_dcdc3: dcdc3 { |
| 378 | regulator-always-on; |
| 379 | regulator-min-microvolt = <1000000>; |
| 380 | regulator-max-microvolt = <1400000>; |
| 381 | regulator-name = "vdd-int-dll"; |
| 382 | }; |
| 383 | |
| 384 | reg_ldo1: ldo1 { |
| 385 | /* LDO1 is a fixed output regulator */ |
| 386 | regulator-always-on; |
| 387 | regulator-min-microvolt = <1300000>; |
| 388 | regulator-max-microvolt = <1300000>; |
| 389 | regulator-name = "vdd-rtc"; |
| 390 | }; |
| 391 | |
| 392 | reg_ldo2: ldo2 { |
| 393 | regulator-always-on; |
| 394 | regulator-min-microvolt = <3000000>; |
| 395 | regulator-max-microvolt = <3000000>; |
| 396 | regulator-name = "avcc"; |
| 397 | }; |
| 398 | |
| 399 | reg_ldo3: ldo3 { |
| 400 | regulator-name = "ldo3"; |
| 401 | }; |
| 402 | |
| 403 | reg_ldo4: ldo4 { |
| 404 | regulator-name = "ldo4"; |
| 405 | }; |
| 406 | |
| 407 | reg_ldo5: ldo5 { |
| 408 | regulator-name = "ldo5"; |
| 409 | }; |
| 410 | }; |
| 411 | |
| 412 | usb_power_supply: usb-power { |
| 413 | compatible = "x-powers,axp202-usb-power-supply"; |
| 414 | }; |
| 415 | }; |
| 416 | }; |