From 51966603da5054e252f1e20162a684a66762d930 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Wed, 5 Aug 2020 02:30:53 +0100 Subject: [PATCH] v5.3: support snd_soc_dai_link_component style for cpu commit f107294c6422e772773b53dbf802186175b6289e Author: Kuninori Morimoto Date: Thu Jun 6 13:07:35 2019 +0900 ASoC: simple-card: support snd_soc_dai_link_component style for cpu ASoC supports modern style dai_link (= snd_soc_dai_link_component) for CPU. legacy style dai_link (= cpu_dai_name, cpu_name, cpu_of_node) are no longer needed. This patch switches to modern style. --- seeed-voicecard.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/seeed-voicecard.c b/seeed-voicecard.c index 0b0fb8f..2ee7966 100644 --- a/seeed-voicecard.c +++ b/seeed-voicecard.c @@ -42,6 +42,7 @@ struct seeed_card_data { struct seeed_dai_props { struct asoc_simple_dai cpu_dai; struct asoc_simple_dai codec_dai; + struct snd_soc_dai_link_component cpus; /* single cpu */ struct snd_soc_dai_link_component codecs; /* single codec */ struct snd_soc_dai_link_component platforms; unsigned int mclk_fs; @@ -588,6 +589,8 @@ static int seeed_voice_card_probe(struct platform_device *pdev) * soc-core.c :: snd_soc_init_multicodec() */ for (i = 0; i < num; i++) { + dai_link[i].cpus = &dai_props[i].cpus; + dai_link[i].num_cpus = 1; dai_link[i].codecs = &dai_props[i].codecs; dai_link[i].num_codecs = 1; dai_link[i].platforms = &dai_props[i].platforms; @@ -612,6 +615,7 @@ static int seeed_voice_card_probe(struct platform_device *pdev) } } else { struct seeed_card_info *cinfo; + struct snd_soc_dai_link_component *cpus; struct snd_soc_dai_link_component *codecs; struct snd_soc_dai_link_component *platform; @@ -630,6 +634,9 @@ static int seeed_voice_card_probe(struct platform_device *pdev) return -EINVAL; } + cpus = dai_link->cpus; + cpus->dai_name = cinfo->cpu_dai.name; + codecs = dai_link->codecs; codecs->name = cinfo->codec; codecs->dai_name = cinfo->codec_dai.name; @@ -640,7 +647,6 @@ static int seeed_voice_card_probe(struct platform_device *pdev) priv->snd_card.name = (cinfo->card) ? cinfo->card : cinfo->name; dai_link->name = cinfo->name; dai_link->stream_name = cinfo->name; - dai_link->cpus->dai_name = cinfo->cpu_dai.name; dai_link->dai_fmt = cinfo->daifmt; dai_link->init = asoc_simple_dai_init; memcpy(&priv->dai_props->cpu_dai, &cinfo->cpu_dai,