alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Mallon <ryan@bluewatersys.com>
To: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: vbarinov <vbarinov@embeddedalley.com>,
	alsa-devel <alsa-devel@alsa-project.org>,
	jassisinghbrar <jassisinghbrar@gmail.com>,
	Wan ZongShun <mcuos.com@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Peter Ujfalusi <peter.ujfalusi@nokia.com>,
	Cliff Cai <cliff.cai@analog.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Sedji Gaouaou <sedji.gaouaou@atmel.com>,
	"timur.tabi@gmail.com" <timur.tabi@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	"Candelaria Villareal, Jorge" <jorge.candelaria@ti.com>,
	"vaibhav.bedia" <vaibhav.bedia@ti.com>,
	Kuninori Morimoto <morimoto.kuninori@renesas.com>
Subject: Re: [RFC 0/5] ASoC multi-component support : core
Date: Fri, 25 Jun 2010 09:36:00 +1200	[thread overview]
Message-ID: <4C23CFC0.6080700@bluewatersys.com> (raw)
In-Reply-To: <1277407467.3100.579.camel@odin>

On 06/25/2010 07:24 AM, Liam Girdwood wrote:
> If you find your platform does not work then the most likely reason is
> that I'm missing a platform_device registration for your CODEC, DAI,
> etc. device in your arch board.c or device.c files. Please let me know
> or send a patch :)
>   
Hi Liam,

The following patch fixes the build errors and warnings for the
ep93xx/Snapper CL15. However, I still get 'No soundcards found' during
boot. The ep3xx-pcm-audio, ep93xx-i2s and soc-audio devices are all
present under /sys/bus/platform/devices. Any ideas?

Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
---

diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 67dc876..b5261d4 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -732,9 +732,15 @@ static struct platform_device ep93xx_i2s_device = {
 	.resource	= ep93xx_i2s_resource,
 };
 
+static struct platform_device ep93xx_pcm_device = {
+	.name		= "ep93xx-pcm-audio",
+	.id		= -1,
+};
+
 void __init ep93xx_register_i2s(void)
 {
 	platform_device_register(&ep93xx_i2s_device);
+	platform_device_register(&ep93xx_pcm_device);
 }
 
 #define EP93XX_SYSCON_DEVCFG_I2S_MASK	(EP93XX_SYSCON_DEVCFG_I2SONSSP | \
@@ -798,6 +804,4 @@ void __init ep93xx_init_devices(void)
 	platform_device_register(&ep93xx_rtc_device);
 	platform_device_register(&ep93xx_ohci_device);
 	platform_device_register(&ep93xx_leds);
-	platform_device_register(&ep93xx_i2s_device);
-	platform_device_register(&ep93xx_pcm_device);
 }
diff --git a/sound/soc/ep93xx/ep93xx-i2s.c b/sound/soc/ep93xx/ep93xx-i2s.c
index b40201f..6e0fa03 100644
--- a/sound/soc/ep93xx/ep93xx-i2s.c
+++ b/sound/soc/ep93xx/ep93xx-i2s.c
@@ -146,6 +146,7 @@ static int ep93xx_i2s_startup(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct ep93xx_i2s_info *info = snd_soc_dai_get_drvdata(dai);
+	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 
 	snd_soc_dai_set_dma_data(cpu_dai, substream,
 				 &info->dma_params[substream->stream]);
@@ -155,7 +156,6 @@ static int ep93xx_i2s_startup(struct snd_pcm_substream *substream,
 static void ep93xx_i2s_shutdown(struct snd_pcm_substream *substream,
 				struct snd_soc_dai *dai)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct ep93xx_i2s_info *info = snd_soc_dai_get_drvdata(dai);
 
 	ep93xx_i2s_disable(info, substream->stream);
@@ -241,7 +241,6 @@ static int ep93xx_i2s_hw_params(struct snd_pcm_substream *substream,
 				struct snd_pcm_hw_params *params,
 				struct snd_soc_dai *dai)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct ep93xx_i2s_info *info = snd_soc_dai_get_drvdata(dai);
 	unsigned word_len, div, sdiv, lrdiv;
 	int found = 0, err;
diff --git a/sound/soc/ep93xx/snappercl15.c b/sound/soc/ep93xx/snappercl15.c
index 6495534..c34aa1f 100644
--- a/sound/soc/ep93xx/snappercl15.c
+++ b/sound/soc/ep93xx/snappercl15.c
@@ -30,8 +30,8 @@ static int snappercl15_hw_params(struct snd_pcm_substream *substream,
 				 struct snd_pcm_hw_params *params)
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
-	struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
-	struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+	struct snd_soc_dai *codec_dai = rtd->codec_dai;
+	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 	int err;
 
 	err = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
@@ -77,8 +77,10 @@ static const struct snd_soc_dapm_route audio_map[] = {
 	{"MICIN", NULL, "Mic Jack"},
 };
 
-static int snappercl15_tlv320aic23_init(struct snd_soc_codec *codec)
+static int snappercl15_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
 {
+	struct snd_soc_codec *codec = rtd->codec;
+
 	snd_soc_dapm_new_controls(codec, tlv320aic23_dapm_widgets,
 				  ARRAY_SIZE(tlv320aic23_dapm_widgets));
 
@@ -89,24 +91,19 @@ static int snappercl15_tlv320aic23_init(struct snd_soc_codec *codec)
 static struct snd_soc_dai_link snappercl15_dai = {
 	.name		= "tlv320aic23",
 	.stream_name	= "AIC23",
-	.cpu_dai	= &ep93xx_i2s_dai,
-	.codec_dai	= &tlv320aic23_dai,
+	.cpu_dai_drv	= &ep93xx_i2s_dai,
+	.codec_dai_drv	= &tlv320aic23_dai,
+	.platform_drv	= &ep93xx_soc_platform,
 	.init		= snappercl15_tlv320aic23_init,
 	.ops		= &snappercl15_ops,
 };
 
 static struct snd_soc_card snd_soc_snappercl15 = {
 	.name		= "Snapper CL15",
-	.platform	= &ep93xx_soc_platform,
 	.dai_link	= &snappercl15_dai,
 	.num_links	= 1,
 };
 
-static struct snd_soc_device snappercl15_snd_devdata = {
-	.card		= &snd_soc_snappercl15,
-	.codec_dev	= &soc_codec_dev_tlv320aic23,
-};
-
 static struct platform_device *snappercl15_snd_device;
 
 static int __init snappercl15_init(void)
@@ -126,8 +123,7 @@ static int __init snappercl15_init(void)
 	if (!snappercl15_snd_device)
 		return -ENOMEM;
 	
-	platform_set_drvdata(snappercl15_snd_device, &snappercl15_snd_devdata);
-	snappercl15_snd_devdata.dev = &snappercl15_snd_device->dev;
+	platform_set_drvdata(snappercl15_snd_device, &snd_soc_snappercl15);
 	ret = platform_device_add(snappercl15_snd_device);
 	if (ret)
 		platform_device_put(snappercl15_snd_device);

  reply	other threads:[~2010-06-24 21:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24 19:24 [RFC 0/5] ASoC multi-component support : core Liam Girdwood
2010-06-24 21:36 ` Ryan Mallon [this message]
2010-06-24 23:12   ` Mark Brown
2010-06-24 23:38     ` Ryan Mallon
2010-06-25  4:51       ` Ryan Mallon
2010-06-25  8:37         ` Liam Girdwood
2010-06-25 22:38           ` Ryan Mallon
2010-06-26 17:52             ` Liam Girdwood
2010-06-26  2:25 ` Wan ZongShun
2010-06-26 17:29   ` Liam Girdwood
2010-06-28  7:16 ` Jarkko Nikula
2010-07-01 19:35   ` Mark Brown
2010-07-01 19:55 ` [PATCH] ASoC: Use bool rather than 1 bit bitfield in multi-component Mark Brown
2010-07-05 21:10   ` Liam Girdwood
2010-07-01 20:01 ` [RFC 0/5] ASoC multi-component support : core Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C23CFC0.6080700@bluewatersys.com \
    --to=ryan@bluewatersys.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=cliff.cai@analog.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=jorge.candelaria@ti.com \
    --cc=lars@metafoo.de \
    --cc=lrg@slimlogic.co.uk \
    --cc=mcuos.com@gmail.com \
    --cc=morimoto.kuninori@renesas.com \
    --cc=peter.ujfalusi@nokia.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sedji.gaouaou@atmel.com \
    --cc=timur.tabi@gmail.com \
    --cc=vaibhav.bedia@ti.com \
    --cc=vbarinov@embeddedalley.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).