Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: Convert regulator binding to json-schema

Convert the common regulator binding to DT schema format. Note that all
the properties with standard unit suffixes have type checks already, so
only a description is necessary.

As fixed-regulator has already been converted, update the references in
it. Otherwise, keep regulator.txt with a reference to the schema to
avoid a bunch of treewide updates. regulator.txt can be removed when all
the regulator bindings are converted.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Rob Herring and committed by
Mark Brown
1914a996 7bd7916d

+205 -140
+4 -1
Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
··· 12 12 13 13 description: 14 14 Any property defined as part of the core regulator binding, defined in 15 - regulator.txt, can also be used. However a fixed voltage regulator is 15 + regulator.yaml, can also be used. However a fixed voltage regulator is 16 16 expected to have the regulator-min-microvolt and regulator-max-microvolt 17 17 to be the same. 18 + 19 + allOf: 20 + - $ref: "regulator.yaml#" 18 21 19 22 properties: 20 23 compatible:
+1 -139
Documentation/devicetree/bindings/regulator/regulator.txt
··· 1 - Voltage/Current Regulators 2 - 3 - Optional properties: 4 - - regulator-name: A string used as a descriptive name for regulator outputs 5 - - regulator-min-microvolt: smallest voltage consumers may set 6 - - regulator-max-microvolt: largest voltage consumers may set 7 - - regulator-microvolt-offset: Offset applied to voltages to compensate for voltage drops 8 - - regulator-min-microamp: smallest current consumers may set 9 - - regulator-max-microamp: largest current consumers may set 10 - - regulator-input-current-limit-microamp: maximum input current regulator allows 11 - - regulator-always-on: boolean, regulator should never be disabled 12 - - regulator-boot-on: bootloader/firmware enabled regulator 13 - - regulator-allow-bypass: allow the regulator to go into bypass mode 14 - - regulator-allow-set-load: allow the regulator performance level to be configured 15 - - <name>-supply: phandle to the parent supply/regulator node 16 - - regulator-ramp-delay: ramp delay for regulator(in uV/us) 17 - For hardware which supports disabling ramp rate, it should be explicitly 18 - initialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay. 19 - - regulator-enable-ramp-delay: The time taken, in microseconds, for the supply 20 - rail to reach the target voltage, plus/minus whatever tolerance the board 21 - design requires. This property describes the total system ramp time 22 - required due to the combination of internal ramping of the regulator itself, 23 - and board design issues such as trace capacitance and load on the supply. 24 - - regulator-settling-time-us: Settling time, in microseconds, for voltage 25 - change if regulator have the constant time for any level voltage change. 26 - This is useful when regulator have exponential voltage change. 27 - - regulator-settling-time-up-us: Settling time, in microseconds, for voltage 28 - increase if the regulator needs a constant time to settle after voltage 29 - increases of any level. This is useful for regulators with exponential 30 - voltage changes. 31 - - regulator-settling-time-down-us: Settling time, in microseconds, for voltage 32 - decrease if the regulator needs a constant time to settle after voltage 33 - decreases of any level. This is useful for regulators with exponential 34 - voltage changes. 35 - - regulator-soft-start: Enable soft start so that voltage ramps slowly 36 - - regulator-state-standby sub-root node for Standby mode 37 - : equivalent with standby Linux sleep state, which provides energy savings 38 - with a relatively quick transition back time. 39 - - regulator-state-mem sub-root node for Suspend-to-RAM mode 40 - : suspend to memory, the device goes to sleep, but all data stored in memory, 41 - only some external interrupt can wake the device. 42 - - regulator-state-disk sub-root node for Suspend-to-DISK mode 43 - : suspend to disk, this state operates similarly to Suspend-to-RAM, 44 - but includes a final step of writing memory contents to disk. 45 - - regulator-state-[mem/disk/standby] node has following common properties: 46 - - regulator-on-in-suspend: regulator should be on in suspend state. 47 - - regulator-off-in-suspend: regulator should be off in suspend state. 48 - - regulator-suspend-min-microvolt: minimum voltage may be set in 49 - suspend state. 50 - - regulator-suspend-max-microvolt: maximum voltage may be set in 51 - suspend state. 52 - - regulator-suspend-microvolt: the default voltage which regulator 53 - would be set in suspend. This property is now deprecated, instead 54 - setting voltage for suspend mode via the API which regulator 55 - driver provides is recommended. 56 - - regulator-changeable-in-suspend: whether the default voltage and 57 - the regulator on/off in suspend can be changed in runtime. 58 - - regulator-mode: operating mode in the given suspend state. 59 - The set of possible operating modes depends on the capabilities of 60 - every hardware so the valid modes are documented on each regulator 61 - device tree binding document. 62 - - regulator-initial-mode: initial operating mode. The set of possible operating 63 - modes depends on the capabilities of every hardware so each device binding 64 - documentation explains which values the regulator supports. 65 - - regulator-allowed-modes: list of operating modes that software is allowed to 66 - configure for the regulator at run-time. Elements may be specified in any 67 - order. The set of possible operating modes depends on the capabilities of 68 - every hardware so each device binding document explains which values the 69 - regulator supports. 70 - - regulator-system-load: Load in uA present on regulator that is not captured by 71 - any consumer request. 72 - - regulator-pull-down: Enable pull down resistor when the regulator is disabled. 73 - - regulator-over-current-protection: Enable over current protection. 74 - - regulator-active-discharge: tristate, enable/disable active discharge of 75 - regulators. The values are: 76 - 0: Disable active discharge. 77 - 1: Enable active discharge. 78 - Absence of this property will leave configuration to default. 79 - - regulator-coupled-with: Regulators with which the regulator 80 - is coupled. The linkage is 2-way - all coupled regulators should be linked 81 - with each other. A regulator should not be coupled with its supplier. 82 - - regulator-coupled-max-spread: Array of maximum spread between voltages of 83 - coupled regulators in microvolts, each value in the array relates to the 84 - corresponding couple specified by the regulator-coupled-with property. 85 - - regulator-max-step-microvolt: Maximum difference between current and target 86 - voltages that can be changed safely in a single step. 87 - 88 - Deprecated properties: 89 - - regulator-compatible: If a regulator chip contains multiple 90 - regulators, and if the chip's binding contains a child node that 91 - describes each regulator, then this property indicates which regulator 92 - this child node is intended to configure. If this property is missing, 93 - the node's name will be used instead. 94 - 95 - Example: 96 - 97 - xyzreg: regulator@0 { 98 - regulator-min-microvolt = <1000000>; 99 - regulator-max-microvolt = <2500000>; 100 - regulator-always-on; 101 - vin-supply = <&vin>; 102 - 103 - regulator-state-mem { 104 - regulator-on-in-suspend; 105 - }; 106 - }; 107 - 108 - Regulator Consumers: 109 - Consumer nodes can reference one or more of its supplies/ 110 - regulators using the below bindings. 111 - 112 - - <name>-supply: phandle to the regulator node 113 - 114 - These are the same bindings that a regulator in the above 115 - example used to reference its own supply, in which case 116 - its just seen as a special case of a regulator being a 117 - consumer itself. 118 - 119 - Example of a consumer device node (mmc) referencing two 120 - regulators (twl_reg1 and twl_reg2), 121 - 122 - twl_reg1: regulator@0 { 123 - ... 124 - ... 125 - ... 126 - }; 127 - 128 - twl_reg2: regulator@1 { 129 - ... 130 - ... 131 - ... 132 - }; 133 - 134 - mmc: mmc@0 { 135 - ... 136 - ... 137 - vmmc-supply = <&twl_reg1>; 138 - vmmcaux-supply = <&twl_reg2>; 139 - }; 1 + This file has moved to regulator.yaml.
+200
Documentation/devicetree/bindings/regulator/regulator.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/regulator/regulator.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Voltage/Current Regulators 8 + 9 + maintainers: 10 + - Liam Girdwood <lgirdwood@gmail.com> 11 + - Mark Brown <broonie@kernel.org> 12 + 13 + properties: 14 + regulator-name: 15 + description: A string used as a descriptive name for regulator outputs 16 + $ref: "/schemas/types.yaml#/definitions/string" 17 + 18 + regulator-min-microvolt: 19 + description: smallest voltage consumers may set 20 + 21 + regulator-max-microvolt: 22 + description: largest voltage consumers may set 23 + 24 + regulator-microvolt-offset: 25 + description: Offset applied to voltages to compensate for voltage drops 26 + 27 + regulator-min-microamp: 28 + description: smallest current consumers may set 29 + 30 + regulator-max-microamp: 31 + description: largest current consumers may set 32 + 33 + regulator-input-current-limit-microamp: 34 + description: maximum input current regulator allows 35 + 36 + regulator-always-on: 37 + description: boolean, regulator should never be disabled 38 + type: boolean 39 + 40 + regulator-boot-on: 41 + description: bootloader/firmware enabled regulator 42 + type: boolean 43 + 44 + regulator-allow-bypass: 45 + description: allow the regulator to go into bypass mode 46 + type: boolean 47 + 48 + regulator-allow-set-load: 49 + description: allow the regulator performance level to be configured 50 + type: boolean 51 + 52 + regulator-ramp-delay: 53 + description: ramp delay for regulator(in uV/us) For hardware which supports 54 + disabling ramp rate, it should be explicitly initialised to zero (regulator-ramp-delay 55 + = <0>) for disabling ramp delay. 56 + $ref: "/schemas/types.yaml#/definitions/uint32" 57 + 58 + regulator-enable-ramp-delay: 59 + description: The time taken, in microseconds, for the supply rail to 60 + reach the target voltage, plus/minus whatever tolerance the board 61 + design requires. This property describes the total system ramp time 62 + required due to the combination of internal ramping of the regulator 63 + itself, and board design issues such as trace capacitance and load 64 + on the supply. 65 + $ref: "/schemas/types.yaml#/definitions/uint32" 66 + 67 + regulator-settling-time-us: 68 + description: Settling time, in microseconds, for voltage change if regulator 69 + have the constant time for any level voltage change. This is useful 70 + when regulator have exponential voltage change. 71 + 72 + regulator-settling-time-up-us: 73 + description: Settling time, in microseconds, for voltage increase if 74 + the regulator needs a constant time to settle after voltage increases 75 + of any level. This is useful for regulators with exponential voltage 76 + changes. 77 + 78 + regulator-settling-time-down-us: 79 + description: Settling time, in microseconds, for voltage decrease if 80 + the regulator needs a constant time to settle after voltage decreases 81 + of any level. This is useful for regulators with exponential voltage 82 + changes. 83 + 84 + regulator-soft-start: 85 + description: Enable soft start so that voltage ramps slowly 86 + type: boolean 87 + 88 + regulator-initial-mode: 89 + description: initial operating mode. The set of possible operating modes 90 + depends on the capabilities of every hardware so each device binding 91 + documentation explains which values the regulator supports. 92 + $ref: "/schemas/types.yaml#/definitions/uint32" 93 + 94 + regulator-allowed-modes: 95 + description: list of operating modes that software is allowed to configure 96 + for the regulator at run-time. Elements may be specified in any order. 97 + The set of possible operating modes depends on the capabilities of 98 + every hardware so each device binding document explains which values 99 + the regulator supports. 100 + $ref: "/schemas/types.yaml#/definitions/uint32-array" 101 + 102 + regulator-system-load: 103 + description: Load in uA present on regulator that is not captured by 104 + any consumer request. 105 + $ref: "/schemas/types.yaml#/definitions/uint32" 106 + 107 + regulator-pull-down: 108 + description: Enable pull down resistor when the regulator is disabled. 109 + type: boolean 110 + 111 + regulator-over-current-protection: 112 + description: Enable over current protection. 113 + type: boolean 114 + 115 + regulator-active-discharge: 116 + description: | 117 + tristate, enable/disable active discharge of regulators. The values are: 118 + 0: Disable active discharge. 119 + 1: Enable active discharge. 120 + Absence of this property will leave configuration to default. 121 + allOf: 122 + - $ref: "/schemas/types.yaml#/definitions/uint32" 123 + - enum: [ 0, 1 ] 124 + 125 + regulator-coupled-with: 126 + description: Regulators with which the regulator is coupled. The linkage 127 + is 2-way - all coupled regulators should be linked with each other. 128 + A regulator should not be coupled with its supplier. 129 + $ref: "/schemas/types.yaml#/definitions/phandle-array" 130 + 131 + regulator-coupled-max-spread: 132 + description: Array of maximum spread between voltages of coupled regulators 133 + in microvolts, each value in the array relates to the corresponding 134 + couple specified by the regulator-coupled-with property. 135 + $ref: "/schemas/types.yaml#/definitions/uint32" 136 + 137 + regulator-max-step-microvolt: 138 + description: Maximum difference between current and target voltages 139 + that can be changed safely in a single step. 140 + 141 + patternProperties: 142 + ".*-supply$": 143 + description: Input supply phandle(s) for this node 144 + 145 + regulator-state-(standby|mem|disk): 146 + type: object 147 + description: 148 + sub-nodes for regulator state in Standby, Suspend-to-RAM, and 149 + Suspend-to-DISK modes. Equivalent with standby, mem, and disk Linux 150 + sleep states. 151 + 152 + properties: 153 + regulator-on-in-suspend: 154 + description: regulator should be on in suspend state. 155 + type: boolean 156 + 157 + regulator-off-in-suspend: 158 + description: regulator should be off in suspend state. 159 + type: boolean 160 + 161 + regulator-suspend-min-microvolt: 162 + description: minimum voltage may be set in suspend state. 163 + 164 + regulator-suspend-max-microvolt: 165 + description: maximum voltage may be set in suspend state. 166 + 167 + regulator-suspend-microvolt: 168 + description: the default voltage which regulator would be set in 169 + suspend. This property is now deprecated, instead setting voltage 170 + for suspend mode via the API which regulator driver provides is 171 + recommended. 172 + 173 + regulator-changeable-in-suspend: 174 + description: whether the default voltage and the regulator on/off 175 + in suspend can be changed in runtime. 176 + type: boolean 177 + 178 + regulator-mode: 179 + description: operating mode in the given suspend state. The set 180 + of possible operating modes depends on the capabilities of every 181 + hardware so the valid modes are documented on each regulator device 182 + tree binding document. 183 + $ref: "/schemas/types.yaml#/definitions/uint32" 184 + 185 + additionalProperties: false 186 + 187 + examples: 188 + - | 189 + xyzreg: regulator@0 { 190 + regulator-min-microvolt = <1000000>; 191 + regulator-max-microvolt = <2500000>; 192 + regulator-always-on; 193 + vin-supply = <&vin>; 194 + 195 + regulator-state-mem { 196 + regulator-on-in-suspend; 197 + }; 198 + }; 199 + 200 + ...