summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2026-08-31 06:38:35 +0000
committerMark Brown <broonie@kernel.org>2026-09-09 16:42:34 +0100
commit4df2e9cf77edd705440a91714c73ec6a77accb6a (patch)
tree4d445bf910e43f4b137f291405402b659f3b9d4b
parent579d17faf16371954c419c4306fdcaa3d848d8ed (diff)
downloadlinux-next-4df2e9cf77edd705440a91714c73ec6a77accb6a.tar.gz
linux-next-4df2e9cf77edd705440a91714c73ec6a77accb6a.zip
ASoC: soc-dai: move snd_soc_dai_get_pcm_stream() to soc-dai.c
DAI parameter will be capsuled soon, will be not enable to access from soc-dai.h. Move it to soc-dai.c It renames function name snd_soc_dai_get_pcm_stream() snd_soc_dai_pcm_stream_get() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87pkyyssk4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc-dai.h13
-rw-r--r--sound/soc/soc-dai.c8
2 files changed, 18 insertions, 3 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index ea5182344c0d..e52ca6e289cb 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -494,12 +494,16 @@ struct snd_soc_dai {
void *priv;
};
+const struct snd_soc_pcm_stream *
+snd_soc_dai_pcm_stream_get_i(const struct snd_soc_dai *dai, int stream);
static inline const struct snd_soc_pcm_stream *
-snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream)
+snd_soc_dai_pcm_stream_get_s(const struct snd_soc_dai *dai, struct snd_pcm_substream *substream)
{
- return (stream == SNDRV_PCM_STREAM_PLAYBACK) ?
- &dai->driver->playback : &dai->driver->capture;
+ return snd_soc_dai_pcm_stream_get_i(dai, substream->stream);
}
+#define snd_soc_dai_pcm_stream_get(dai, x) _Generic((x), \
+ int : snd_soc_dai_pcm_stream_get_i, \
+ struct snd_pcm_substream * : snd_soc_dai_pcm_stream_get_s)(dai, x)
#define snd_soc_dai_get_widget_playback(dai) snd_soc_dai_get_widget(dai, SNDRV_PCM_STREAM_PLAYBACK)
#define snd_soc_dai_get_widget_capture(dai) snd_soc_dai_get_widget(dai, SNDRV_PCM_STREAM_CAPTURE)
@@ -615,4 +619,7 @@ struct snd_soc_dai *snd_soc_dai_register(struct snd_soc_component *component,
bool legacy_dai_naming);
void snd_soc_dai_unregister(struct snd_soc_dai *dai);
+/* REMOVE ME */
+#define snd_soc_dai_get_pcm_stream snd_soc_dai_pcm_stream_get
+
#endif
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 73ef977d23cc..de3cfdcf2c84 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -1073,6 +1073,14 @@ const char *snd_soc_dai_name(const struct snd_soc_dai *dai)
}
EXPORT_SYMBOL_GPL(snd_soc_dai_name);
+const struct snd_soc_pcm_stream *
+snd_soc_dai_pcm_stream_get_i(const struct snd_soc_dai *dai, int stream)
+{
+ return (stream == SNDRV_PCM_STREAM_PLAYBACK) ?
+ &dai->driver->playback : &dai->driver->capture;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_pcm_stream_get_i);
+
void snd_soc_dai_unregister(struct snd_soc_dai *dai)
{
lockdep_assert_held(&client_mutex);