summaryrefslogtreecommitdiff
path: root/drivers/regulator/wm8994-regulator.c
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2013-04-11 20:36:57 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-11 20:56:21 +0400
commit3ea9389656ddf8beb1b5b52b8db6333fa4a7c00e (patch)
tree6fd19df4038a595b51d7b39dcc4fb9249b0ba4af /drivers/regulator/wm8994-regulator.c
parente3d27775fcf5e78cca346d298e8e7f4afeefc5c1 (diff)
downloadlinux-3ea9389656ddf8beb1b5b52b8db6333fa4a7c00e.tar.xz
regulator: wm8994: Use GPIO parsed from DT when registering regulators
Ensure the regulators are registered with a GPIO parsed from the device tree when available. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/wm8994-regulator.c')
-rw-r--r--drivers/regulator/wm8994-regulator.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c
index f03fbf1ff38a..a612c356a697 100644
--- a/drivers/regulator/wm8994-regulator.c
+++ b/drivers/regulator/wm8994-regulator.c
@@ -149,9 +149,11 @@ static int wm8994_ldo_probe(struct platform_device *pdev)
config.init_data = &ldo->init_data;
if (pdata)
config.ena_gpio = pdata->ldo[id].enable;
+ else if (wm8994->dev->of_node)
+ config.ena_gpio = wm8994->pdata.ldo[id].enable;
/* Use default constraints if none set up */
- if (!pdata || !pdata->ldo[id].init_data) {
+ if (!pdata || !pdata->ldo[id].init_data || wm8994->dev->of_node) {
dev_dbg(wm8994->dev, "Using default init data, supply %s %s\n",
ldo->supply.dev_name, ldo->supply.supply);