Skip to contentSkip to conversation

ASoC: Samsung: Debug PCM snd_soc_dai_driver registration

PATCH Applied Jassi Brar 2 participants 7 messages Sep 10, 2010 – Sep 14, 2010

Subsystems (2)
lore
Share & tools
lore

Jassi Brar

author
#0 lore raw

PATCH 2/3 ASoC: Samsung: Debug PCM snd_soc_dai_driver registration

From: Jassi Brar <[email protected]>

Each of the two PCM controllers need to be registered during probe with appropriate 'name' of the dai driver.

---
 sound/soc/s3c24xx/s3c-pcm.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
sound/soc/s3c24xx/s3c-pcm.c +10 -7
index 6174e26..d404f80 100644
@@ -361,8 +361,6 @@ static struct snd_soc_dai_ops s3c_pcm_dai_ops = {
 #define S3C_PCM_RATES  SNDRV_PCM_RATE_8000_96000
 
 #define S3C_PCM_DAI_DECLARE			\
-{								\
-	.name		 = "samsung-dai",			\
 	.symmetric_rates = 1,					\
 	.ops = &s3c_pcm_dai_ops,				\
 	.playback = {						\
@@ -376,12 +374,17 @@ static struct snd_soc_dai_ops s3c_pcm_dai_ops = {
 		.channels_max	= 2,				\
 		.rates		= S3C_PCM_RATES,		\
 		.formats	= SNDRV_PCM_FMTBIT_S16_LE,	\
-	},							\
-}
+	}
 
 struct snd_soc_dai_driver s3c_pcm_dai[] = {
-	S3C_PCM_DAI_DECLARE,
-	S3C_PCM_DAI_DECLARE,
+	[0] = {
+		.name	= "samsung-pcm.0",
+		S3C_PCM_DAI_DECLARE,
+	},
+	[1] = {
+		.name	= "samsung-pcm.1",
+		S3C_PCM_DAI_DECLARE,
+	},
 };
 EXPORT_SYMBOL_GPL(s3c_pcm_dai);
 
@@ -465,7 +468,7 @@ static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev)
 	}
 	clk_enable(pcm->pclk);
 
-	ret = snd_soc_register_dai(&pdev->dev, s3c_pcm_dai);
+	ret = snd_soc_register_dai(&pdev->dev, &s3c_pcm_dai[pdev->id]);
 	if (ret != 0) {
 		dev_err(&pdev->dev, "failed to get pcm_clock\n");
 		goto err5;
Signature · 1 line
1.6.2.5
#1 lore raw

sound/soc/s3c24xx/s3c-pcm.c static struct snd_soc_dai_ops s3c_pcm_dai_ops = { · line 382

Quoted 6 lines · Jassi Brar

struct snd_soc_dai_driver s3c_pcm_dai[] = {

sound/soc/s3c24xx/s3c-pcm.c +3 -2
-	S3C_PCM_DAI_DECLARE,
-	S3C_PCM_DAI_DECLARE,
+	[0] = {
+		.name	= "samsung-pcm.0",
+		S3C_PCM_DAI_DECLARE,

You should be able to use the id field rather than adding the number to the names here.

author
#2 lore raw

2010/9/10 Mark Brown <[email protected]>:

Quoted 11 lines · Jassi Brar
Quoted 7 lines

 struct snd_soc_dai_driver s3c_pcm_dai[] = {
-     S3C_PCM_DAI_DECLARE,
-     S3C_PCM_DAI_DECLARE,
+     [0] = {
+             .name   = "samsung-pcm.0",
+             S3C_PCM_DAI_DECLARE,

You should be able to use the id field rather than adding the number to the names here.

But the id assignment was removed by Liam's patch, maybe unintentional ?
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw
Quoted 6 lines · Jassi Brar

2010/9/10 Mark Brown <[email protected]>:

Quoted 2 lines

You should be able to use the id field rather than adding the number to the names here.

But the id assignment was removed by Liam's patch, maybe unintentional ?

Most likely an error - earlier versions of the patches didn't have the separate ID field IIRC.

author
#4 lore raw
Quoted 11 lines · Mark Brown
Quoted 6 lines · Jassi Brar

2010/9/10 Mark Brown <[email protected]>:

Quoted 2 lines

You should be able to use the id field rather than adding the number to the names here.

But the id assignment was removed by Liam's patch, maybe unintentional ?

Most likely an error - earlier versions of the patches didn't have the separate ID field IIRC.

ok, but I don't seem to be able to find out where snd_soc_dai_driver.id is being used
and sound/soc/sh/hac.c and sound/soc/atmel/atmel_ssc_dai.c seems to be doing similar
Are we on the same page? Please help me understand it.

#5 lore raw
Quoted 2 lines · Jassi Brar

ok, but I don't seem to be able to find out where
snd_soc_dai_driver.id is being used

Meh, actually it's ignored in the driver and concocted from the device. The id field should just go from the driver structure, sorry.

Quoted 3 lines

and sound/soc/sh/hac.c and sound/soc/atmel/atmel_ssc_dai.c seems to be doing similar
Are we on the same page? Please help me understand it.

Neither of these platforms are especially good to use as references - for multi-component Liam was working mostly with OMAP.