]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
regulator: of: setup initial suspend state
authorKeerthy <j-keerthy@ti.com>
Mon, 20 Jun 2016 08:43:31 +0000 (14:13 +0530)
committerMark Brown <broonie@kernel.org>
Wed, 22 Jun 2016 15:15:34 +0000 (16:15 +0100)
Setup initial suspend state to mem, if suspend state is defined for
mem state. This makes sure that the regulators are in proper mode
already from boot.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/of_regulator.c

index cd828dbf9d529e6d459c9e9eae65c6d252b7a1e4..4f613ec995004dc04aa62bef738091bdaf38093d 100644 (file)
@@ -163,6 +163,9 @@ static void of_get_regulation_constraints(struct device_node *np,
                                        "regulator-suspend-microvolt", &pval))
                        suspend_state->uV = pval;
 
+               if (i == PM_SUSPEND_MEM)
+                       constraints->initial_state = PM_SUSPEND_MEM;
+
                of_node_put(suspend_np);
                suspend_state = NULL;
                suspend_np = NULL;