Merge branch 'topic/dt' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 5 Dec 2011 19:27:49 +0000 (19:27 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 5 Dec 2011 19:27:49 +0000 (19:27 +0000)
Documentation/power/regulator/regulator.txt
drivers/regulator/fixed.c
drivers/regulator/of_regulator.c
include/linux/regulator/of_regulator.h

index 3f8b528f237e17626142dfba88f955dfee7a11b3..e272d9909e393dd4091575555a82173e90694fdc 100644 (file)
@@ -12,7 +12,7 @@ Drivers can register a regulator by calling :-
 
 struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
        struct device *dev, struct regulator_init_data *init_data,
-       void *driver_data);
+       void *driver_data, struct device_node *of_node);
 
 This will register the regulators capabilities and operations to the regulator
 core.
index 72abbf5507a6902290c3813c7a737f1d355cd0d5..a44a017c0864217e04b8fa2bfb8a1ab359ac391f 100644 (file)
@@ -64,7 +64,7 @@ of_get_fixed_voltage_config(struct device *dev)
        if (!config)
                return NULL;
 
-       config->init_data = of_get_regulator_init_data(dev);
+       config->init_data = of_get_regulator_init_data(dev, dev->of_node);
        if (!config->init_data)
                return NULL;
 
index acd7045d16017328f2e6107320d6566b80584b80..f1651eb6964807d9ae86c6ed88032199d5950199 100644 (file)
@@ -34,6 +34,9 @@ static void of_get_regulation_constraints(struct device_node *np,
        /* Voltage change possible? */
        if (constraints->min_uV != constraints->max_uV)
                constraints->valid_ops_mask |= REGULATOR_CHANGE_VOLTAGE;
+       /* Only one voltage?  Then make sure it's set. */
+       if (constraints->min_uV == constraints->max_uV)
+               constraints->apply_uV = true;
 
        uV_offset = of_get_property(np, "regulator-microvolt-offset", NULL);
        if (uV_offset)
@@ -66,18 +69,19 @@ static void of_get_regulation_constraints(struct device_node *np,
  * tree node, returns a pointer to the populated struture or NULL if memory
  * alloc fails.
  */
-struct regulator_init_data *of_get_regulator_init_data(struct device *dev)
+struct regulator_init_data *of_get_regulator_init_data(struct device *dev,
+                                               struct device_node *node)
 {
        struct regulator_init_data *init_data;
 
-       if (!dev->of_node)
+       if (!node)
                return NULL;
 
        init_data = devm_kzalloc(dev, sizeof(*init_data), GFP_KERNEL);
        if (!init_data)
                return NULL; /* Out of memory? */
 
-       of_get_regulation_constraints(dev->of_node, &init_data);
+       of_get_regulation_constraints(node, &init_data);
        return init_data;
 }
 EXPORT_SYMBOL_GPL(of_get_regulator_init_data);
index d83a98d3e3fdfc8bd40227ca299bf78fc94dcf62..769704f296e56b367729fe550f88b3f68cc15001 100644 (file)
@@ -8,10 +8,12 @@
 
 #if defined(CONFIG_OF)
 extern struct regulator_init_data
-       *of_get_regulator_init_data(struct device *dev);
+       *of_get_regulator_init_data(struct device *dev,
+                                   struct device_node *node);
 #else
 static inline struct regulator_init_data
-       *of_get_regulator_init_data(struct device *dev)
+       *of_get_regulator_init_data(struct device *dev,
+                                   struct device_node *node)
 {
        return NULL;
 }
This page took 0.031446 seconds and 5 git commands to generate.