summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2023-01-31 01:58:50 +0000
committerMark Brown <broonie@kernel.org>2023-01-31 11:04:50 +0000
commit37ed123689968fa7f733598d9a6966e8a2db66fb (patch)
tree2da10ebc5abc6beeba81581b779fc580ff11cee8 /include
parent67aa59afcf3f15183811157b7742762ed5ab416f (diff)
ASoC: soc-dai.h: add missing snd_soc_dai_set_widget()
Current ASoC has snd_soc_dai_get_widget() (= _get_) but doesn't have _set_ function. This patch adds it. This patch also cleanup unnecessary line break for _get_ function. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/87bkmfforp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/sound/soc-dai.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index ea7509672086..ea704d92deaa 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -478,13 +478,21 @@ snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream)
}
static inline
-struct snd_soc_dapm_widget *snd_soc_dai_get_widget(
- struct snd_soc_dai *dai, int stream)
+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_set_widget(struct snd_soc_dai *dai, int stream, struct snd_soc_dapm_widget *widget)
+{
+ if (stream == SNDRV_PCM_STREAM_PLAYBACK)
+ dai->playback_widget = widget;
+ else
+ dai->capture_widget = widget;
+}
+
static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
const struct snd_pcm_substream *ss)
{