18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/regulator/regulator.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: Voltage/Current Regulators
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Liam Girdwood <lgirdwood@gmail.com>
118c2ecf20Sopenharmony_ci  - Mark Brown <broonie@kernel.org>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciproperties:
148c2ecf20Sopenharmony_ci  regulator-name:
158c2ecf20Sopenharmony_ci    description: A string used as a descriptive name for regulator outputs
168c2ecf20Sopenharmony_ci    $ref: "/schemas/types.yaml#/definitions/string"
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci  regulator-min-microvolt:
198c2ecf20Sopenharmony_ci    description: smallest voltage consumers may set
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci  regulator-max-microvolt:
228c2ecf20Sopenharmony_ci    description: largest voltage consumers may set
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci  regulator-microvolt-offset:
258c2ecf20Sopenharmony_ci    description: Offset applied to voltages to compensate for voltage drops
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci  regulator-min-microamp:
288c2ecf20Sopenharmony_ci    description: smallest current consumers may set
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci  regulator-max-microamp:
318c2ecf20Sopenharmony_ci    description: largest current consumers may set
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci  regulator-input-current-limit-microamp:
348c2ecf20Sopenharmony_ci    description: maximum input current regulator allows
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci  regulator-always-on:
378c2ecf20Sopenharmony_ci    description: boolean, regulator should never be disabled
388c2ecf20Sopenharmony_ci    type: boolean
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci  regulator-boot-on:
418c2ecf20Sopenharmony_ci    description: bootloader/firmware enabled regulator.
428c2ecf20Sopenharmony_ci      It's expected that this regulator was left on by the bootloader.
438c2ecf20Sopenharmony_ci      If the bootloader didn't leave it on then OS should turn it on
448c2ecf20Sopenharmony_ci      at boot but shouldn't prevent it from being turned off later.
458c2ecf20Sopenharmony_ci      This property is intended to only be used for regulators where
468c2ecf20Sopenharmony_ci      software cannot read the state of the regulator.
478c2ecf20Sopenharmony_ci    type: boolean
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci  regulator-allow-bypass:
508c2ecf20Sopenharmony_ci    description: allow the regulator to go into bypass mode
518c2ecf20Sopenharmony_ci    type: boolean
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci  regulator-allow-set-load:
548c2ecf20Sopenharmony_ci    description: allow the regulator performance level to be configured
558c2ecf20Sopenharmony_ci    type: boolean
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci  regulator-ramp-delay:
588c2ecf20Sopenharmony_ci    description: ramp delay for regulator(in uV/us) For hardware which supports
598c2ecf20Sopenharmony_ci      disabling ramp rate, it should be explicitly initialised to zero (regulator-ramp-delay
608c2ecf20Sopenharmony_ci      = <0>) for disabling ramp delay.
618c2ecf20Sopenharmony_ci    $ref: "/schemas/types.yaml#/definitions/uint32"
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci  regulator-enable-ramp-delay:
648c2ecf20Sopenharmony_ci    description: The time taken, in microseconds, for the supply rail to
658c2ecf20Sopenharmony_ci      reach the target voltage, plus/minus whatever tolerance the board
668c2ecf20Sopenharmony_ci      design requires. This property describes the total system ramp time
678c2ecf20Sopenharmony_ci      required due to the combination of internal ramping of the regulator
688c2ecf20Sopenharmony_ci      itself, and board design issues such as trace capacitance and load
698c2ecf20Sopenharmony_ci      on the supply.
708c2ecf20Sopenharmony_ci    $ref: "/schemas/types.yaml#/definitions/uint32"
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci  regulator-settling-time-us:
738c2ecf20Sopenharmony_ci    description: Settling time, in microseconds, for voltage change if regulator
748c2ecf20Sopenharmony_ci      have the constant time for any level voltage change. This is useful
758c2ecf20Sopenharmony_ci      when regulator have exponential voltage change.
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci  regulator-settling-time-up-us:
788c2ecf20Sopenharmony_ci    description: Settling time, in microseconds, for voltage increase if
798c2ecf20Sopenharmony_ci      the regulator needs a constant time to settle after voltage increases
808c2ecf20Sopenharmony_ci      of any level. This is useful for regulators with exponential voltage
818c2ecf20Sopenharmony_ci      changes.
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci  regulator-settling-time-down-us:
848c2ecf20Sopenharmony_ci    description: Settling time, in microseconds, for voltage decrease if
858c2ecf20Sopenharmony_ci      the regulator needs a constant time to settle after voltage decreases
868c2ecf20Sopenharmony_ci      of any level. This is useful for regulators with exponential voltage
878c2ecf20Sopenharmony_ci      changes.
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci  regulator-soft-start:
908c2ecf20Sopenharmony_ci    description: Enable soft start so that voltage ramps slowly
918c2ecf20Sopenharmony_ci    type: boolean
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci  regulator-initial-mode:
948c2ecf20Sopenharmony_ci    description: initial operating mode. The set of possible operating modes
958c2ecf20Sopenharmony_ci      depends on the capabilities of every hardware so each device binding
968c2ecf20Sopenharmony_ci      documentation explains which values the regulator supports.
978c2ecf20Sopenharmony_ci    $ref: "/schemas/types.yaml#/definitions/uint32"
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci  regulator-allowed-modes:
1008c2ecf20Sopenharmony_ci    description: list of operating modes that software is allowed to configure
1018c2ecf20Sopenharmony_ci      for the regulator at run-time.  Elements may be specified in any order.
1028c2ecf20Sopenharmony_ci      The set of possible operating modes depends on the capabilities of
1038c2ecf20Sopenharmony_ci      every hardware so each device binding document explains which values
1048c2ecf20Sopenharmony_ci      the regulator supports.
1058c2ecf20Sopenharmony_ci    $ref: "/schemas/types.yaml#/definitions/uint32-array"
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci  regulator-system-load:
1088c2ecf20Sopenharmony_ci    description: Load in uA present on regulator that is not captured by
1098c2ecf20Sopenharmony_ci      any consumer request.
1108c2ecf20Sopenharmony_ci    $ref: "/schemas/types.yaml#/definitions/uint32"
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci  regulator-pull-down:
1138c2ecf20Sopenharmony_ci    description: Enable pull down resistor when the regulator is disabled.
1148c2ecf20Sopenharmony_ci    type: boolean
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci  regulator-over-current-protection:
1178c2ecf20Sopenharmony_ci    description: Enable over current protection.
1188c2ecf20Sopenharmony_ci    type: boolean
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci  regulator-active-discharge:
1218c2ecf20Sopenharmony_ci    description: |
1228c2ecf20Sopenharmony_ci      tristate, enable/disable active discharge of regulators. The values are:
1238c2ecf20Sopenharmony_ci      0: Disable active discharge.
1248c2ecf20Sopenharmony_ci      1: Enable active discharge.
1258c2ecf20Sopenharmony_ci      Absence of this property will leave configuration to default.
1268c2ecf20Sopenharmony_ci    $ref: "/schemas/types.yaml#/definitions/uint32"
1278c2ecf20Sopenharmony_ci    enum: [0, 1]
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci  regulator-coupled-with:
1308c2ecf20Sopenharmony_ci    description: Regulators with which the regulator is coupled. The linkage
1318c2ecf20Sopenharmony_ci      is 2-way - all coupled regulators should be linked with each other.
1328c2ecf20Sopenharmony_ci      A regulator should not be coupled with its supplier.
1338c2ecf20Sopenharmony_ci    $ref: "/schemas/types.yaml#/definitions/phandle-array"
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci  regulator-coupled-max-spread:
1368c2ecf20Sopenharmony_ci    description: Array of maximum spread between voltages of coupled regulators
1378c2ecf20Sopenharmony_ci      in microvolts, each value in the array relates to the corresponding
1388c2ecf20Sopenharmony_ci      couple specified by the regulator-coupled-with property.
1398c2ecf20Sopenharmony_ci    $ref: "/schemas/types.yaml#/definitions/uint32"
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci  regulator-max-step-microvolt:
1428c2ecf20Sopenharmony_ci    description: Maximum difference between current and target voltages
1438c2ecf20Sopenharmony_ci      that can be changed safely in a single step.
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_cipatternProperties:
1468c2ecf20Sopenharmony_ci  ".*-supply$":
1478c2ecf20Sopenharmony_ci    description: Input supply phandle(s) for this node
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci  regulator-state-(standby|mem|disk):
1508c2ecf20Sopenharmony_ci    type: object
1518c2ecf20Sopenharmony_ci    description:
1528c2ecf20Sopenharmony_ci      sub-nodes for regulator state in Standby, Suspend-to-RAM, and
1538c2ecf20Sopenharmony_ci      Suspend-to-DISK modes. Equivalent with standby, mem, and disk Linux
1548c2ecf20Sopenharmony_ci      sleep states.
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci    properties:
1578c2ecf20Sopenharmony_ci      regulator-on-in-suspend:
1588c2ecf20Sopenharmony_ci        description: regulator should be on in suspend state.
1598c2ecf20Sopenharmony_ci        type: boolean
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci      regulator-off-in-suspend:
1628c2ecf20Sopenharmony_ci        description: regulator should be off in suspend state.
1638c2ecf20Sopenharmony_ci        type: boolean
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci      regulator-suspend-min-microvolt:
1668c2ecf20Sopenharmony_ci        description: minimum voltage may be set in suspend state.
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci      regulator-suspend-max-microvolt:
1698c2ecf20Sopenharmony_ci        description: maximum voltage may be set in suspend state.
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci      regulator-suspend-microvolt:
1728c2ecf20Sopenharmony_ci        description: the default voltage which regulator would be set in
1738c2ecf20Sopenharmony_ci          suspend. This property is now deprecated, instead setting voltage
1748c2ecf20Sopenharmony_ci          for suspend mode via the API which regulator driver provides is
1758c2ecf20Sopenharmony_ci          recommended.
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci      regulator-changeable-in-suspend:
1788c2ecf20Sopenharmony_ci        description: whether the default voltage and the regulator on/off
1798c2ecf20Sopenharmony_ci          in suspend can be changed in runtime.
1808c2ecf20Sopenharmony_ci        type: boolean
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci      regulator-mode:
1838c2ecf20Sopenharmony_ci        description: operating mode in the given suspend state. The set
1848c2ecf20Sopenharmony_ci          of possible operating modes depends on the capabilities of every
1858c2ecf20Sopenharmony_ci          hardware so the valid modes are documented on each regulator device
1868c2ecf20Sopenharmony_ci          tree binding document.
1878c2ecf20Sopenharmony_ci        $ref: "/schemas/types.yaml#/definitions/uint32"
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci    additionalProperties: false
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ciadditionalProperties: true
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ciexamples:
1948c2ecf20Sopenharmony_ci  - |
1958c2ecf20Sopenharmony_ci    xyzreg: regulator {
1968c2ecf20Sopenharmony_ci      regulator-min-microvolt = <1000000>;
1978c2ecf20Sopenharmony_ci      regulator-max-microvolt = <2500000>;
1988c2ecf20Sopenharmony_ci      regulator-always-on;
1998c2ecf20Sopenharmony_ci      vin-supply = <&vin>;
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_ci      regulator-state-mem {
2028c2ecf20Sopenharmony_ci        regulator-on-in-suspend;
2038c2ecf20Sopenharmony_ci      };
2048c2ecf20Sopenharmony_ci    };
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci...
207