@@ -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;
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(-)