Parse missing regulator constraints from device tree blob
Subsystems (2)
This patch adds support for parsing following regulator contraints from device tree blob.
1. valid modes mask (valid_modes_mask)
2. initial mode (initial_mode)
3. initial state (initial_state)
4. state mem (state_mem)
5. state disk (state_disk)
6. state standby (state_standby)
Signed-off-by Saurabh Singh Sengar <[email protected]>
--- .../devicetree/bindings/regulator/regulator.txt | 45 ++++++++++++ drivers/regulator/of_regulator.c | 77 ++++++++++++++++++++ 2 files changed, 122 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/regulator/regulator.txt +45 -0
@@ -14,6 +14,36 @@ Optional properties: - regulator-ramp-delay: ramp delay for regulator(in uV/uS) For hardwares which support disabling ramp rate, it should be explicitly intialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay. +- regulator-valid-modes-mask: valid operations for regulator on particular machine + Supports following modes of operations: + Mode Description + ---- ----------- + fast Regulator can handle fast changes in it's load + normal Normal regulator power supply mode + idle Regulator runs in a more efficient mode for light loads. + standby Regulator runs in the most efficient mode for very light loads + See the example given below. + +- regulator-initial-mode: default mode to set on startup + Refer to regulator-initial-mode for modes supported + +- regulator-initial-state: suspend state to set at init + Any one of the following states can be set: + Mode Description + ---- ----------- + suspend-mem suspend to memory + suspend-standby standby mode + suspend-disk suspend to disk + See the example given below. + +- regulator-state-mem, regulator-state-disk, regulator-state-standby: + defines regulator suspend to memory, suspend to disk (hibernate) and standby respectively. + have following sub-constarints: + - regulator-state-uv: voltage to set in suspend state + - regulator-state-mode: suspend regulator operating mode, + refer to regulator-valid-modes-mask for modes supported + - regulator-state-enabled: is regulator enabled in this suspend state + - regulator-state-disabled: is the regulator disbled in this suspend state Deprecated properties: - regulator-compatible: If a regulator chip contains multiple
@@ -29,6 +59,21 @@ Example: regulator-max-microvolt = <2500000>; regulator-always-on; vin-supply = <&vin>; + regulator-initial-mode = "normal"; + regulator-initial-state = "suspend-mem"; + regulator-valid-modes-mask { + /*can support multiple mode + * in this example supporting fast and normal mode */ + fast-mode; + normal-mode; + }; + regulator-state-mem { + regulator-state-mode = "idle"; + regulator-state-enabled; + }; + regulator-state-disk { + regulator-state-disabled; + }; }; Regulator Consumers:
drivers/regulator/of_regulator.c +77 -0
94 lines not on this page · raw message
Signature · 1 line
1.7.0.4