summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dai.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-04-24 01:15:15 +0200
committerMark Brown <broonie@kernel.org>2020-04-29 14:27:40 +0200
commit51801aeafdc9c1d55e5e71e58a1bbbd2583328fa (patch)
treec1111a11fb750eb13d2c0989babc38133c613c51 /sound/soc/soc-dai.c
parentASoC: soc-dai: add snd_soc_pcm_dai_bespoke_trigger() (diff)
downloadlinux-51801aeafdc9c1d55e5e71e58a1bbbd2583328fa.tar.xz
linux-51801aeafdc9c1d55e5e71e58a1bbbd2583328fa.zip
ASoC: soc-dai: add snd_soc_pcm_dai_probe()
We have 2 type of component functions snd_soc_dai_xxx() is focusing to dai itself, snd_soc_pcm_dai_xxx() is focusing to rtd related dai. Now we can update snd_soc_dai_probe() to snd_soc_pcm_dai_probe(). This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87sggtssjg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dai.c')
-rw-r--r--sound/soc/soc-dai.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 226c51b9089c..48f5eb5ef387 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -366,16 +366,6 @@ snd_pcm_sframes_t snd_soc_dai_delay(struct snd_soc_dai *dai,
return delay;
}
-int snd_soc_dai_probe(struct snd_soc_dai *dai)
-{
- int ret = 0;
-
- if (dai->driver->probe)
- ret = dai->driver->probe(dai);
-
- return soc_dai_ret(dai, ret);
-}
-
int snd_soc_dai_remove(struct snd_soc_dai *dai)
{
int ret = 0;
@@ -408,6 +398,28 @@ bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir)
return stream->channels_min;
}
+int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order)
+{
+ struct snd_soc_dai *dai;
+ int i;
+
+ for_each_rtd_dais(rtd, i, dai) {
+ if (dai->driver->probe_order != order)
+ continue;
+
+ if (dai->driver->probe) {
+ int ret = dai->driver->probe(dai);
+
+ if (ret < 0)
+ return soc_dai_ret(dai, ret);
+ }
+
+ dai->probed = 1;
+ }
+
+ return 0;
+}
+
int snd_soc_pcm_dai_new(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_dai *dai;