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>
This commit is contained in:
Sylwester Nawrocki 2013-04-11 18:36:57 +02:00 committed by Mark Brown
parent e3d27775fc
commit 3ea9389656
1 changed files with 3 additions and 1 deletions

View File

@ -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);