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: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Liam Girdwood <lrg@ti.com>
This commit is contained in:
Peter Ujfalusi 2012-03-20 11:47:36 +02:00 committed by Liam Girdwood
parent 35d210faa1
commit ce37f5ea4b

View File

@ -138,13 +138,15 @@ 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.
*/ */
snd_pcm_hw_rule_add(substream->runtime, 0, if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
SNDRV_PCM_HW_PARAM_BUFFER_SIZE, snd_pcm_hw_rule_add(substream->runtime, 0,
omap_mcbsp_hwrule_min_buffersize, SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
mcbsp, omap_mcbsp_hwrule_min_buffersize,
SNDRV_PCM_HW_PARAM_CHANNELS, -1); mcbsp,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
/* Make sure, that the period size is always even */ /* Make sure, that the period size is always even */
snd_pcm_hw_constraint_step(substream->runtime, 0, snd_pcm_hw_constraint_step(substream->runtime, 0,