summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c')
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
index bb1b2d9eaa..e9f55479c7 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
@@ -214,35 +214,27 @@ void pcm_play_dma_pause(bool pause)
214 214
215void fiq_handler(void) 215void fiq_handler(void)
216{ 216{
217 static unsigned char *start; 217 static void *start;
218 static size_t size; 218 static size_t size;
219 register pcm_more_callback_type get_more; /* No stack for this */
220 219
221 /* clear any pending interrupt */ 220 /* clear any pending interrupt */
222 SRCPND = DMA2_MASK; 221 SRCPND = DMA2_MASK;
223 222
224 /* Buffer empty. Try to get more. */ 223 /* Buffer empty. Try to get more. */
225 get_more = pcm_callback_for_more; 224 pcm_play_get_more_callback(&start, &size);
226 size = 0;
227 225
228 if (get_more == NULL || (get_more(&start, &size), size == 0)) 226 if (size == 0)
229 { 227 return;
230 /* Callback missing or no more DMA to do */
231 pcm_play_dma_stop();
232 pcm_play_dma_stopped_callback();
233 }
234 else
235 {
236 /* Flush any pending cache writes */
237 clean_dcache_range(start, size);
238 228
239 /* set the new DMA values */ 229 /* Flush any pending cache writes */
240 DCON2 = DMA_CONTROL_SETUP | (size >> 1); 230 clean_dcache_range(start, size);
241 DISRC2 = (unsigned int)start + 0x30000000;
242 231
243 /* Re-Activate the channel */ 232 /* set the new DMA values */
244 DMASKTRIG2 = 0x2; 233 DCON2 = DMA_CONTROL_SETUP | (size >> 1);
245 } 234 DISRC2 = (unsigned int)start + 0x30000000;
235
236 /* Re-Activate the channel */
237 DMASKTRIG2 = 0x2;
246} 238}
247 239
248size_t pcm_get_bytes_waiting(void) 240size_t pcm_get_bytes_waiting(void)