aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 14:55:17 +0900
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 14:55:17 +0900
commitc6d65bf246fbba6e9042a35aba050d2a92f39505 (patch)
tree896fbb104de505b413c3ef43707514fd886f4f78 /drivers/mfd
parentMerge tag 'regmap-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap (diff)
parentMerge remote-tracking branch 'regulator/topic/tps65910' into regulator-next (diff)
downloadlinux-dev-c6d65bf246fbba6e9042a35aba050d2a92f39505.tar.xz
linux-dev-c6d65bf246fbba6e9042a35aba050d2a92f39505.zip
Merge tag 'regulator-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: "Lots of driver updates here plus some nice new core features, the main one being the first: - Enable support for providing a dummy regulator when we know that one must exist for the device to be functional. This makes it much easier to add regulator support to drivers since we don't require that the machine integration for all systems using the device be updated to provide regulators. - Substantial reduction in the amount of busy waiting done while waiting for enables to complete. - Allow MFDs to distribute regulator supplies to child devices so we don't have to expose the internal structure of MFDs outside of the driver. - Managed registeration for regulators" * tag 'regulator-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (113 commits) regulator: s5m8767: Modify parsing method of the voltage table of buck2/3/4 regulator: s5m8767: Modify parse_dt function to parse data related to ramp regulator: da9052: Revert se apply_[reg|bit] with regmap based voltage_sel operations mfd: arizona: Specify supply mappings for Arizona CODECs mfd: Allow mapping regulator supplies to MFD device from children regulator: core: Add ability to create a lookup alias for supply regulator: tps65910: Fix checkpatch issue regulator: tps65023: Fix checkpatch issue regulator: tps6105x: Fix checkpatch issue regulator: mc13783: Fix checkpatch issue regulator: max8997: Fix checkpatch issue regulator: lp3971: Fix checkpatch issue regulator: fixed: Fix checkpatch issue regulator: anatop: Fix checkpatch issue regulator: Add REGULATOR_LINEAR_RANGE macro regulator: Remove max_uV from struct regulator_linear_range regulator: ti-abb: Fix operator precedence typo regulator: tps65910: get regulators node from parent node only regulator: tps6586x: get regulators node from parent node only regulator: tps65090: get regulators node from parent node only ...
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/arizona-core.c32
-rw-r--r--drivers/mfd/mfd-core.c22
2 files changed, 46 insertions, 8 deletions
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 5ac3aa48473b..022b1863d36c 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -569,13 +569,25 @@ static struct mfd_cell early_devs[] = {
{ .name = "arizona-ldo1" },
};
+static const char *wm5102_supplies[] = {
+ "DBVDD2",
+ "DBVDD3",
+ "CPVDD",
+ "SPKVDDL",
+ "SPKVDDR",
+};
+
static struct mfd_cell wm5102_devs[] = {
{ .name = "arizona-micsupp" },
{ .name = "arizona-extcon" },
{ .name = "arizona-gpio" },
{ .name = "arizona-haptics" },
{ .name = "arizona-pwm" },
- { .name = "wm5102-codec" },
+ {
+ .name = "wm5102-codec",
+ .parent_supplies = wm5102_supplies,
+ .num_parent_supplies = ARRAY_SIZE(wm5102_supplies),
+ },
};
static struct mfd_cell wm5110_devs[] = {
@@ -584,7 +596,17 @@ static struct mfd_cell wm5110_devs[] = {
{ .name = "arizona-gpio" },
{ .name = "arizona-haptics" },
{ .name = "arizona-pwm" },
- { .name = "wm5110-codec" },
+ {
+ .name = "wm5110-codec",
+ .parent_supplies = wm5102_supplies,
+ .num_parent_supplies = ARRAY_SIZE(wm5102_supplies),
+ },
+};
+
+static const char *wm8997_supplies[] = {
+ "DBVDD2",
+ "CPVDD",
+ "SPKVDD",
};
static struct mfd_cell wm8997_devs[] = {
@@ -593,7 +615,11 @@ static struct mfd_cell wm8997_devs[] = {
{ .name = "arizona-gpio" },
{ .name = "arizona-haptics" },
{ .name = "arizona-pwm" },
- { .name = "wm8997-codec" },
+ {
+ .name = "wm8997-codec",
+ .parent_supplies = wm8997_supplies,
+ .num_parent_supplies = ARRAY_SIZE(wm8997_supplies),
+ },
};
int arizona_dev_init(struct arizona *arizona)
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index f421586f29fb..adc8ea36e7c4 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -20,6 +20,7 @@
#include <linux/module.h>
#include <linux/irqdomain.h>
#include <linux/of.h>
+#include <linux/regulator/consumer.h>
static struct device_type mfd_dev_type = {
.name = "mfd_device",
@@ -99,6 +100,13 @@ static int mfd_add_device(struct device *parent, int id,
pdev->dev.dma_mask = parent->dma_mask;
pdev->dev.dma_parms = parent->dma_parms;
+ ret = devm_regulator_bulk_register_supply_alias(
+ &pdev->dev, cell->parent_supplies,
+ parent, cell->parent_supplies,
+ cell->num_parent_supplies);
+ if (ret < 0)
+ goto fail_res;
+
if (parent->of_node && cell->of_compatible) {
for_each_child_of_node(parent->of_node, np) {
if (of_device_is_compatible(np, cell->of_compatible)) {
@@ -112,12 +120,12 @@ static int mfd_add_device(struct device *parent, int id,
ret = platform_device_add_data(pdev,
cell->platform_data, cell->pdata_size);
if (ret)
- goto fail_res;
+ goto fail_alias;
}
ret = mfd_platform_add_cell(pdev, cell);
if (ret)
- goto fail_res;
+ goto fail_alias;
for (r = 0; r < cell->num_resources; r++) {
res[r].name = cell->resources[r].name;
@@ -152,17 +160,17 @@ static int mfd_add_device(struct device *parent, int id,
if (!cell->ignore_resource_conflicts) {
ret = acpi_check_resource_conflict(&res[r]);
if (ret)
- goto fail_res;
+ goto fail_alias;
}
}
ret = platform_device_add_resources(pdev, res, cell->num_resources);
if (ret)
- goto fail_res;
+ goto fail_alias;
ret = platform_device_add(pdev);
if (ret)
- goto fail_res;
+ goto fail_alias;
if (cell->pm_runtime_no_callbacks)
pm_runtime_no_callbacks(&pdev->dev);
@@ -171,6 +179,10 @@ static int mfd_add_device(struct device *parent, int id,
return 0;
+fail_alias:
+ devm_regulator_bulk_unregister_supply_alias(&pdev->dev,
+ cell->parent_supplies,
+ cell->num_parent_supplies);
fail_res:
kfree(res);
fail_device: