lkml.org 
[lkml]   [2015]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: multi-codec support for arizona-ldo1 was Re: System with multiple arizona (wm5102) codecs
Hi!

> > > Every single sound driver gets this right, none of them assume the name
> > > is global. What makes you say that they assume names are global?
>
> > Ok, so you are saying that if I fix mfd initialization, sound will
> > automagically switch from global regulators to device-specific
> > regulators and things will start working?
>
> Yes.

Ok, so something like this should be applied?

(I'm not sure how to test it, as audio works before and after the
patch.)

Thanks,
Pavel

Signed-off-by: Pavel Machek <pavel@denx.de>

commit d6005263acb94343645e719ee90b8940cb2545df
Author: Pavel <pavel@ucw.cz>
Date: Mon Nov 16 13:19:21 2015 +0100

regulator_bulk_register() needs device to be already
registered. Reorganize the code to make it so.

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 14fd5cb..e891f10 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -147,12 +147,6 @@ static int mfd_add_device(struct device *parent, int id,
pdev->dev.dma_parms = parent->dma_parms;
pdev->dev.coherent_dma_mask = parent->coherent_dma_mask;

- ret = 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) {
@@ -169,12 +176,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_alias;
+ goto fail_res;
}

ret = mfd_platform_add_cell(pdev, cell, usage_count);
if (ret)
- goto fail_alias;
+ goto fail_res;

for (r = 0; r < cell->num_resources; r++) {
res[r].name = cell->resources[r].name;
@@ -210,22 +217,29 @@ static int mfd_add_device(struct device *parent, int id,
if (has_acpi_companion(&pdev->dev)) {
ret = acpi_check_resource_conflict(&res[r]);
if (ret)
- goto fail_alias;
+ goto fail_res;
}
}
}

ret = platform_device_add_resources(pdev, res, cell->num_resources);
if (ret)
- goto fail_alias;
+ goto fail_res;

ret = platform_device_add(pdev);
if (ret)
- goto fail_alias;
+ goto fail_res;

if (cell->pm_runtime_no_callbacks)
pm_runtime_no_callbacks(&pdev->dev);

+ ret = regulator_bulk_register_supply_alias(
+ &pdev->dev, cell->parent_supplies,
+ parent, cell->parent_supplies,
+ cell->num_parent_supplies);
+ if (ret < 0)
+ goto fail_alias;
+
kfree(res);

return 0;

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2015-11-16 13:41    [W:0.036 / U:12.696 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site