summaryrefslogtreecommitdiffstats
path: root/sound/soc/generic/simple-card-utils.c
diff options
context:
space:
mode:
authorKuninori Morimoto2019-03-20 05:55:52 +0100
committerMark Brown2019-03-21 15:51:57 +0100
commitad934ca8010843482d61fda46786449a9bc99e10 (patch)
treef52c293b6aff971f7fb7833d9939198b9b53b278 /sound/soc/generic/simple-card-utils.c
parentASoC: simple-card-utils: share asoc_simple_hw_param() (diff)
downloadkernel-qcow2-linux-ad934ca8010843482d61fda46786449a9bc99e10.tar.gz
kernel-qcow2-linux-ad934ca8010843482d61fda46786449a9bc99e10.tar.xz
kernel-qcow2-linux-ad934ca8010843482d61fda46786449a9bc99e10.zip
ASoC: simple-card-utils: share asoc_simple_dai_init()
The difference between simple-card / audio-graph are just using OF graph style, or not. In other words, other things should be same. This means, simple-card/audio-graph common functions should be implemented at simple-card-utils, and its own functions should be implemented at each files. Current simple-card / audio-graph have almost same functions. This patch shares asoc_simple_dai_init() between in these 2 drivers. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic/simple-card-utils.c')
-rw-r--r--sound/soc/generic/simple-card-utils.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index de23cf8bffbd..c9b53b340028 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -436,8 +436,8 @@ int asoc_simple_card_parse_graph_dai(struct device_node *ep,
}
EXPORT_SYMBOL_GPL(asoc_simple_card_parse_graph_dai);
-int asoc_simple_card_init_dai(struct snd_soc_dai *dai,
- struct asoc_simple_dai *simple_dai)
+static int asoc_simple_card_init_dai(struct snd_soc_dai *dai,
+ struct asoc_simple_dai *simple_dai)
{
int ret;
@@ -467,7 +467,26 @@ int asoc_simple_card_init_dai(struct snd_soc_dai *dai,
return 0;
}
-EXPORT_SYMBOL_GPL(asoc_simple_card_init_dai);
+
+int asoc_simple_dai_init(struct snd_soc_pcm_runtime *rtd)
+{
+ struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+ struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num);
+ int ret;
+
+ ret = asoc_simple_card_init_dai(rtd->codec_dai,
+ dai_props->codec_dai);
+ if (ret < 0)
+ return ret;
+
+ ret = asoc_simple_card_init_dai(rtd->cpu_dai,
+ dai_props->cpu_dai);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(asoc_simple_dai_init);
void asoc_simple_card_canonicalize_platform(struct snd_soc_dai_link *dai_link)
{