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