[PATCH][RFC] ASoC: atmel: atmel-classd: use modern style dai_link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now ALSA SoC is supporting modern style (= snd_soc_dai_link_component)
dai_link for CPU/Codec/Platform, let's switch to it from legacy style.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
 sound/soc/atmel/atmel-classd.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c
index 3d70061..5b662a2 100644
--- a/sound/soc/atmel/atmel-classd.c
+++ b/sound/soc/atmel/atmel-classd.c
@@ -499,18 +499,28 @@ static int atmel_classd_asoc_card_init(struct device *dev,
 					struct snd_soc_card *card)
 {
 	struct snd_soc_dai_link *dai_link;
+	struct snd_soc_dai_link_component *dlc;
 	struct atmel_classd *dd = snd_soc_card_get_drvdata(card);
 
 	dai_link = devm_kzalloc(dev, sizeof(*dai_link), GFP_KERNEL);
-	if (!dai_link)
+	/* cpu/codec/platform */
+	dlc = devm_kzalloc(dev, sizeof(*dlc) * 3, GFP_KERNEL);
+	if (!dai_link || !dlc)
 		return -ENOMEM;
 
 	dai_link->name			= "CLASSD";
 	dai_link->stream_name		= "CLASSD PCM";
-	dai_link->codec_dai_name	= ATMEL_CLASSD_CODEC_DAI_NAME;
-	dai_link->cpu_dai_name		= dev_name(dev);
-	dai_link->codec_name		= dev_name(dev);
-	dai_link->platform_name		= dev_name(dev);
+	dai_link->cpus			= &dlc[0];
+	dai_link->num_cpus		= 1;
+	dai_link->codecs		= &dlc[1];
+	dai_link->num_codecs		= 1;
+	dai_link->platforms		= &dlc[2];
+	dai_link->num_platforms		= 1;
+
+	dai_link->codecs->dai_name	= ATMEL_CLASSD_CODEC_DAI_NAME;
+	dai_link->cpus->dai_name	= dev_name(dev);
+	dai_link->codecs->name		= dev_name(dev);
+	dai_link->platforms->name	= dev_name(dev);
 
 	card->dai_link	= dai_link;
 	card->num_links	= 1;
-- 
2.7.4

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



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux