forked from Minki/linux
218094c975
Some regulators can run on different operating modes (opmodes). This allows systems to choose the most efficient opmode for each regulator. This patch builds on top of (291d761 regulator: Document binding for regulator suspend state for PM state) adding a regulator-initial-mode DT property to configure at startup the operating mode for regulators that support changing its mode during normal operation and a property regulator-mode to be used in the regulator-state-[mem/disk] nodes for regulators that supports changing its operating mode when the system enters in a suspend state. The set of possible modes that a regulator can operate depends on the hardware capabilities so a list of generic operating modes can't be provided. Instead, each hardware binding should define the list of valid operating modes for the regulators found on that device. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
93 lines
3.5 KiB
Plaintext
93 lines
3.5 KiB
Plaintext
Voltage/Current Regulators
|
|
|
|
Optional properties:
|
|
- regulator-name: A string used as a descriptive name for regulator outputs
|
|
- regulator-min-microvolt: smallest voltage consumers may set
|
|
- regulator-max-microvolt: largest voltage consumers may set
|
|
- regulator-microvolt-offset: Offset applied to voltages to compensate for voltage drops
|
|
- regulator-min-microamp: smallest current consumers may set
|
|
- regulator-max-microamp: largest current consumers may set
|
|
- regulator-always-on: boolean, regulator should never be disabled
|
|
- regulator-boot-on: bootloader/firmware enabled regulator
|
|
- regulator-allow-bypass: allow the regulator to go into bypass mode
|
|
- <name>-supply: phandle to the parent supply/regulator node
|
|
- regulator-ramp-delay: ramp delay for regulator(in uV/uS)
|
|
For hardware which supports disabling ramp rate, it should be explicitly
|
|
intialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay.
|
|
- regulator-enable-ramp-delay: The time taken, in microseconds, for the supply
|
|
rail to reach the target voltage, plus/minus whatever tolerance the board
|
|
design requires. This property describes the total system ramp time
|
|
required due to the combination of internal ramping of the regulator itself,
|
|
and board design issues such as trace capacitance and load on the supply.
|
|
- regulator-state-mem sub-root node for Suspend-to-RAM mode
|
|
: suspend to memory, the device goes to sleep, but all data stored in memory,
|
|
only some external interrupt can wake the device.
|
|
- regulator-state-disk sub-root node for Suspend-to-DISK mode
|
|
: suspend to disk, this state operates similarly to Suspend-to-RAM,
|
|
but includes a final step of writing memory contents to disk.
|
|
- regulator-state-[mem/disk] node has following common properties:
|
|
- regulator-on-in-suspend: regulator should be on in suspend state.
|
|
- regulator-off-in-suspend: regulator should be off in suspend state.
|
|
- regulator-suspend-microvolt: regulator should be set to this voltage
|
|
in suspend.
|
|
- regulator-mode: operating mode in the given suspend state.
|
|
The set of possible operating modes depends on the capabilities of
|
|
every hardware so the valid modes are documented on each regulator
|
|
device tree binding document.
|
|
- regulator-initial-mode: initial operating mode. The set of possible operating
|
|
modes depends on the capabilities of every hardware so each device binding
|
|
documentation explains which values the regulator supports.
|
|
|
|
Deprecated properties:
|
|
- regulator-compatible: If a regulator chip contains multiple
|
|
regulators, and if the chip's binding contains a child node that
|
|
describes each regulator, then this property indicates which regulator
|
|
this child node is intended to configure. If this property is missing,
|
|
the node's name will be used instead.
|
|
|
|
Example:
|
|
|
|
xyzreg: regulator@0 {
|
|
regulator-min-microvolt = <1000000>;
|
|
regulator-max-microvolt = <2500000>;
|
|
regulator-always-on;
|
|
vin-supply = <&vin>;
|
|
|
|
regulator-state-mem {
|
|
regulator-on-in-suspend;
|
|
};
|
|
};
|
|
|
|
Regulator Consumers:
|
|
Consumer nodes can reference one or more of its supplies/
|
|
regulators using the below bindings.
|
|
|
|
- <name>-supply: phandle to the regulator node
|
|
|
|
These are the same bindings that a regulator in the above
|
|
example used to reference its own supply, in which case
|
|
its just seen as a special case of a regulator being a
|
|
consumer itself.
|
|
|
|
Example of a consumer device node (mmc) referencing two
|
|
regulators (twl_reg1 and twl_reg2),
|
|
|
|
twl_reg1: regulator@0 {
|
|
...
|
|
...
|
|
...
|
|
};
|
|
|
|
twl_reg2: regulator@1 {
|
|
...
|
|
...
|
|
...
|
|
};
|
|
|
|
mmc: mmc@0x0 {
|
|
...
|
|
...
|
|
vmmc-supply = <&twl_reg1>;
|
|
vmmcaux-supply = <&twl_reg2>;
|
|
};
|