aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx/s3c24xx-pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/s3c24xx/s3c24xx-pcm.c')
-rw-r--r--sound/soc/s3c24xx/s3c24xx-pcm.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index 341198bb0c17..e13e614bada9 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -78,8 +78,7 @@ struct s3c24xx_runtime_data {
78 * place a dma buffer onto the queue for the dma system 78 * place a dma buffer onto the queue for the dma system
79 * to handle. 79 * to handle.
80*/ 80*/
81static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream, 81static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
82 int dma_max)
83{ 82{
84 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; 83 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data;
85 dma_addr_t pos = prtd->dma_pos; 84 dma_addr_t pos = prtd->dma_pos;
@@ -87,10 +86,7 @@ static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream,
87 86
88 DBG("Entered %s\n", __func__); 87 DBG("Entered %s\n", __func__);
89 88
90 if (!dma_max) 89 while (prtd->dma_loaded < prtd->dma_limit) {
91 dma_max = prtd->dma_limit;
92
93 while (prtd->dma_loaded < dma_max) {
94 unsigned long len = prtd->dma_period; 90 unsigned long len = prtd->dma_period;
95 91
96 DBG("dma_loaded: %d\n", prtd->dma_loaded); 92 DBG("dma_loaded: %d\n", prtd->dma_loaded);
@@ -136,7 +132,7 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel,
136 spin_lock(&prtd->lock); 132 spin_lock(&prtd->lock);
137 if (prtd->state & ST_RUNNING) { 133 if (prtd->state & ST_RUNNING) {
138 prtd->dma_loaded--; 134 prtd->dma_loaded--;
139 s3c24xx_pcm_enqueue(substream, 0); 135 s3c24xx_pcm_enqueue(substream);
140 } 136 }
141 137
142 spin_unlock(&prtd->lock); 138 spin_unlock(&prtd->lock);
@@ -253,7 +249,7 @@ static int s3c24xx_pcm_prepare(struct snd_pcm_substream *substream)
253 prtd->dma_pos = prtd->dma_start; 249 prtd->dma_pos = prtd->dma_start;
254 250
255 /* enqueue dma buffers */ 251 /* enqueue dma buffers */
256 s3c24xx_pcm_enqueue(substream, 1); 252 s3c24xx_pcm_enqueue(substream);
257 253
258 return ret; 254 return ret;
259} 255}