Skip to contentSkip to conversation

regulator: of: Does always-on imply on-in-suspend?

PATCH In review Robert Karszniewicz 2 participants 4 messages Dec 16, 2019 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

cover regulator: of: Does always-on imply on-in-suspend?

Hi all.

Just to make sure; the oftree property regulator-always-on implies that for every suspend state, the property regulator-on-in-suspend is implicit? With no other side-effect? Reading the documentation, this is what I interpret.

So if that is true, the next message is a patch to fix a bogus "No configuration" warning in the case when regulator-always-on exists and suspend states are not set explicitly.

Robert Karszniewicz (1):
regulator: of: Hide wrong warning regarding suspend state
configuration

 drivers/regulator/of_regulator.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 regulator: of: Hide wrong warning regarding suspend state configuration

A "No configuration" warning is falsely emitted in the case when the of-property regulator-always-on is set but regulator-(on|off)-in-suspend isn't set.
This patch fixes the warning by explicitly setting always-on regulator's states to ENABLE_IN_SUSPEND.

---
Tested on v4.19.67, applies cleanly on v5.5-rc2.

 drivers/regulator/of_regulator.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/regulator/of_regulator.c +7 -1
index 210fc20..3acb1571 100644
@@ -188,8 +188,14 @@ static void of_get_regulation_constraints(struct device_node *np,
 			continue;
 		}
 
+		if (!suspend_state)
+			continue;
+
+		if (constraints->always_on)
+			suspend_state->enabled = ENABLE_IN_SUSPEND;
+
 		suspend_np = of_get_child_by_name(np, regulator_states[i]);
-		if (!suspend_np || !suspend_state)
+		if (!suspend_np)
 			continue;
 
 		if (!of_property_read_u32(suspend_np, "regulator-mode",
Signature · 1 line
2.7.4
maintainer
#2 lore raw

Re: [PATCH 1/1] regulator: of: Hide wrong warning regarding suspend state configuration

Quoted 5 lines · Robert Karszniewicz

A "No configuration" warning is falsely emitted in the case when the of-property regulator-always-on is set but regulator-(on|off)-in-suspend isn't set.
This patch fixes the warning by explicitly setting always-on regulator's states to ENABLE_IN_SUSPEND.

Suspend states are basically completely separate to runtime states (and we quite often have no software control over them) so it's not expected that always-on will have an effect on suspend mode; the documentation could use some cleanup here as it's mostly written from a runtime only perspective.

maintainer
#3 lore raw
In reply to Robert Karszniewicz
Quoted 5 lines · Robert Karszniewicz

Hi all.

Just to make sure; the oftree property regulator-always-on implies that for every suspend state, the property regulator-on-in-suspend is implicit? With no other side-effect? Reading the documentation, this is what I interpret.

Please don't send cover letters for single patches, if there is anything that needs saying put it in the changelog of the patch or after the --- if it's administrative stuff. This reduces mail volume and ensures that any important information is recorded in the changelog rather than being lost.