aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/omap-mcbsp.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2018-11-08 09:29:57 +0200
committerMark Brown <broonie@kernel.org>2018-11-13 09:50:19 -0800
commitbe51c576e8495fd2cffbababad6de7e0a0a562ba (patch)
treed70d1e182d86a0eb6db00a5afb61e0a81e0f4935 /sound/soc/omap/omap-mcbsp.c
parentASoC: omap-mcbsp: Simplify the mcbsp_start/_stop function parameters (diff)
downloadlinux-dev-be51c576e8495fd2cffbababad6de7e0a0a562ba.tar.xz
linux-dev-be51c576e8495fd2cffbababad6de7e0a0a562ba.zip
ASoC: omap-mcbsp: Move out the FIFO check from set_threshold and get_delay
Check if the McBSP have FIFO in the omap_mcbsp_set_threshold() and omap_mcbsp_dai_delay() delay function to skip calling the lower layer if it is not needed. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/omap/omap-mcbsp.c')
-rw-r--r--sound/soc/omap/omap-mcbsp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index a18b7ecc3a2e..69a6b8ad6d42 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -71,6 +71,10 @@ static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream,
struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai);
int words;
+ /* No need to proceed further if McBSP does not have FIFO */
+ if (mcbsp->pdata->buffer_size == 0)
+ return;
+
/*
* Configure McBSP threshold based on either:
* packet_size, when the sDMA is in packet mode, or based on the
@@ -233,6 +237,10 @@ static snd_pcm_sframes_t omap_mcbsp_dai_delay(
u16 fifo_use;
snd_pcm_sframes_t delay;
+ /* No need to proceed further if McBSP does not have FIFO */
+ if (mcbsp->pdata->buffer_size == 0)
+ return 0;
+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
fifo_use = omap_mcbsp_get_tx_delay(mcbsp);
else