summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2024-11-12 02:39:44 +0000
committerMark Brown <broonie@kernel.org>2024-11-12 13:08:31 +0000
commitadd2332795a648b62fd52356001287c015a59e80 (patch)
tree8973291d7fde17ae74f53948f8e750e6454e9f73 /sound/soc
parentc853e96308c58f9a06fcf393bcfe0eabdb72ca9c (diff)
ASoC: simple-card-utils: care simple_util_dai for dummy DAI
Simple Card Utils has simple_util_dai which is paired to snd_soc_dai, and assmus that CPU/Codec DAI and its paired simple_util_dai are same order for CPU/Codec simple_util_dai[0] <--> snd_soc_dai[0] simple_util_dai[1] <--> snd_soc_dai[1] ... So, it is using same index in for_each loop. (X) gets simple_util_dai (Y) gets snd_soc_dai (Y) for_each_rtd_cpu_dais(.., i, ..) { (X)(A) udai = simple_props_to_dai_cpu(.., i); } (X) for_each_prop_dai_cpu(.., i, ...) { (Y) dai = snd_soc_rtd_to_cpu(.., i); ... } But current Simple Card Utils didn't have simple_util_dai for dummy DAI. So above (A) will get NULL pointer in such case. This patch cares simple_util_dai for dummy DAI. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87msi5maz3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/generic/simple-card-utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index d47c372228b3..24b371f32066 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -858,6 +858,10 @@ int simple_util_init_aux_jacks(struct simple_util_priv *priv, char *prefix)
}
EXPORT_SYMBOL_GPL(simple_util_init_aux_jacks);
+static struct simple_util_dai dummy_util_dais = {
+ .name = "dummy_util_dais",
+};
+
int simple_util_init_priv(struct simple_util_priv *priv,
struct link_info *li)
{
@@ -929,6 +933,7 @@ int simple_util_init_priv(struct simple_util_priv *priv,
dai_link[i].cpus = &snd_soc_dummy_dlc;
dai_props[i].num.cpus =
dai_link[i].num_cpus = 1;
+ dai_props[i].cpu_dai = &dummy_util_dais;
}
if (li->num[i].codecs) {
@@ -951,6 +956,7 @@ int simple_util_init_priv(struct simple_util_priv *priv,
dai_link[i].codecs = &snd_soc_dummy_dlc;
dai_props[i].num.codecs =
dai_link[i].num_codecs = 1;
+ dai_props[i].codec_dai = &dummy_util_dais;
}
if (li->num[i].platforms) {