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