All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC/multi-component: fix au1x platform
@ 2010-08-19 13:21 Manuel Lauss
  2010-08-19 14:06 ` Mark Brown
  0 siblings, 1 reply; 12+ messages in thread
From: Manuel Lauss @ 2010-08-19 13:21 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown

[-- Attachment #1: Type: text/plain, Size: 1102 bytes --]

Hi Liam,

Attached is a patch which fixes the Alchemy (au1x) audio platform
in your "topic/multi-component" branch.

Tested on my Db1200.

One minor issue remains: with AC97, the following warning is generated,
courtesy of the generic ac97 codec:
asoc: ac97-hifi <-> au1xpsc-ac97.1 mapping ok
kobject (8fdc59b0): tried to init an initialized object, something is
seriously wrong.
Call Trace:
[<804959c4>] dump_stack+0x8/0x34
[<802a30e4>] kobject_init+0x50/0xcc
[<802ec27c>] device_initialize+0x2c/0x70
[<802ecb64>] device_register+0x14/0x28
[<8039e058>] snd_soc_instantiate_cards+0xa00/0xb10
[<8039e27c>] soc_probe+0x114/0x154
[<802ef0fc>] driver_probe_device+0xe4/0x1a0
[<802ee404>] bus_for_each_drv+0x60/0xb0
[<802ef370>] device_attach+0x74/0xa8
[<802ee1e8>] bus_probe_device+0x30/0x54
[<802ec9a0>] device_add+0x384/0x534
[<802f09a4>] platform_device_add+0x15c/0x1c8
[<805ccb14>] db1200_audio_load+0x70/0x9c
[<801004fc>] do_one_initcall+0xfc/0x1e0
[<805ba32c>] kernel_init+0xc8/0x168
[<80105904>] kernel_thread_helper+0x10/0x18

ALSA device list:
  #0: DB1200_AC97


Best regards,
      Manuel Lauss

[-- Attachment #2: 1000-ASoC-multi-component-fix-au1x-platform.patch --]
[-- Type: application/octet-stream, Size: 5613 bytes --]

From ef970bf6f84cee8eed8e4fa38f45fd5872d5b47b Mon Sep 17 00:00:00 2001
From: Manuel Lauss <manuel.lauss@googlemail.com>
Date: Thu, 19 Aug 2010 15:13:04 +0200
Subject: [PATCH] ASoC: multi-component: fix au1x platform

Fixes the au1x audio platform in Liam Girdwood's topic/multi-component branch.

Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
---
 arch/mips/alchemy/devboards/db1200/platform.c |   10 ++++++++--
 sound/soc/au1x/db1200.c                       |   18 +++++++++---------
 sound/soc/au1x/dbdma2.c                       |    7 +++++--
 sound/soc/au1x/psc-ac97.c                     |    7 +++++++
 sound/soc/au1x/psc-i2s.c                      |    9 ++++++++-
 5 files changed, 37 insertions(+), 14 deletions(-)

diff --git a/arch/mips/alchemy/devboards/db1200/platform.c b/arch/mips/alchemy/devboards/db1200/platform.c
index 3fa34c3..f985373 100644
--- a/arch/mips/alchemy/devboards/db1200/platform.c
+++ b/arch/mips/alchemy/devboards/db1200/platform.c
@@ -429,8 +429,14 @@ static struct platform_device db1200_audio_dev = {
 	.resource	= au1200_psc1_res,
 };
 
+static struct platform_device db1200_ac97_codec = {
+	.name		= "ac97-codec",
+	.id		= 1,	/* on PSC1 */
+};
+
 static struct platform_device *db1200_devs[] __initdata = {
 	NULL,		/* PSC0, selected by S6.8 */
+	&db1200_ac97_codec,
 	&db1200_ide_dev,
 	&db1200_eth_dev,
 	&db1200_rtc_dev,
@@ -494,11 +500,11 @@ static int __init db1200_dev_init(void)
 	sw &= BCSR_SWITCHES_DIP_8 | BCSR_SWITCHES_DIP_7;
 	if (sw == BCSR_SWITCHES_DIP_8) {
 		bcsr_mod(BCSR_RESETS, 0, BCSR_RESETS_PSC1MUX);
-		db1200_audio_dev.name = "au1xpsc_i2s";
+		db1200_audio_dev.name = "au1xpsc-i2s";
 		printk(KERN_INFO " S6.7 ON : PSC1 mode I2S\n");
 	} else {
 		bcsr_mod(BCSR_RESETS, BCSR_RESETS_PSC1MUX, 0);
-		db1200_audio_dev.name = "au1xpsc_ac97";
+		db1200_audio_dev.name = "au1xpsc-ac97";
 		printk(KERN_INFO " S6.7 OFF: PSC1 mode AC97\n");
 	}
 
diff --git a/sound/soc/au1x/db1200.c b/sound/soc/au1x/db1200.c
index 8780c90..2065d03 100644
--- a/sound/soc/au1x/db1200.c
+++ b/sound/soc/au1x/db1200.c
@@ -26,11 +26,11 @@
 
 static struct snd_soc_dai_link db1200_ac97_dai = {
 	.name		= "AC97",
-	.stream_name	= "AC97 HiFi",
-	.cpu_dai_name	= "au1xpsc-ac97",
+	.stream_name	= "AC97 Playback",
+	.cpu_dai_name	= "au1xpsc-ac97.1",
 	.codec_dai_name	= "ac97-hifi",
-	.platform_name	=  "au1xpsc-pcm-audio",
-	.codec_name	= "ac97-codec",
+	.platform_name	= "au1xpsc-pcm-audio.1",
+	.codec_name	= "ac97-codec.1",
 };
 
 static struct snd_soc_card db1200_ac97_machine = {
@@ -74,11 +74,11 @@ static struct snd_soc_ops db1200_i2s_wm8731_ops = {
 
 static struct snd_soc_dai_link db1200_i2s_dai = {
 	.name		= "WM8731",
-	.stream_name	= "WM8731 PCM",
-	.cpu_dai_name	= "au1xpsc",
-	.codec_dai_name	= "wm8731-hifi"
-	.platform_name	= "au1xpsc-pcm-audio",
-	.codec_name	= "wm8731-codec.0-001a",
+	.stream_name	= "WM8731",
+	.cpu_dai_name	= "au1xpsc-i2s.1",
+	.codec_dai_name	= "wm8731-hifi",
+	.platform_name	= "au1xpsc-pcm-audio.1",
+	.codec_name	= "wm8731-codec.0-001b",
 	.ops		= &db1200_i2s_wm8731_ops,
 };
 
diff --git a/sound/soc/au1x/dbdma2.c b/sound/soc/au1x/dbdma2.c
index 00fdb9c..b6d3db8 100644
--- a/sound/soc/au1x/dbdma2.c
+++ b/sound/soc/au1x/dbdma2.c
@@ -344,7 +344,6 @@ struct snd_soc_platform_driver au1xpsc_soc_platform = {
 	.pcm_new	= au1xpsc_pcm_new,
 	.pcm_free	= au1xpsc_pcm_free_dma_buffers,
 };
-EXPORT_SYMBOL_GPL(au1xpsc_soc_platform);
 
 static int __devinit au1xpsc_pcm_drvprobe(struct platform_device *pdev)
 {
@@ -460,7 +459,11 @@ struct platform_device *au1xpsc_pcm_add(struct platform_device *pdev)
 	res[1].start = res[1].end = id[1];
 	res[0].flags = res[1].flags = IORESOURCE_DMA;
 
-	pd = platform_device_alloc("au1xpsc-pcm", -1);
+	/* match the device id with the PSC instance that is registering
+	 * us.  May be useful when ASoC one day can handle multiple independent
+	 * "cards".
+	 */
+	pd = platform_device_alloc("au1xpsc-pcm-audio", pdev->id);
 	if (!pd)
 		goto out;
 
diff --git a/sound/soc/au1x/psc-ac97.c b/sound/soc/au1x/psc-ac97.c
index 6a9516c..8f6c4f4 100644
--- a/sound/soc/au1x/psc-ac97.c
+++ b/sound/soc/au1x/psc-ac97.c
@@ -387,6 +387,13 @@ static int __devinit au1xpsc_ac97_drvprobe(struct platform_device *pdev)
 	au_writel(PSC_SEL_PS_AC97MODE | sel, PSC_SEL(wd));
 	au_sync();
 
+	/* name the DAI after this devices' instance ("au1xpsc-ac97.PSCINDEX").
+	 * XXX: Useful if ASoC ever gains the ability to handle multiple
+	 * independent "cards" (don't forget to dynamically allocate
+	 * the snd_soc_dai_driver structure then)
+	 */
+	au1xpsc_ac97_dai.name = kobject_name(&pdev->dev.kobj);
+
 	ret = snd_soc_register_dai(&pdev->dev, &au1xpsc_ac97_dai);
 	if (ret)
 		goto out1;
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c
index 94e560a..2e7e599 100644
--- a/sound/soc/au1x/psc-i2s.c
+++ b/sound/soc/au1x/psc-i2s.c
@@ -337,6 +337,13 @@ static int __devinit au1xpsc_i2s_drvprobe(struct platform_device *pdev)
 	 * time out.
 	 */
 
+	/* name the DAI after this devices' instance ("au1xpsc-i2s.PSCINDEX").
+	 * XXX: Useful if ASoC ever gains the ability to handle multiple
+	 * independent "cards" (don't forget to dynamically allocate
+	 * the snd_soc_dai_driver structure then)
+	 */
+	au1xpsc_i2s_dai.name = kobject_name(&pdev->dev.kobj);
+
 	ret = snd_soc_register_dai(&pdev->dev, &au1xpsc_i2s_dai);
 	if (ret)
 		goto out1;
@@ -427,7 +434,7 @@ static struct dev_pm_ops au1xpsci2s_pmops = {
 
 static struct platform_driver au1xpsc_i2s_driver = {
 	.driver		= {
-		.name	= "au1xpsc",
+		.name	= "au1xpsc-i2s",
 		.owner	= THIS_MODULE,
 		.pm	= AU1XPSCI2S_PMOPS,
 	},
-- 
1.7.2


[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-08-19 16:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-19 13:21 [PATCH] ASoC/multi-component: fix au1x platform Manuel Lauss
2010-08-19 14:06 ` Mark Brown
2010-08-19 14:30   ` Manuel Lauss
2010-08-19 14:35     ` Mark Brown
2010-08-19 14:39       ` Manuel Lauss
2010-08-19 14:48         ` Mark Brown
2010-08-19 14:58           ` Manuel Lauss
2010-08-19 15:17             ` Manuel Lauss
2010-08-19 15:52             ` Mark Brown
2010-08-19 15:59               ` Manuel Lauss
2010-08-19 16:06                 ` Mark Brown
2010-08-19 16:21                   ` Manuel Lauss

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.