aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2014-04-16 05:01:38 -0400
committerMark Brown <broonie@linaro.org>2014-04-18 13:35:03 -0400
commit4a8c475f5fd5c1271dba36a453d666d5ed473aa6 (patch)
treefcbc82d2b185af50f6070323e8142e4127aca125 /drivers/mfd
parent36bcdf1bb6a16d58f8d60549502fd1da6b27a81a (diff)
regulator: arizona-ldo1: Move setup processing from arizona-core
It is more idiomatic to process things relating to the regulator in its driver. This patch moves both processing of device tree relating to the regulator and checking if the regulator is external from arizona-core into the regulator driver. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/arizona-core.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 37b5e1447d02..07e6e27be23c 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -533,7 +533,6 @@ static int arizona_of_get_core_pdata(struct arizona *arizona)
533 int ret, i; 533 int ret, i;
534 534
535 pdata->reset = arizona_of_get_named_gpio(arizona, "wlf,reset", true); 535 pdata->reset = arizona_of_get_named_gpio(arizona, "wlf,reset", true);
536 pdata->ldoena = arizona_of_get_named_gpio(arizona, "wlf,ldoena", true);
537 536
538 ret = of_property_read_u32_array(arizona->dev->of_node, 537 ret = of_property_read_u32_array(arizona->dev->of_node,
539 "wlf,gpio-defaults", 538 "wlf,gpio-defaults",
@@ -665,6 +664,9 @@ int arizona_dev_init(struct arizona *arizona)
665 return -EINVAL; 664 return -EINVAL;
666 } 665 }
667 666
667 /* Mark DCVDD as external, LDO1 driver will clear if internal */
668 arizona->external_dcvdd = true;
669
668 ret = mfd_add_devices(arizona->dev, -1, early_devs, 670 ret = mfd_add_devices(arizona->dev, -1, early_devs,
669 ARRAY_SIZE(early_devs), NULL, 0, NULL); 671 ARRAY_SIZE(early_devs), NULL, 0, NULL);
670 if (ret != 0) { 672 if (ret != 0) {
@@ -864,14 +866,6 @@ int arizona_dev_init(struct arizona *arizona)
864 arizona->pdata.gpio_defaults[i]); 866 arizona->pdata.gpio_defaults[i]);
865 } 867 }
866 868
867 /*
868 * LDO1 can only be used to supply DCVDD so if it has no
869 * consumers then DCVDD is supplied externally.
870 */
871 if (arizona->pdata.ldo1 &&
872 arizona->pdata.ldo1->num_consumer_supplies == 0)
873 arizona->external_dcvdd = true;
874
875 pm_runtime_set_autosuspend_delay(arizona->dev, 100); 869 pm_runtime_set_autosuspend_delay(arizona->dev, 100);
876 pm_runtime_use_autosuspend(arizona->dev); 870 pm_runtime_use_autosuspend(arizona->dev);
877 pm_runtime_enable(arizona->dev); 871 pm_runtime_enable(arizona->dev);