brintos

brintos / linux-shallow public Read only

0
0
Text · 12.4 KiB · 2b266ea Raw
447 lines · yaml
1# SPDX-License-Identifier: GPL-2.0-only2%YAML 1.23---4$id: http://devicetree.org/schemas/regulator/maxim,max8997.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: Maxim MAX8997 Power Management IC8 9maintainers:10  - Krzysztof Kozlowski <krzk@kernel.org>11 12description: |13  The Maxim MAX8997 is a Power Management IC which includes voltage and current14  regulators, charger controller with fuel gauge, RTC, clock outputs, haptic15  motor driver, flash LED driver and Micro-USB Interface Controller.16 17  The binding here is not complete and describes only regulator and charger18  controller parts.19 20properties:21  compatible:22    const: maxim,max8997-pmic23 24  charger-supply:25    description: |26      Regulator node for charging current.27 28  interrupts:29    items:30      - description: irq1 interrupt31      - description: alert interrupt32 33  max8997,pmic-buck1-dvs-voltage:34    $ref: /schemas/types.yaml#/definitions/uint32-array35    minItems: 136    maxItems: 837    description: |38      A set of 8 voltage values in micro-volt (uV) units for buck1 when39      changing voltage using GPIO DVS.40      If none of max8997,pmic-buck[1/2/5]-uses-gpio-dvs optional property is41      specified, the max8997,pmic-buck[1/2/5]-dvs-voltage property should42      specify at least one voltage level (which would be a safe operating43      voltage).44 45  max8997,pmic-buck2-dvs-voltage:46    $ref: /schemas/types.yaml#/definitions/uint32-array47    minItems: 148    maxItems: 849    description: |50      A set of 8 voltage values in micro-volt (uV) units for buck2 when51      changing voltage using GPIO DVS.52      If none of max8997,pmic-buck[1/2/5]-uses-gpio-dvs optional property is53      specified, the max8997,pmic-buck[1/2/5]-dvs-voltage property should54      specify at least one voltage level (which would be a safe operating55      voltage).56 57  max8997,pmic-buck5-dvs-voltage:58    $ref: /schemas/types.yaml#/definitions/uint32-array59    minItems: 160    maxItems: 861    description: |62      A set of 8 voltage values in micro-volt (uV) units for buck5 when63      changing voltage using GPIO DVS.64      If none of max8997,pmic-buck[1/2/5]-uses-gpio-dvs optional property is65      specified, the max8997,pmic-buck[1/2/5]-dvs-voltage property should66      specify at least one voltage level (which would be a safe operating67      voltage).68 69  max8997,pmic-buck1-uses-gpio-dvs:70    type: boolean71    description: |72      buck1 can be controlled by GPIO DVS.73 74  max8997,pmic-buck2-uses-gpio-dvs:75    type: boolean76    description: |77      buck2 can be controlled by GPIO DVS.78 79  max8997,pmic-buck5-uses-gpio-dvs:80    type: boolean81    description: |82      buck5 can be controlled by GPIO DVS.83 84  max8997,pmic-buck125-default-dvs-idx:85    $ref: /schemas/types.yaml#/definitions/uint3286    minimum: 087    maximum: 788    default: 089    description: |90      Default voltage setting selected from the possible 8 options selectable91      by the dvs gpios. The value of this property should be between 0 and 7.92      If not specified or if out of range, the default value of this property93      is set to 0.94 95  max8997,pmic-buck125-dvs-gpios:96    minItems: 397    maxItems: 398    description: |99      GPIO specifiers for three host gpio's used for DVS.100 101  max8997,pmic-ignore-gpiodvs-side-effect:102    type: boolean103    description: |104      When GPIO-DVS mode is used for multiple bucks, changing the voltage value105      of one of the bucks may affect that of another buck, which is the side106      effect of the change (set_voltage).  Use this property to ignore such107      side effects and change the voltage.108 109  reg:110    maxItems: 1111 112  regulators:113    type: object114    additionalProperties: false115    description:116      List of child nodes that specify the regulators.117 118    patternProperties:119      # 1-18 and 21 LDOs120      "^LDO([1-9]|1[0-8]|21)$":121        type: object122        $ref: regulator.yaml#123        description:124          Properties for single LDO regulator.125 126        properties:127          regulator-name: true128 129        required:130          - regulator-name131 132        unevaluatedProperties: false133 134      # 7 bucks135      "^BUCK[1-7]$":136        type: object137        $ref: regulator.yaml#138        description:139          Properties for single BUCK regulator.140 141        properties:142          regulator-name: true143 144        required:145          - regulator-name146 147        unevaluatedProperties: false148 149      "^EN32KHZ_[AC]P$":150        type: object151        $ref: regulator.yaml#152        description:153          32768 Hz clock output (modelled as regulator)154 155        properties:156          regulator-name: true157          regulator-always-on: true158          regulator-boot-on: true159 160        required:161          - regulator-name162 163        additionalProperties: false164 165    properties:166      CHARGER:167        type: object168        $ref: regulator.yaml#169        description: main battery charger current control170 171        properties:172          regulator-name: true173 174        required:175          - regulator-name176 177        unevaluatedProperties: false178 179      CHARGER_CV:180        type: object181        $ref: regulator.yaml#182        description: main battery charger voltage control183 184        properties:185          regulator-name: true186 187        required:188          - regulator-name189 190        unevaluatedProperties: false191 192      CHARGER_TOPOFF:193        type: object194        $ref: regulator.yaml#195        description: end of charge current threshold level196 197        properties:198          regulator-name: true199 200        required:201          - regulator-name202 203        unevaluatedProperties: false204 205      ENVICHG:206        type: object207        $ref: regulator.yaml#208        description: |209          Battery Charging Current Monitor Output. This is a fixed voltage type210          regulator211        properties:212          regulator-name: true213 214        required:215          - regulator-name216 217        unevaluatedProperties: false218 219      ESAFEOUT1:220        type: object221        $ref: regulator.yaml#222        description: LDO19223 224        properties:225          regulator-name: true226 227        required:228          - regulator-name229 230        unevaluatedProperties: false231 232      ESAFEOUT2:233        type: object234        $ref: regulator.yaml#235        description: LDO20236 237        properties:238          regulator-name: true239 240        required:241          - regulator-name242 243        unevaluatedProperties: false244 245required:246  - compatible247  - max8997,pmic-buck1-dvs-voltage248  - max8997,pmic-buck2-dvs-voltage249  - max8997,pmic-buck5-dvs-voltage250  - reg251  - regulators252 253dependencies:254  max8997,pmic-buck1-uses-gpio-dvs: [ 'max8997,pmic-buck125-dvs-gpios' ]255  max8997,pmic-buck2-uses-gpio-dvs: [ 'max8997,pmic-buck125-dvs-gpios' ]256  max8997,pmic-buck5-uses-gpio-dvs: [ 'max8997,pmic-buck125-dvs-gpios' ]257 258additionalProperties: false259 260if:261  anyOf:262    - required:263        - max8997,pmic-buck1-uses-gpio-dvs264    - required:265        - max8997,pmic-buck2-uses-gpio-dvs266    - required:267        - max8997,pmic-buck5-uses-gpio-dvs268then:269  properties:270    max8997,pmic-buck1-dvs-voltage:271      minItems: 8272      maxItems: 8273    max8997,pmic-buck2-dvs-voltage:274      minItems: 8275      maxItems: 8276    max8997,pmic-buck5-dvs-voltage:277      minItems: 8278      maxItems: 8279 280examples:281  - |282    #include <dt-bindings/gpio/gpio.h>283    #include <dt-bindings/interrupt-controller/irq.h>284 285    i2c {286        #address-cells = <1>;287        #size-cells = <0>;288 289        pmic@66 {290            compatible = "maxim,max8997-pmic";291            reg = <0x66>;292 293            interrupts-extended = <&gpx0 7 IRQ_TYPE_LEVEL_LOW>,294                                  <&gpx2 3 IRQ_TYPE_EDGE_FALLING>;295 296            max8997,pmic-buck1-uses-gpio-dvs;297            max8997,pmic-buck2-uses-gpio-dvs;298            max8997,pmic-buck5-uses-gpio-dvs;299 300            max8997,pmic-ignore-gpiodvs-side-effect;301            max8997,pmic-buck125-default-dvs-idx = <0>;302 303            max8997,pmic-buck125-dvs-gpios = <&gpx0 5 GPIO_ACTIVE_HIGH>,304                                             <&gpx0 6 GPIO_ACTIVE_HIGH>,305                                             <&gpl0 0 GPIO_ACTIVE_HIGH>;306 307            max8997,pmic-buck1-dvs-voltage = <1350000>, <1300000>,308                                             <1250000>, <1200000>,309                                             <1150000>, <1100000>,310                                             <1000000>, <950000>;311 312            max8997,pmic-buck2-dvs-voltage = <1100000>, <1000000>,313                                             <950000>,  <900000>,314                                             <1100000>, <1000000>,315                                             <950000>,  <900000>;316 317            max8997,pmic-buck5-dvs-voltage = <1200000>, <1200000>,318                                             <1200000>, <1200000>,319                                             <1200000>, <1200000>,320                                             <1200000>, <1200000>;321 322            pinctrl-0 = <&max8997_irq>, <&otg_gp>, <&usb_sel>;323            pinctrl-names = "default";324 325            charger-supply = <&charger_reg>;326 327            regulators {328                LDO1 {329                    regulator-name = "VADC_3.3V_C210";330                    regulator-min-microvolt = <3300000>;331                    regulator-max-microvolt = <3300000>;332                    regulator-always-on;333                };334 335                LDO2 {336                    regulator-name = "VALIVE_1.1V_C210";337                    regulator-min-microvolt = <1100000>;338                    regulator-max-microvolt = <1100000>;339                    regulator-always-on;340                };341 342                BUCK1 {343                    regulator-name = "VARM_1.2V_C210";344                    regulator-min-microvolt = <65000>;345                    regulator-max-microvolt = <2225000>;346                    regulator-always-on;347                };348 349                // ...350 351                BUCK7 {352                    regulator-name = "VCC_SUB_2.0V";353                    regulator-min-microvolt = <2000000>;354                    regulator-max-microvolt = <2000000>;355                    regulator-always-on;356                };357 358                ESAFEOUT1 {359                    regulator-name = "SAFEOUT1";360                };361 362                ESAFEOUT2 {363                    regulator-name = "SAFEOUT2";364                    regulator-boot-on;365                };366 367                EN32KHZ_AP {368                    regulator-name = "EN32KHZ_AP";369                    regulator-always-on;370                };371 372                EN32KHZ_CP {373                    regulator-name = "EN32KHZ_CP";374                    regulator-always-on;375                };376 377                CHARGER {378                    regulator-name = "CHARGER";379                    regulator-min-microamp = <200000>;380                    regulator-max-microamp = <950000>;381                };382 383                CHARGER_CV {384                    regulator-name = "CHARGER_CV";385                    regulator-min-microvolt = <4200000>;386                    regulator-max-microvolt = <4200000>;387                    regulator-always-on;388                };389 390                CHARGER_TOPOFF {391                    regulator-name = "CHARGER_TOPOFF";392                    regulator-min-microamp = <200000>;393                    regulator-max-microamp = <200000>;394                    regulator-always-on;395                };396            };397        };398    };399 400  - |401    #include <dt-bindings/interrupt-controller/irq.h>402 403    i2c {404        #address-cells = <1>;405        #size-cells = <0>;406 407        pmic@66 {408            compatible = "maxim,max8997-pmic";409            reg = <0x66>;410 411            interrupt-parent = <&gpx0>;412            interrupts = <4 IRQ_TYPE_LEVEL_LOW>,413                         <3 IRQ_TYPE_EDGE_FALLING>;414            pinctrl-names = "default";415            pinctrl-0 = <&max8997_irq>;416 417            max8997,pmic-buck1-dvs-voltage = <1350000>;418            max8997,pmic-buck2-dvs-voltage = <1100000>;419            max8997,pmic-buck5-dvs-voltage = <1200000>;420 421            regulators {422                LDO1 {423                    regulator-name = "VDD_ABB_3.3V";424                    regulator-min-microvolt = <3300000>;425                    regulator-max-microvolt = <3300000>;426                };427 428                // ...429 430                BUCK1 {431                    regulator-name = "VDD_ARM_1.2V";432                    regulator-min-microvolt = <950000>;433                    regulator-max-microvolt = <1350000>;434                    regulator-always-on;435                    regulator-boot-on;436                };437 438                // ...439 440                EN32KHZ_AP {441                    regulator-name = "EN32KHZ_AP";442                    regulator-always-on;443                };444            };445        };446    };447