2011-03-09 20:46:42

by Marek Belisko

[permalink] [raw]
Subject: [PATCH RFC] arm: mini2440: Fix uda134x codec problem.

ASoC audio for mini2440 platform in current kenrel doesn't work.
First problem is samsung_asoc_dma device is missing in initialization.
Next problem is with codec. Codec is initialized but never probed
because no platform_device exist for codec driver. It leads to errors
during codec binding to asoc dai. Next problem was platform data which
was passed from board to asoc main driver but not passed to codec when
called codec_soc_probe().

Following patch should fix issues. But not sure if in correct way.
Please review.

Signed-off-by: Marek Belisko <[email protected]>
---
arch/arm/mach-s3c2440/mach-mini2440.c | 7 +++++++
sound/soc/codecs/uda134x.c | 3 ++-
sound/soc/samsung/s3c24xx_uda134x.c | 3 ++-
3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index f62bb4c..7c3fb07 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -506,6 +506,11 @@ static struct i2c_board_info mini2440_i2c_devs[] __initdata = {
},
};

+static struct platform_device uda1340_codec = {
+ .name = "uda134x-codec",
+ .id = -1,
+};
+
static struct platform_device *mini2440_devices[] __initdata = {
&s3c_device_ohci,
&s3c_device_wdt,
@@ -521,7 +526,9 @@ static struct platform_device *mini2440_devices[] __initdata = {
&s3c_device_nand,
&s3c_device_sdi,
&s3c_device_iis,
+ &uda1340_codec,
&mini2440_audio,
+ &samsung_asoc_dma,
};

static void __init mini2440_map_io(void)
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c
index e76847a..48ffd40 100644
--- a/sound/soc/codecs/uda134x.c
+++ b/sound/soc/codecs/uda134x.c
@@ -486,7 +486,8 @@ static struct snd_soc_dai_driver uda134x_dai = {
static int uda134x_soc_probe(struct snd_soc_codec *codec)
{
struct uda134x_priv *uda134x;
- struct uda134x_platform_data *pd = dev_get_drvdata(codec->card->dev);
+ struct uda134x_platform_data *pd = codec->card->dev->platform_data;
+
int ret;

printk(KERN_INFO "UDA134X SoC Audio Codec\n");
diff --git a/sound/soc/samsung/s3c24xx_uda134x.c b/sound/soc/samsung/s3c24xx_uda134x.c
index 2c09e93..86f1dc4 100644
--- a/sound/soc/samsung/s3c24xx_uda134x.c
+++ b/sound/soc/samsung/s3c24xx_uda134x.c
@@ -226,7 +226,7 @@ static struct snd_soc_ops s3c24xx_uda134x_ops = {
static struct snd_soc_dai_link s3c24xx_uda134x_dai_link = {
.name = "UDA134X",
.stream_name = "UDA134X",
- .codec_name = "uda134x-hifi",
+ .codec_name = "uda134x-codec",
.codec_dai_name = "uda134x-hifi",
.cpu_dai_name = "s3c24xx-iis",
.ops = &s3c24xx_uda134x_ops,
@@ -321,6 +321,7 @@ static int s3c24xx_uda134x_probe(struct platform_device *pdev)

platform_set_drvdata(s3c24xx_uda134x_snd_device,
&snd_soc_s3c24xx_uda134x);
+ platform_device_add_data(s3c24xx_uda134x_snd_device, &s3c24xx_uda134x, sizeof(s3c24xx_uda134x));
ret = platform_device_add(s3c24xx_uda134x_snd_device);
if (ret) {
printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: Unable to add\n");
--
1.7.1


2011-03-11 12:14:17

by Liam Girdwood

[permalink] [raw]
Subject: Re: [PATCH RFC] arm: mini2440: Fix uda134x codec problem.

On Wed, 2011-03-09 at 21:46 +0100, Marek Belisko wrote:
> ASoC audio for mini2440 platform in current kenrel doesn't work.
> First problem is samsung_asoc_dma device is missing in initialization.
> Next problem is with codec. Codec is initialized but never probed
> because no platform_device exist for codec driver. It leads to errors
> during codec binding to asoc dai. Next problem was platform data which
> was passed from board to asoc main driver but not passed to codec when
> called codec_soc_probe().
>
> Following patch should fix issues. But not sure if in correct way.
> Please review.
>
> Signed-off-by: Marek Belisko <[email protected]>

Acked-by: Liam Girdwood <[email protected]>

2011-03-11 12:17:08

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH RFC] arm: mini2440: Fix uda134x codec problem.

On Wed, Mar 09, 2011 at 09:46:20PM +0100, Marek Belisko wrote:
> ASoC audio for mini2440 platform in current kenrel doesn't work.
> First problem is samsung_asoc_dma device is missing in initialization.
> Next problem is with codec. Codec is initialized but never probed

Applied, thanks. With changes like this you should really split things
up into a small patch series - if you ever find yourself writing
"Next problem..." or "Also..." then going on to describe a separate
change that's a sign that you should be writing a separate patch.

2011-03-11 12:23:41

by Belisko Marek

[permalink] [raw]
Subject: Re: [PATCH RFC] arm: mini2440: Fix uda134x codec problem.

On Fri, Mar 11, 2011 at 1:17 PM, Mark Brown
<[email protected]> wrote:
> On Wed, Mar 09, 2011 at 09:46:20PM +0100, Marek Belisko wrote:
>> ASoC audio for mini2440 platform in current kenrel doesn't work.
>> First problem is samsung_asoc_dma device is missing in initialization.
>> Next problem is with codec. Codec is initialized but never probed
>
> Applied, thanks.  With changes like this you should really split things
> up into a small patch series - if you ever find yourself writing
> "Next problem..." or "Also..." then going on to describe a separate
> change that's a sign that you should be writing a separate patch.
You're right. I think sending whole patch to help understand what
I'm trying to do (because wasn't sure). You apply just asoc part right?
Thanks for comments!
>

regards,

marek

--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com

2011-03-11 12:26:42

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH RFC] arm: mini2440: Fix uda134x codec problem.

On Fri, Mar 11, 2011 at 01:23:37PM +0100, Belisko Marek wrote:

> You're right. I think sending whole patch to help understand what
> I'm trying to do (because wasn't sure). You apply just asoc part right?
> Thanks for comments!

I applied everything, Ben has said he is very busy so it seemed easiest
to just merge the whole thing.

2011-03-21 23:29:52

by Ben Dooks

[permalink] [raw]
Subject: Re: [PATCH RFC] arm: mini2440: Fix uda134x codec problem.

On Fri, Mar 11, 2011 at 12:26:37PM +0000, Mark Brown wrote:
> On Fri, Mar 11, 2011 at 01:23:37PM +0100, Belisko Marek wrote:
>
> > You're right. I think sending whole patch to help understand what
> > I'm trying to do (because wasn't sure). You apply just asoc part right?
> > Thanks for comments!
>
> I applied everything, Ben has said he is very busy so it seemed easiest
> to just merge the whole thing.

That's fine, and as long as it doesn't mess up other merges I'm generally
ok with this.

--
Ben Dooks, [email protected], http://www.fluff.org/ben/

Large Hadron Colada: A large Pina Colada that makes the universe disappear.