regulator: of: Add support for parsing microvolts for suspend state
authorDoug Anderson <[email protected]>
Sat, 1 Nov 2014 03:52:58 +0000 (20:52 -0700)
committerMark Brown <[email protected]>
Mon, 3 Nov 2014 12:29:02 +0000 (12:29 +0000)
Leverage all the work that was done in (40e20d6 regulator: of: Add
support for parsing regulator_state for suspend state) and throw in
the ability to set suspend microvolts from the device tree.

Signed-off-by: Doug Anderson <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Chris Zhong <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
drivers/regulator/of_regulator.c

index 36a1f5cc14e958c8798f8f10babf4fa037a96753..50be70878d2d335cdd100f85a8829529c3108999 100644 (file)
@@ -107,6 +107,10 @@ static void of_get_regulation_constraints(struct device_node *np,
                                        "regulator-off-in-suspend"))
                        suspend_state->disabled = true;
 
+               if (!of_property_read_u32(suspend_np,
+                                       "regulator-suspend-microvolt", &pval))
+                       suspend_state->uV = pval;
+
                of_node_put(suspend_np);
                suspend_state = NULL;
                suspend_np = NULL;