Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/mfd/x-powers,axp152.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: X-Powers AXP PMIC Device Tree Bindings
0008 
0009 maintainers:
0010   - Chen-Yu Tsai <wens@csie.org>
0011 
0012 allOf:
0013   - if:
0014       properties:
0015         compatible:
0016           contains:
0017             enum:
0018               - x-powers,axp152
0019               - x-powers,axp202
0020               - x-powers,axp209
0021 
0022     then:
0023       properties:
0024         regulators:
0025           properties:
0026             x-powers,dcdc-freq:
0027               minimum: 750
0028               maximum: 1875
0029               default: 1500
0030 
0031     else:
0032       properties:
0033         regulators:
0034           properties:
0035             x-powers,dcdc-freq:
0036               minimum: 1800
0037               maximum: 4050
0038               default: 3000
0039 
0040   - if:
0041       properties:
0042         compatible:
0043           contains:
0044             enum:
0045               - x-powers,axp152
0046               - x-powers,axp202
0047               - x-powers,axp209
0048 
0049     then:
0050       not:
0051         required:
0052           - x-powers,drive-vbus-en
0053 
0054   - if:
0055       not:
0056         properties:
0057           compatible:
0058             contains:
0059               const: x-powers,axp806
0060 
0061     then:
0062       allOf:
0063         - not:
0064             required:
0065               - x-powers,self-working-mode
0066 
0067         - not:
0068             required:
0069               - x-powers,master-mode
0070 
0071   - if:
0072       not:
0073         properties:
0074           compatible:
0075             contains:
0076               const: x-powers,axp305
0077 
0078     then:
0079       required:
0080         - interrupts
0081 
0082 properties:
0083   compatible:
0084     oneOf:
0085       - enum:
0086           - x-powers,axp152
0087           - x-powers,axp202
0088           - x-powers,axp209
0089           - x-powers,axp221
0090           - x-powers,axp223
0091           - x-powers,axp803
0092           - x-powers,axp806
0093           - x-powers,axp809
0094           - x-powers,axp813
0095       - items:
0096           - const: x-powers,axp805
0097           - const: x-powers,axp806
0098       - items:
0099           - const: x-powers,axp305
0100           - const: x-powers,axp805
0101           - const: x-powers,axp806
0102       - items:
0103           - const: x-powers,axp818
0104           - const: x-powers,axp813
0105 
0106   reg:
0107     maxItems: 1
0108 
0109   interrupts:
0110     maxItems: 1
0111 
0112   interrupt-controller: true
0113 
0114   "#interrupt-cells":
0115     const: 1
0116 
0117   x-powers,drive-vbus-en:
0118     type: boolean
0119     description: >
0120       Set this when the N_VBUSEN pin is used as an output pin to control an
0121       external regulator to drive the OTG VBus, rather then as an input pin
0122       which signals whether the board is driving OTG VBus or not.
0123 
0124   x-powers,self-working-mode:
0125     type: boolean
0126     description: >
0127       Set this when the PMIC is wired for self-working mode through the MODESET
0128       pin.
0129 
0130   x-powers,master-mode:
0131     type: boolean
0132     description: >
0133       Set this when the PMIC is wired for master mode through the MODESET pin.
0134 
0135   vin1-supply:
0136     description: >
0137       DCDC1 power supply node, if present.
0138 
0139   vin2-supply:
0140     description: >
0141       DCDC2 power supply node, if present.
0142 
0143   vin3-supply:
0144     description: >
0145       DCDC3 power supply node, if present.
0146 
0147   vin4-supply:
0148     description: >
0149       DCDC4 power supply node, if present.
0150 
0151   vin5-supply:
0152     description: >
0153       DCDC5 power supply node, if present.
0154 
0155   vin6-supply:
0156     description: >
0157       DCDC6 power supply node, if present.
0158 
0159   vin7-supply:
0160     description: >
0161       DCDC7 power supply node, if present.
0162 
0163   vina-supply:
0164     description: >
0165       DCDCA power supply node, if present.
0166 
0167   vinb-supply:
0168     description: >
0169       DCDCB power supply node, if present.
0170 
0171   vinc-supply:
0172     description: >
0173       DCDCC power supply node, if present.
0174 
0175   vind-supply:
0176     description: >
0177       DCDCD power supply node, if present.
0178 
0179   vine-supply:
0180     description: >
0181       DCDCE power supply node, if present.
0182 
0183   acin-supply:
0184     description: >
0185       LDO1 power supply node, if present.
0186 
0187   ldo24in-supply:
0188     description: >
0189       LDO2 and LDO4 power supply node, if present.
0190 
0191   ldo3in-supply:
0192     description: >
0193       LDO3 power supply node, if present.
0194 
0195   ldo5in-supply:
0196     description: >
0197       LDO5 power supply node, if present.
0198 
0199   aldoin-supply:
0200     description: >
0201       ALDO* power supply node, if present.
0202 
0203   bldoin-supply:
0204     description: >
0205       BLDO* power supply node, if present.
0206 
0207   cldoin-supply:
0208     description: >
0209       CLDO* power supply node, if present.
0210 
0211   dldoin-supply:
0212     description: >
0213       DLDO* power supply node, if present.
0214 
0215   eldoin-supply:
0216     description: >
0217       ELDO* power supply node, if present.
0218 
0219   fldoin-supply:
0220     description: >
0221       FLDO* power supply node, if present.
0222 
0223   ips-supply:
0224     description: >
0225       LDO_IO0, LDO_IO1 and RTC_LDO power supply node, if present.
0226 
0227   drivevbus-supply:
0228     description: >
0229       DRIVEVBUS power supply node, if present.
0230 
0231   swin-supply:
0232     description: >
0233       SW power supply node, if present.
0234 
0235   adc:
0236     $ref: /schemas/iio/adc/x-powers,axp209-adc.yaml#
0237 
0238   gpio:
0239     $ref: /schemas/gpio/x-powers,axp209-gpio.yaml#
0240 
0241   ac-power:
0242     $ref: /schemas/power/supply/x-powers,axp20x-ac-power-supply.yaml#
0243 
0244   battery-power:
0245     $ref: /schemas/power/supply/x-powers,axp20x-battery-power-supply.yaml#
0246 
0247   usb-power:
0248     $ref: /schemas/power/supply/x-powers,axp20x-usb-power-supply.yaml#
0249 
0250   regulators:
0251     type: object
0252 
0253     properties:
0254       x-powers,dcdc-freq:
0255         $ref: /schemas/types.yaml#/definitions/uint32
0256         description: >
0257           Defines the work frequency of DC-DC in kHz.
0258 
0259     patternProperties:
0260       "^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|(dc1)?sw|rtc(_|-)ldo|drivevbus|dc5ldo)$":
0261         $ref: /schemas/regulator/regulator.yaml#
0262         type: object
0263 
0264         properties:
0265           regulator-ramp-delay:
0266             description: >
0267               Only 800 and 1600 are valid for the DCDC2 and LDO3 regulators on
0268               the AXP209.
0269 
0270           regulator-soft-start:
0271             description: >
0272               Only valid for the LDO3 regulator.
0273 
0274           x-powers,dcdc-workmode:
0275             $ref: /schemas/types.yaml#/definitions/uint32
0276             enum: [0, 1]
0277             description: >
0278               Only valid for DCDC regulators. Setup 1 for PWM mode, 0
0279               for AUTO (PWM/PFM) mode. The DCDC regulators work in a
0280               mixed PWM/PFM mode, using PFM under light loads and
0281               switching to PWM for heavier loads. Forcing PWM mode
0282               trades efficiency under light loads for lower output
0283               noise. This probably makes sense for HiFi audio related
0284               applications that aren't battery constrained.
0285 
0286     additionalProperties: false
0287 
0288 required:
0289   - compatible
0290   - reg
0291   - "#interrupt-cells"
0292   - interrupt-controller
0293 
0294 additionalProperties: false
0295 
0296 examples:
0297   - |
0298       i2c0 {
0299           #address-cells = <1>;
0300           #size-cells = <0>;
0301 
0302           pmic@30 {
0303               compatible = "x-powers,axp152";
0304               reg = <0x30>;
0305               interrupts = <0>;
0306               interrupt-controller;
0307               #interrupt-cells = <1>;
0308           };
0309       };
0310 
0311   - |
0312       #include <dt-bindings/interrupt-controller/irq.h>
0313 
0314       i2c0 {
0315           #address-cells = <1>;
0316           #size-cells = <0>;
0317 
0318           pmic@34 {
0319               compatible = "x-powers,axp209";
0320               reg = <0x34>;
0321               interrupt-parent = <&nmi_intc>;
0322               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
0323               interrupt-controller;
0324               #interrupt-cells = <1>;
0325 
0326               ac_power_supply: ac-power {
0327                   compatible = "x-powers,axp202-ac-power-supply";
0328               };
0329 
0330               axp_adc: adc {
0331                   compatible = "x-powers,axp209-adc";
0332                   #io-channel-cells = <1>;
0333               };
0334 
0335               axp_gpio: gpio {
0336                   compatible = "x-powers,axp209-gpio";
0337                   gpio-controller;
0338                   #gpio-cells = <2>;
0339 
0340                   gpio0-adc-pin {
0341                       pins = "GPIO0";
0342                       function = "adc";
0343                   };
0344               };
0345 
0346               battery_power_supply: battery-power {
0347                   compatible = "x-powers,axp209-battery-power-supply";
0348               };
0349 
0350               regulators {
0351                   /* Default work frequency for buck regulators */
0352                   x-powers,dcdc-freq = <1500>;
0353 
0354                   reg_dcdc2: dcdc2 {
0355                       regulator-always-on;
0356                       regulator-min-microvolt = <1000000>;
0357                       regulator-max-microvolt = <1450000>;
0358                       regulator-name = "vdd-cpu";
0359                   };
0360 
0361                   reg_dcdc3: dcdc3 {
0362                       regulator-always-on;
0363                       regulator-min-microvolt = <1000000>;
0364                       regulator-max-microvolt = <1400000>;
0365                       regulator-name = "vdd-int-dll";
0366                   };
0367 
0368                   reg_ldo1: ldo1 {
0369                       /* LDO1 is a fixed output regulator */
0370                       regulator-always-on;
0371                       regulator-min-microvolt = <1300000>;
0372                       regulator-max-microvolt = <1300000>;
0373                       regulator-name = "vdd-rtc";
0374                   };
0375 
0376                   reg_ldo2: ldo2 {
0377                       regulator-always-on;
0378                       regulator-min-microvolt = <3000000>;
0379                       regulator-max-microvolt = <3000000>;
0380                       regulator-name = "avcc";
0381                   };
0382 
0383                   reg_ldo3: ldo3 {
0384                       regulator-name = "ldo3";
0385                   };
0386 
0387                   reg_ldo4: ldo4 {
0388                       regulator-name = "ldo4";
0389                   };
0390 
0391                   reg_ldo5: ldo5 {
0392                       regulator-name = "ldo5";
0393                   };
0394               };
0395 
0396               usb_power_supply: usb-power {
0397                   compatible = "x-powers,axp202-usb-power-supply";
0398               };
0399           };
0400       };