diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2020-02-19 07:56:30 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-02-24 22:18:28 +0100 |
commit | acf253c11329caa6be6d2abc14dfc8c0ec83718a (patch) | |
tree | b0d75a85c5895aed77fbc30de9d48c5ce352f4e7 /include/sound | |
parent | ASoC: meson: aiu: fix semicolon.cocci warnings (diff) | |
download | linux-acf253c11329caa6be6d2abc14dfc8c0ec83718a.tar.xz linux-acf253c11329caa6be6d2abc14dfc8c0ec83718a.zip |
ASoC: soc-pcm: add snd_soc_dai_get_pcm_stream()
DAI driver has playback/capture stream.
OTOH, we have SNDRV_PCM_STREAM_PLAYBACK/CAPTURE.
Because of this kind of implementation,
ALSA SoC needs to have many verbose code.
To solve this issue, this patch adds snd_soc_dai_get_pcm_stream() macro
to get playback/capture stream pointer from stream.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ftf7jcab.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc-dai.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 7481e468be39..c1089194ddf1 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -352,6 +352,13 @@ struct snd_soc_dai { unsigned int started:1; }; +static inline struct snd_soc_pcm_stream * +snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream) +{ + return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? + &dai->driver->playback : &dai->driver->capture; +} + static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, const struct snd_pcm_substream *ss) { |