Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce37f5ea authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Liam Girdwood
Browse files

ASoC: omap-mcbsp: buffer size constraint only applies to playback stream



In capture stream the buffer size does not need to be constrained to be
bigger then the McBSP FIFO.
In capture the FIFO content is taken out in period length burst, this
enusres that the FIFO is not going to overflow.

Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarJarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: default avatarLiam Girdwood <lrg@ti.com>
parent 35d210fa
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -138,8 +138,10 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
	if (mcbsp->pdata->buffer_size) {
	if (mcbsp->pdata->buffer_size) {
		/*
		/*
		* Rule for the buffer size. We should not allow
		* Rule for the buffer size. We should not allow
		* smaller buffer than the FIFO size to avoid underruns
		* smaller buffer than the FIFO size to avoid underruns.
		* This applies only for the playback stream.
		*/
		*/
		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
			snd_pcm_hw_rule_add(substream->runtime, 0,
			snd_pcm_hw_rule_add(substream->runtime, 0,
					    SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
					    SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
					    omap_mcbsp_hwrule_min_buffersize,
					    omap_mcbsp_hwrule_min_buffersize,