summaryrefslogtreecommitdiff
path: root/sound/soc/generic/audio-graph-card.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-03-20 07:55:52 +0300
committerMark Brown <broonie@kernel.org>2019-03-21 17:51:57 +0300
commitad934ca8010843482d61fda46786449a9bc99e10 (patch)
treef52c293b6aff971f7fb7833d9939198b9b53b278 /sound/soc/generic/audio-graph-card.c
parentf48dcbb6d47d870cf3a03f453c923dd262158c66 (diff)
downloadlinux-ad934ca8010843482d61fda46786449a9bc99e10.tar.xz
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/audio-graph-card.c')
-rw-r--r--sound/soc/generic/audio-graph-card.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 51160adaf5bb..b1ceefc60879 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -62,25 +62,6 @@ static const struct snd_soc_ops graph_ops = {
.hw_params = asoc_simple_hw_params,
};
-static int graph_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 = 0;
-
- 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;
-}
-
static int graph_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params)
{
@@ -255,7 +236,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
dai_link->dpcm_playback = 1;
dai_link->dpcm_capture = 1;
dai_link->ops = &graph_ops;
- dai_link->init = graph_dai_init;
+ dai_link->init = asoc_simple_dai_init;
return 0;
}
@@ -327,7 +308,7 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
return ret;
dai_link->ops = &graph_ops;
- dai_link->init = graph_dai_init;
+ dai_link->init = asoc_simple_dai_init;
asoc_simple_card_canonicalize_platform(dai_link);
asoc_simple_card_canonicalize_cpu(dai_link,