# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/rohm,bd72720-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ROHM BD72720 Power Management Integrated Circuit regulators

maintainers:
  - Matti Vaittinen <mazziesaccount@gmail.com>

description: |
  This module is part of the ROHM BD72720 MFD device. For more details
  see Documentation/devicetree/bindings/mfd/rohm,bd72720-pmic.yaml.

  The regulator controller is represented as a sub-node of the PMIC node
  on the device tree.

  Regulator nodes should be named to BUCK_<number> and LDO_<number>.
  The valid names for BD72720 regulator nodes are
  buck1, buck2, buck3, buck4, buck5, buck6, buck7, buck8, buck9, buck10
  ldo1, ldo2, ldo3, ldo4, ldo5, ldo6, ldo7, ldo8, ldo9, ldo10, ldo11

patternProperties:
  "^ldo([1-9]|1[0-1])$":
    type: object
    description:
      Properties for single LDO regulator.
    allOf:
      - $ref: regulator.yaml#
      - $ref: rohm,pmic-states.yaml#

    properties:
      regulator-name:
        pattern: "^ldo([1-9]|1[0-1])$"

      rohm,dvs-run-voltage:
        minimum: 0
        maximum: 3300000

      rohm,dvs-idle-voltage:
        minimum: 0
        maximum: 3300000

      rohm,dvs-suspend-voltage:
        minimum: 0
        maximum: 3300000

      rohm,dvs-lpsr-voltage:
        minimum: 0
        maximum: 3300000

        # Supported default DVS states:
        #     ldo        |    run     |   idle    | suspend   | lpsr
        # --------------------------------------------------------------
        # 1, 2, 3, and 4 | supported  | supported | supported | supported
        # --------------------------------------------------------------
        # 5 - 11         |                    supported (*)
        # --------------------------------------------------------------
        #
        # (*) All states use same voltage but have own enable / disable
        #      settings. Voltage 0 can be specified for a state to make
        #      regulator disabled on that state.

    unevaluatedProperties: false

  "^buck([1-9]|10)$":
    type: object
    description:
      Properties for single BUCK regulator.
    allOf:
      - $ref: regulator.yaml#
      - $ref: rohm,pmic-states.yaml#

    properties:
      regulator-name:
        pattern: "^buck([1-9]|10)$"

      rohm,ldon-head-microvolt:
        description:
          Set this on boards where BUCK10 is used to supply LDOs 1-4. The bucki
          voltage will be changed by the PMIC to follow the LDO output voltages
          with the offset voltage given here. This will improve the LDO efficiency.
        minimum: 50000
        maximum: 300000

      rohm,dvs-run-voltage:
        minimum: 0
        maximum: 3300000

      rohm,dvs-idle-voltage:
        minimum: 0
        maximum: 3300000

      rohm,dvs-suspend-voltage:
        minimum: 0
        maximum: 3300000

      rohm,dvs-lpsr-voltage:
        minimum: 0
        maximum: 3300000

        # Supported default DVS states:
        #     buck       |    run     |   idle    | suspend   | lpsr
        # --------------------------------------------------------------
        # 1, 2, 3, and 4 | supported  | supported | supported | supported
        # --------------------------------------------------------------
        # 5 - 10    |                    supported (*)
        # --------------------------------------------------------------
        #
        # (*) All states use same voltage but have own enable / disable
        #      settings. Voltage 0 can be specified for a state to make
        #      regulator disabled on that state.

    required:
      - regulator-name

    unevaluatedProperties: false

additionalProperties: false