diff options
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/arizona-core.c | 32 | ||||
-rw-r--r-- | drivers/mfd/db8500-prcmu.c | 1 | ||||
-rw-r--r-- | drivers/mfd/dbx500-prcmu-regs.h | 1 | ||||
-rw-r--r-- | drivers/mfd/mfd-core.c | 22 |
4 files changed, 46 insertions, 10 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[] = { | |||
569 | { .name = "arizona-ldo1" }, | 569 | { .name = "arizona-ldo1" }, |
570 | }; | 570 | }; |
571 | 571 | ||
572 | static const char *wm5102_supplies[] = { | ||
573 | "DBVDD2", | ||
574 | "DBVDD3", | ||
575 | "CPVDD", | ||
576 | "SPKVDDL", | ||
577 | "SPKVDDR", | ||
578 | }; | ||
579 | |||
572 | static struct mfd_cell wm5102_devs[] = { | 580 | static struct mfd_cell wm5102_devs[] = { |
573 | { .name = "arizona-micsupp" }, | 581 | { .name = "arizona-micsupp" }, |
574 | { .name = "arizona-extcon" }, | 582 | { .name = "arizona-extcon" }, |
575 | { .name = "arizona-gpio" }, | 583 | { .name = "arizona-gpio" }, |
576 | { .name = "arizona-haptics" }, | 584 | { .name = "arizona-haptics" }, |
577 | { .name = "arizona-pwm" }, | 585 | { .name = "arizona-pwm" }, |
578 | { .name = "wm5102-codec" }, | 586 | { |
587 | .name = "wm5102-codec", | ||
588 | .parent_supplies = wm5102_supplies, | ||
589 | .num_parent_supplies = ARRAY_SIZE(wm5102_supplies), | ||
590 | }, | ||
579 | }; | 591 | }; |
580 | 592 | ||
581 | static struct mfd_cell wm5110_devs[] = { | 593 | static struct mfd_cell wm5110_devs[] = { |
@@ -584,7 +596,17 @@ static struct mfd_cell wm5110_devs[] = { | |||
584 | { .name = "arizona-gpio" }, | 596 | { .name = "arizona-gpio" }, |
585 | { .name = "arizona-haptics" }, | 597 | { .name = "arizona-haptics" }, |
586 | { .name = "arizona-pwm" }, | 598 | { .name = "arizona-pwm" }, |
587 | { .name = "wm5110-codec" }, | 599 | { |
600 | .name = "wm5110-codec", | ||
601 | .parent_supplies = wm5102_supplies, | ||
602 | .num_parent_supplies = ARRAY_SIZE(wm5102_supplies), | ||
603 | }, | ||
604 | }; | ||
605 | |||
606 | static const char *wm8997_supplies[] = { | ||
607 | "DBVDD2", | ||
608 | "CPVDD", | ||
609 | "SPKVDD", | ||
588 | }; | 610 | }; |
589 | 611 | ||
590 | static struct mfd_cell wm8997_devs[] = { | 612 | static struct mfd_cell wm8997_devs[] = { |
@@ -593,7 +615,11 @@ static struct mfd_cell wm8997_devs[] = { | |||
593 | { .name = "arizona-gpio" }, | 615 | { .name = "arizona-gpio" }, |
594 | { .name = "arizona-haptics" }, | 616 | { .name = "arizona-haptics" }, |
595 | { .name = "arizona-pwm" }, | 617 | { .name = "arizona-pwm" }, |
596 | { .name = "wm8997-codec" }, | 618 | { |
619 | .name = "wm8997-codec", | ||
620 | .parent_supplies = wm8997_supplies, | ||
621 | .num_parent_supplies = ARRAY_SIZE(wm8997_supplies), | ||
622 | }, | ||
597 | }; | 623 | }; |
598 | 624 | ||
599 | int arizona_dev_init(struct arizona *arizona) | 625 | int arizona_dev_init(struct arizona *arizona) |
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 53f371dcbb6e..b9ce60c301de 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c | |||
@@ -480,7 +480,6 @@ static struct clk_mgt clk_mgt[PRCMU_NUM_REG_CLOCKS] = { | |||
480 | CLK_MGT_ENTRY(PER6CLK, PLL_DIV, true), | 480 | CLK_MGT_ENTRY(PER6CLK, PLL_DIV, true), |
481 | CLK_MGT_ENTRY(PER7CLK, PLL_DIV, true), | 481 | CLK_MGT_ENTRY(PER7CLK, PLL_DIV, true), |
482 | CLK_MGT_ENTRY(LCDCLK, PLL_FIX, true), | 482 | CLK_MGT_ENTRY(LCDCLK, PLL_FIX, true), |
483 | CLK_MGT_ENTRY(BML8580CLK, PLL_DIV, true), | ||
484 | CLK_MGT_ENTRY(BMLCLK, PLL_DIV, true), | 483 | CLK_MGT_ENTRY(BMLCLK, PLL_DIV, true), |
485 | CLK_MGT_ENTRY(HSITXCLK, PLL_DIV, true), | 484 | CLK_MGT_ENTRY(HSITXCLK, PLL_DIV, true), |
486 | CLK_MGT_ENTRY(HSIRXCLK, PLL_DIV, true), | 485 | CLK_MGT_ENTRY(HSIRXCLK, PLL_DIV, true), |
diff --git a/drivers/mfd/dbx500-prcmu-regs.h b/drivers/mfd/dbx500-prcmu-regs.h index 4f6f0fa5d3b7..7cc32a8ff01c 100644 --- a/drivers/mfd/dbx500-prcmu-regs.h +++ b/drivers/mfd/dbx500-prcmu-regs.h | |||
@@ -32,7 +32,6 @@ | |||
32 | #define PRCM_PER7CLK_MGT (0x040) | 32 | #define PRCM_PER7CLK_MGT (0x040) |
33 | #define PRCM_LCDCLK_MGT (0x044) | 33 | #define PRCM_LCDCLK_MGT (0x044) |
34 | #define PRCM_BMLCLK_MGT (0x04C) | 34 | #define PRCM_BMLCLK_MGT (0x04C) |
35 | #define PRCM_BML8580CLK_MGT (0x108) | ||
36 | #define PRCM_HSITXCLK_MGT (0x050) | 35 | #define PRCM_HSITXCLK_MGT (0x050) |
37 | #define PRCM_HSIRXCLK_MGT (0x054) | 36 | #define PRCM_HSIRXCLK_MGT (0x054) |
38 | #define PRCM_HDMICLK_MGT (0x058) | 37 | #define PRCM_HDMICLK_MGT (0x058) |
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 @@ | |||
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | #include <linux/irqdomain.h> | 21 | #include <linux/irqdomain.h> |
22 | #include <linux/of.h> | 22 | #include <linux/of.h> |
23 | #include <linux/regulator/consumer.h> | ||
23 | 24 | ||
24 | static struct device_type mfd_dev_type = { | 25 | static struct device_type mfd_dev_type = { |
25 | .name = "mfd_device", | 26 | .name = "mfd_device", |
@@ -99,6 +100,13 @@ static int mfd_add_device(struct device *parent, int id, | |||
99 | pdev->dev.dma_mask = parent->dma_mask; | 100 | pdev->dev.dma_mask = parent->dma_mask; |
100 | pdev->dev.dma_parms = parent->dma_parms; | 101 | pdev->dev.dma_parms = parent->dma_parms; |
101 | 102 | ||
103 | ret = devm_regulator_bulk_register_supply_alias( | ||
104 | &pdev->dev, cell->parent_supplies, | ||
105 | parent, cell->parent_supplies, | ||
106 | cell->num_parent_supplies); | ||
107 | if (ret < 0) | ||
108 | goto fail_res; | ||
109 | |||
102 | if (parent->of_node && cell->of_compatible) { | 110 | if (parent->of_node && cell->of_compatible) { |
103 | for_each_child_of_node(parent->of_node, np) { | 111 | for_each_child_of_node(parent->of_node, np) { |
104 | if (of_device_is_compatible(np, cell->of_compatible)) { | 112 | if (of_device_is_compatible(np, cell->of_compatible)) { |
@@ -112,12 +120,12 @@ static int mfd_add_device(struct device *parent, int id, | |||
112 | ret = platform_device_add_data(pdev, | 120 | ret = platform_device_add_data(pdev, |
113 | cell->platform_data, cell->pdata_size); | 121 | cell->platform_data, cell->pdata_size); |
114 | if (ret) | 122 | if (ret) |
115 | goto fail_res; | 123 | goto fail_alias; |
116 | } | 124 | } |
117 | 125 | ||
118 | ret = mfd_platform_add_cell(pdev, cell); | 126 | ret = mfd_platform_add_cell(pdev, cell); |
119 | if (ret) | 127 | if (ret) |
120 | goto fail_res; | 128 | goto fail_alias; |
121 | 129 | ||
122 | for (r = 0; r < cell->num_resources; r++) { | 130 | for (r = 0; r < cell->num_resources; r++) { |
123 | res[r].name = cell->resources[r].name; | 131 | res[r].name = cell->resources[r].name; |
@@ -152,17 +160,17 @@ static int mfd_add_device(struct device *parent, int id, | |||
152 | if (!cell->ignore_resource_conflicts) { | 160 | if (!cell->ignore_resource_conflicts) { |
153 | ret = acpi_check_resource_conflict(&res[r]); | 161 | ret = acpi_check_resource_conflict(&res[r]); |
154 | if (ret) | 162 | if (ret) |
155 | goto fail_res; | 163 | goto fail_alias; |
156 | } | 164 | } |
157 | } | 165 | } |
158 | 166 | ||
159 | ret = platform_device_add_resources(pdev, res, cell->num_resources); | 167 | ret = platform_device_add_resources(pdev, res, cell->num_resources); |
160 | if (ret) | 168 | if (ret) |
161 | goto fail_res; | 169 | goto fail_alias; |
162 | 170 | ||
163 | ret = platform_device_add(pdev); | 171 | ret = platform_device_add(pdev); |
164 | if (ret) | 172 | if (ret) |
165 | goto fail_res; | 173 | goto fail_alias; |
166 | 174 | ||
167 | if (cell->pm_runtime_no_callbacks) | 175 | if (cell->pm_runtime_no_callbacks) |
168 | pm_runtime_no_callbacks(&pdev->dev); | 176 | pm_runtime_no_callbacks(&pdev->dev); |
@@ -171,6 +179,10 @@ static int mfd_add_device(struct device *parent, int id, | |||
171 | 179 | ||
172 | return 0; | 180 | return 0; |
173 | 181 | ||
182 | fail_alias: | ||
183 | devm_regulator_bulk_unregister_supply_alias(&pdev->dev, | ||
184 | cell->parent_supplies, | ||
185 | cell->num_parent_supplies); | ||
174 | fail_res: | 186 | fail_res: |
175 | kfree(res); | 187 | kfree(res); |
176 | fail_device: | 188 | fail_device: |