summaryrefslogtreecommitdiffstats
path: root/include/sound/soc-dai.h
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-02-19 07:56:41 +0100
committerMark Brown <broonie@kernel.org>2020-02-24 22:18:30 +0100
commit0c01f6ca8e4cc1e5505bf4657cf77fbfaa7b0bc2 (patch)
tree4de273f1ba2e4fd59a2f949cdbf37c0750ce5000 /include/sound/soc-dai.h
parentASoC: soc-pcm: cleanup soc_pcm_apply_msb() (diff)
downloadlinux-0c01f6ca8e4cc1e5505bf4657cf77fbfaa7b0bc2.tar.xz
linux-0c01f6ca8e4cc1e5505bf4657cf77fbfaa7b0bc2.zip
ASoC: soc-pcm: add snd_soc_dai_get_widget()
soc-pcm.c has dai_get_widget(), but it can be more generic. This patch renames it to snd_soc_dai_get_widget(), and use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87d0abjca1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound/soc-dai.h')
-rw-r--r--include/sound/soc-dai.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index c1089194ddf1..92c382690930 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -359,6 +359,14 @@ snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream)
&dai->driver->playback : &dai->driver->capture;
}
+static inline
+struct snd_soc_dapm_widget *snd_soc_dai_get_widget(
+ struct snd_soc_dai *dai, int stream)
+{
+ return (stream == SNDRV_PCM_STREAM_PLAYBACK) ?
+ dai->playback_widget : dai->capture_widget;
+}
+
static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
const struct snd_pcm_substream *ss)
{