162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/regulator/rohm,bd71847-regulator.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: ROHM BD71847 and BD71850 Power Management Integrated Circuit regulators
862306a36Sopenharmony_ci
962306a36Sopenharmony_cimaintainers:
1062306a36Sopenharmony_ci  - Matti Vaittinen <mazziesaccount@gmail.com>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cidescription: |
1362306a36Sopenharmony_ci  List of regulators provided by this controller. BD71847 regulators node
1462306a36Sopenharmony_ci  should be sub node of the BD71847 MFD node. See BD71847 MFD bindings at
1562306a36Sopenharmony_ci  Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
1662306a36Sopenharmony_ci  Regulator nodes should be named to BUCK_<number> and LDO_<number>. The
1762306a36Sopenharmony_ci  definition for each of these nodes is defined using the standard
1862306a36Sopenharmony_ci  binding for regulators at
1962306a36Sopenharmony_ci  Documentation/devicetree/bindings/regulator/regulator.txt.
2062306a36Sopenharmony_ci  Note that if BD71847 starts at RUN state you probably want to use
2162306a36Sopenharmony_ci  regulator-boot-on at least for BUCK5. LDO6 is supplied by it and it must
2262306a36Sopenharmony_ci  not be disabled by driver at startup. If BUCK5 is disabled at startup the
2362306a36Sopenharmony_ci  voltage monitoring for LDO5/LDO6 can cause PMIC to reset.
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci# The valid names for BD71847 regulator nodes are:
2662306a36Sopenharmony_ci# BUCK1, BUCK2, BUCK3, BUCK4, BUCK5, BUCK6
2762306a36Sopenharmony_ci# LDO1, LDO2, LDO3, LDO4, LDO5, LDO6
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_cipatternProperties:
3062306a36Sopenharmony_ci  "^LDO[1-6]$":
3162306a36Sopenharmony_ci    type: object
3262306a36Sopenharmony_ci    $ref: regulator.yaml#
3362306a36Sopenharmony_ci    description:
3462306a36Sopenharmony_ci      Properties for single LDO regulator.
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci    properties:
3762306a36Sopenharmony_ci      regulator-name:
3862306a36Sopenharmony_ci        pattern: "^ldo[1-6]$"
3962306a36Sopenharmony_ci        description:
4062306a36Sopenharmony_ci          should be "ldo1", ..., "ldo6"
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci    unevaluatedProperties: false
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci  "^BUCK[1-6]$":
4562306a36Sopenharmony_ci    type: object
4662306a36Sopenharmony_ci    $ref: regulator.yaml#
4762306a36Sopenharmony_ci    description:
4862306a36Sopenharmony_ci      Properties for single BUCK regulator.
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci    properties:
5162306a36Sopenharmony_ci      regulator-name:
5262306a36Sopenharmony_ci        pattern: "^buck[1-6]$"
5362306a36Sopenharmony_ci        description:
5462306a36Sopenharmony_ci          should be "buck1", ..., "buck6"
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci      rohm,dvs-run-voltage:
5762306a36Sopenharmony_ci        $ref: /schemas/types.yaml#/definitions/uint32
5862306a36Sopenharmony_ci        minimum: 0
5962306a36Sopenharmony_ci        maximum: 1300000
6062306a36Sopenharmony_ci        description:
6162306a36Sopenharmony_ci          PMIC default "RUN" state voltage in uV. See below table for
6262306a36Sopenharmony_ci          bucks which support this. 0 means disabled.
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci      rohm,dvs-idle-voltage:
6562306a36Sopenharmony_ci        $ref: /schemas/types.yaml#/definitions/uint32
6662306a36Sopenharmony_ci        minimum: 0
6762306a36Sopenharmony_ci        maximum: 1300000
6862306a36Sopenharmony_ci        description:
6962306a36Sopenharmony_ci          PMIC default "IDLE" state voltage in uV. See below table for
7062306a36Sopenharmony_ci          bucks which support this. 0 means disabled.
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci      rohm,dvs-suspend-voltage:
7362306a36Sopenharmony_ci        $ref: /schemas/types.yaml#/definitions/uint32
7462306a36Sopenharmony_ci        minimum: 0
7562306a36Sopenharmony_ci        maximum: 1300000
7662306a36Sopenharmony_ci        description:
7762306a36Sopenharmony_ci          PMIC default "SUSPEND" state voltage in uV. See below table for
7862306a36Sopenharmony_ci          bucks which support this. 0 means disabled.
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci        # Supported default DVS states:
8162306a36Sopenharmony_ci        #
8262306a36Sopenharmony_ci        # BD71847:
8362306a36Sopenharmony_ci        # buck | dvs-run-voltage | dvs-idle-voltage | dvs-suspend-voltage
8462306a36Sopenharmony_ci        # ----------------------------------------------------------------
8562306a36Sopenharmony_ci        # 1    | supported       | supported        | supported
8662306a36Sopenharmony_ci        # ----------------------------------------------------------------
8762306a36Sopenharmony_ci        # 2    | supported       | supported        | not supported
8862306a36Sopenharmony_ci        # ----------------------------------------------------------------
8962306a36Sopenharmony_ci        # rest | not supported   | not supported    | not supported
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci      # BD718(47/50) power outputs can either be controlled by the PMIC internal
9262306a36Sopenharmony_ci      # hardware state machine or by software. If you need regulators to be
9362306a36Sopenharmony_ci      # turned ON/OFF for example based on PMIC_STBY_REQ line (which toggles
9462306a36Sopenharmony_ci      # PMIC HW state machine) - then you should set this property.
9562306a36Sopenharmony_ci      # Tradeoff is that then SW can't control the ON/OFF state for this
9662306a36Sopenharmony_ci      # regulator (other than invoking a PMIC state change).
9762306a36Sopenharmony_ci      rohm,no-regulator-enable-control:
9862306a36Sopenharmony_ci        description: |
9962306a36Sopenharmony_ci          Enable/Disable control of this regulator must be left to the
10062306a36Sopenharmony_ci          PMIC hardware state machine.
10162306a36Sopenharmony_ci        type: boolean
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci      # Setups where regulator (especially the buck8) output voltage is scaled
10462306a36Sopenharmony_ci      # by adding external connection where some other regulator output is
10562306a36Sopenharmony_ci      # connected to feedback-pin (over suitable resistors) is getting popular
10662306a36Sopenharmony_ci      # amongst users of BD71837. (This allows for example scaling down the
10762306a36Sopenharmony_ci      # buck8 voltages to suit lover GPU voltages for projects where buck8 is
10862306a36Sopenharmony_ci      # (ab)used to supply power for GPU.
10962306a36Sopenharmony_ci      #
11062306a36Sopenharmony_ci      # So we allow describing this external connection from DT and scale the
11162306a36Sopenharmony_ci      # voltages accordingly. This is what the connection should look like:
11262306a36Sopenharmony_ci      #
11362306a36Sopenharmony_ci      # |---------------|
11462306a36Sopenharmony_ci      # |       buck 8  |-------+----->Vout
11562306a36Sopenharmony_ci      # |               |       |
11662306a36Sopenharmony_ci      # |---------------|       |
11762306a36Sopenharmony_ci      #        |                |
11862306a36Sopenharmony_ci      #        |                |
11962306a36Sopenharmony_ci      #        +-------+--R2----+
12062306a36Sopenharmony_ci      #                |
12162306a36Sopenharmony_ci      #                R1
12262306a36Sopenharmony_ci      #                |
12362306a36Sopenharmony_ci      #        V FB-pull-up
12462306a36Sopenharmony_ci      #
12562306a36Sopenharmony_ci      # Here the buck output is sifted according to formula:
12662306a36Sopenharmony_ci      #
12762306a36Sopenharmony_ci      # Vout_o = Vo - (Vpu - Vo)*R2/R1
12862306a36Sopenharmony_ci      # Linear_step = step_orig*(R1+R2)/R1
12962306a36Sopenharmony_ci      #
13062306a36Sopenharmony_ci      # where:
13162306a36Sopenharmony_ci      # Vout_o is adjusted voltage output at vsel reg value 0
13262306a36Sopenharmony_ci      # Vo is original voltage output at vsel reg value 0
13362306a36Sopenharmony_ci      # Vpu is the pull-up voltage V FB-pull-up in the picture
13462306a36Sopenharmony_ci      # R1 and R2 are resistor values.
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ci      rohm,fb-pull-up-microvolt:
13762306a36Sopenharmony_ci        description:
13862306a36Sopenharmony_ci          Feedback-pin has pull-up connection to adjust voltage range. This is
13962306a36Sopenharmony_ci          the used pull-up voltage before R1.
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ci      rohm,feedback-pull-up-r1-ohms:
14262306a36Sopenharmony_ci        description:
14362306a36Sopenharmony_ci          Feedback-pin has pull-up connection to adjust voltage range. This is
14462306a36Sopenharmony_ci          the used R1 resistor.
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_ci      rohm,feedback-pull-up-r2-ohms:
14762306a36Sopenharmony_ci        description:
14862306a36Sopenharmony_ci          Feedback-pin has pull-up connection to adjust voltage range. This is
14962306a36Sopenharmony_ci          the used R2 resistor.
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci    required:
15262306a36Sopenharmony_ci      - regulator-name
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ci    unevaluatedProperties: false
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ciadditionalProperties: false
157