* [PATCH 0/2] set regulator constraints for standby state
@ 2018-11-13 14:47 Andrei.Stefanescu
2018-11-13 14:47 ` [PATCH 1/2] regulator: dt-bindings: add regulator-state-standby bindings Andrei.Stefanescu
2018-11-13 14:47 ` [PATCH 2/2] regulator: of: add support for parsing regulator-state-standby Andrei.Stefanescu
0 siblings, 2 replies; 3+ messages in thread
From: Andrei.Stefanescu @ 2018-11-13 14:47 UTC (permalink / raw)
To: lgirdwood, broonie, robh+dt, mark.rutland
Cc: Nicolas.Ferre, Cristian.Birsan, Claudiu.Beznea, devicetree,
linux-kernel, Andrei.Stefanescu
This patch series adds support for setting the regulator constraints
when entering standby Linux state.
The new bindings are called regulator-state-standby and have
the same syntax as regulator-state-mem/disk.
Before this patch, if the regulator driver implemented
set_suspend_voltage/mode the rdev_warn message: "No configuration"
(drivers/regulator/core.c:suspend_set_state) would be issued when
resuming from standby.
Andrei Stefanescu (2):
regulator: dt-bindings: add regulator-state-standby bindings
regulator: of: add support for parsing regulator-state-standby
Documentation/devicetree/bindings/regulator/regulator.txt | 5 ++++-
drivers/regulator/of_regulator.c | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] regulator: dt-bindings: add regulator-state-standby bindings
2018-11-13 14:47 [PATCH 0/2] set regulator constraints for standby state Andrei.Stefanescu
@ 2018-11-13 14:47 ` Andrei.Stefanescu
2018-11-13 14:47 ` [PATCH 2/2] regulator: of: add support for parsing regulator-state-standby Andrei.Stefanescu
1 sibling, 0 replies; 3+ messages in thread
From: Andrei.Stefanescu @ 2018-11-13 14:47 UTC (permalink / raw)
To: lgirdwood, broonie, robh+dt, mark.rutland
Cc: Nicolas.Ferre, Cristian.Birsan, Claudiu.Beznea, devicetree,
linux-kernel, Andrei.Stefanescu
For state-mem and state-disk regulators can have
various parameters applied such as enabled/disabled,
current mode, voltage etc.
This patch adds documentation on how to set these parameters
in the device tree for the standby state.
Signed-off-by: Andrei Stefanescu <andrei.stefanescu@microchip.com>
---
Documentation/devicetree/bindings/regulator/regulator.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/regulator/regulator.txt b/Documentation/devicetree/bindings/regulator/regulator.txt
index 0c3a243..0a3f087 100644
--- a/Documentation/devicetree/bindings/regulator/regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/regulator.txt
@@ -33,13 +33,16 @@ Optional properties:
decreases of any level. This is useful for regulators with exponential
voltage changes.
- regulator-soft-start: Enable soft start so that voltage ramps slowly
+- regulator-state-standby sub-root node for Standby mode
+ : equivalent with standby Linux sleep state, which provides energy savings
+ with a relatively quick transition back time.
- 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-state-[mem/disk/standby] 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-min-microvolt: minimum voltage may be set in
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] regulator: of: add support for parsing regulator-state-standby
2018-11-13 14:47 [PATCH 0/2] set regulator constraints for standby state Andrei.Stefanescu
2018-11-13 14:47 ` [PATCH 1/2] regulator: dt-bindings: add regulator-state-standby bindings Andrei.Stefanescu
@ 2018-11-13 14:47 ` Andrei.Stefanescu
1 sibling, 0 replies; 3+ messages in thread
From: Andrei.Stefanescu @ 2018-11-13 14:47 UTC (permalink / raw)
To: lgirdwood, broonie, robh+dt, mark.rutland
Cc: Nicolas.Ferre, Cristian.Birsan, Claudiu.Beznea, devicetree,
linux-kernel, Andrei.Stefanescu
Set the according constraints for PM_SUSPEND_STANDBY case.
Previously, only suspend to mem/disk were taken into
consideration.
Signed-off-by: Andrei Stefanescu <andrei.stefanescu@microchip.com>
---
drivers/regulator/of_regulator.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index a732f09..c711a0a 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -20,6 +20,7 @@
#include "internal.h"
static const char *const regulator_states[PM_SUSPEND_MAX + 1] = {
+ [PM_SUSPEND_STANDBY] = "regulator-state-standby",
[PM_SUSPEND_MEM] = "regulator-state-mem",
[PM_SUSPEND_MAX] = "regulator-state-disk",
};
@@ -185,9 +186,11 @@ static void of_get_regulation_constraints(struct device_node *np,
case PM_SUSPEND_MAX:
suspend_state = &constraints->state_disk;
break;
+ case PM_SUSPEND_STANDBY:
+ suspend_state = &constraints->state_standby;
+ break;
case PM_SUSPEND_ON:
case PM_SUSPEND_TO_IDLE:
- case PM_SUSPEND_STANDBY:
default:
continue;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-13 14:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13 14:47 [PATCH 0/2] set regulator constraints for standby state Andrei.Stefanescu
2018-11-13 14:47 ` [PATCH 1/2] regulator: dt-bindings: add regulator-state-standby bindings Andrei.Stefanescu
2018-11-13 14:47 ` [PATCH 2/2] regulator: of: add support for parsing regulator-state-standby Andrei.Stefanescu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).