summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Anders <dave123_aml@yahoo.com>2008-11-05 07:39:47 -0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-11-05 22:11:31 +0000
commit8dc840f88d9c9f75f46d5dbe489242f8a114fab6 (patch)
tree4d8a92f8ee7af935bb9d211f0e02ceeb6591b69f
parentea913940c39a61214c799cc7093d7b20fe11a94c (diff)
downloadlinux-3.10-8dc840f88d9c9f75f46d5dbe489242f8a114fab6.tar.gz
linux-3.10-8dc840f88d9c9f75f46d5dbe489242f8a114fab6.tar.bz2
linux-3.10-8dc840f88d9c9f75f46d5dbe489242f8a114fab6.zip
ASoC: Add new parameter to s3c24xx_pcm_enqueue
The S3C24xx dma does not allow more than one buffer to be enqueue prior to the dma transfers starting. This patch adds an additional parameter to s3c24xx_pcm_enqueue() to allow for passing an initial dma maximum load value. Signed-off-by: David Anders <danders at amltd.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/s3c24xx/s3c24xx-pcm.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index e13e614bada..341198bb0c1 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -78,7 +78,8 @@ struct s3c24xx_runtime_data {
* place a dma buffer onto the queue for the dma system
* to handle.
*/
-static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
+static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream,
+ int dma_max)
{
struct s3c24xx_runtime_data *prtd = substream->runtime->private_data;
dma_addr_t pos = prtd->dma_pos;
@@ -86,7 +87,10 @@ static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
DBG("Entered %s\n", __func__);
- while (prtd->dma_loaded < prtd->dma_limit) {
+ if (!dma_max)
+ dma_max = prtd->dma_limit;
+
+ while (prtd->dma_loaded < dma_max) {
unsigned long len = prtd->dma_period;
DBG("dma_loaded: %d\n", prtd->dma_loaded);
@@ -132,7 +136,7 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel,
spin_lock(&prtd->lock);
if (prtd->state & ST_RUNNING) {
prtd->dma_loaded--;
- s3c24xx_pcm_enqueue(substream);
+ s3c24xx_pcm_enqueue(substream, 0);
}
spin_unlock(&prtd->lock);
@@ -249,7 +253,7 @@ static int s3c24xx_pcm_prepare(struct snd_pcm_substream *substream)
prtd->dma_pos = prtd->dma_start;
/* enqueue dma buffers */
- s3c24xx_pcm_enqueue(substream);
+ s3c24xx_pcm_enqueue(substream, 1);
return ret;
}