diff options
author | Timur Tabi <timur@freescale.com> | 2009-03-25 19:20:37 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-04-02 11:34:14 -0400 |
commit | a4d11fe50c238a7da5225d1399314c3505cbd792 (patch) | |
tree | 100766010c57f0ee04eed149a0b3e9fd323ca398 /sound/soc/fsl/fsl_dma.c | |
parent | 7377226c344a7295a7573dce400ce9ddd42f0ca4 (diff) |
ASoC: remove trigger delay in Freescale MPC8610 sound driver
Remove the delay from the trigger function in the Freescale MPC8610 sound
driver when capture is started. This delay was used to ensure that the DMA
controller was active when ALSA call the .pointer function to request a
DMA transfer status. A better approach is for the .pointer function to detect
that DMA has not started, and return zero instead. This change eliminates
the need for the delay.
Also add some related code to check for a DMA programming error, and report
XRUN if it occurs.
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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 b3eb8570cd7b..2c4892c853cf 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) | |||
697 | else | 697 | else |
698 | position = in_be32(&dma_channel->dar); | 698 | position = in_be32(&dma_channel->dar); |
699 | 699 | ||
700 | /* | ||
701 | * When capture is started, the SSI immediately starts to fill its FIFO. | ||
702 | * This means that the DMA controller is not started until the FIFO is | ||
703 | * full. However, ALSA calls this function before that happens, when | ||
704 | * MR.DAR is still zero. In this case, just return zero to indicate | ||
705 | * that nothing has been received yet. | ||
706 | */ | ||
707 | if (!position) | ||
708 | return 0; | ||
709 | |||
710 | if ((position < dma_private->dma_buf_phys) || | ||
711 | (position > dma_private->dma_buf_end)) { | ||
712 | dev_err(substream->pcm->card->dev, | ||
713 | "dma pointer is out of range, halting stream\n"); | ||
714 | return SNDRV_PCM_POS_XRUN; | ||
715 | } | ||
716 | |||
700 | frames = bytes_to_frames(runtime, position - dma_private->dma_buf_phys); | 717 | frames = bytes_to_frames(runtime, position - dma_private->dma_buf_phys); |
701 | 718 | ||
702 | /* | 719 | /* |