summaryrefslogtreecommitdiff
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-15 11:16:05 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-16 19:51:53 +0100
commit65b19ce6c223287ac95bbc22b12ef5a2738472d1 (patch)
treea2cf084107796be58d1e3b3c02b1d8d3171ce8c6 /drivers/regulator/core.c
parent9f29c9e30b98832d98e8f528252fe193123a7d80 (diff)
downloadlwn-65b19ce6c223287ac95bbc22b12ef5a2738472d1.tar.gz
lwn-65b19ce6c223287ac95bbc22b12ef5a2738472d1.zip
regulator: core: Allow drivers to pass in a regmap
Since many regulators use regmap for register I/O and since there's quite a few very common patterns in the code allow drivers to pass in a regmap to the core for use in generic code. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 7943fd64988d..bca1e5989243 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -24,6 +24,7 @@
#include <linux/suspend.h>
#include <linux/delay.h>
#include <linux/of.h>
+#include <linux/regmap.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regulator/consumer.h>
#include <linux/regulator/driver.h>
@@ -2877,6 +2878,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
rdev->reg_data = config->driver_data;
rdev->owner = regulator_desc->owner;
rdev->desc = regulator_desc;
+ rdev->regmap = config->regmap;
INIT_LIST_HEAD(&rdev->consumer_list);
INIT_LIST_HEAD(&rdev->list);
BLOCKING_INIT_NOTIFIER_HEAD(&rdev->notifier);