diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-07-22 03:34:09 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-07-23 19:14:20 +0200 |
commit | 1dea80d4b2bd3b53c58f008ca2bcd73182583711 (patch) | |
tree | 1387a2e2c907ea3526bb5f57cc4e596ebda87cf1 /sound/soc/soc-dai.c | |
parent | ASoC: soc-dai: add snd_soc_dai_bespoke_trigger() (diff) | |
download | linux-1dea80d4b2bd3b53c58f008ca2bcd73182583711.tar.xz linux-1dea80d4b2bd3b53c58f008ca2bcd73182583711.zip |
ASoC: soc-dai: add snd_soc_dai_delay()
Current ALSA SoC is directly using dai->driver->ops->xxx,
thus, it has deep nested bracket, and it makes code unreadable.
This patch adds new snd_soc_dai_delay() and use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o91mhn3i.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.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 6f466cfcbeef..5b5b979cd1f3 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -342,3 +342,14 @@ int snd_soc_dai_bespoke_trigger(struct snd_soc_dai *dai, return ret; } + +snd_pcm_sframes_t snd_soc_dai_delay(struct snd_soc_dai *dai, + struct snd_pcm_substream *substream) +{ + int delay = 0; + + if (dai->driver->ops->delay) + delay = dai->driver->ops->delay(substream, dai); + + return delay; +} |