diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-04-06 03:47:20 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-04-06 03:47:20 +0200 |
commit | b114701c0e8d580a05643c874d87e2501ab729cb (patch) | |
tree | a4e69cc865b9b76b6737d0d8b8dc81fc40c1e88f /sound/soc/fsl/fsl_dma.c | |
parent | 0221c81b1b8eb0cbb6b30a0ced52ead32d2b4e4c (diff) | |
parent | 103f211d0be2bed75b5739de62a10415ef0bbc25 (diff) | |
download | kernel_samsung_smdk4412-b114701c0e8d580a05643c874d87e2501ab729cb.tar.gz kernel_samsung_smdk4412-b114701c0e8d580a05643c874d87e2501ab729cb.tar.bz2 kernel_samsung_smdk4412-b114701c0e8d580a05643c874d87e2501ab729cb.zip |
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'sound/soc/fsl/fsl_dma.c')
-rw-r--r-- | sound/soc/fsl/fsl_dma.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index b3eb8570cd7..2c4892c853c 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c @@ -697,6 +697,23 @@ static snd_pcm_uframes_t fsl_dma_pointer(struct snd_pcm_substream *substream) else position = in_be32(&dma_channel->dar); + /* + * When capture is started, the SSI immediately starts to fill its FIFO. + * This means that the DMA controller is not started until the FIFO is + * full. However, ALSA calls this function before that happens, when + * MR.DAR is still zero. In this case, just return zero to indicate + * that nothing has been received yet. + */ + if (!position) + return 0; + + if ((position < dma_private->dma_buf_phys) || + (position > dma_private->dma_buf_end)) { + dev_err(substream->pcm->card->dev, + "dma pointer is out of range, halting stream\n"); + return SNDRV_PCM_POS_XRUN; + } + frames = bytes_to_frames(runtime, position - dma_private->dma_buf_phys); /* |