diff mbox series

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

Message ID 875zupm2z7.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show
Series [RFC] ASoC: atmel: atmel-classd: use modern style dai_link | expand

Commit Message

Kuninori Morimoto Jan. 16, 2019, 8:27 a.m. UTC
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@renesas.com>
---
 sound/soc/atmel/atmel-classd.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
diff mbox series

Patch

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;