summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s3c2440/mini2440
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-05-24 16:42:32 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-05-24 16:42:32 +0000
commitd56999890f2aacf197d9ae4383313271499509a9 (patch)
tree76a0177e2cf19bb15a065199b812ef20158422e1 /firmware/target/arm/s3c2440/mini2440
parent6688988ec42aa2254c8e370ec1932033a258b6fa (diff)
Make PCM->driver interface about as simple as it will get. Registered callback, zero data, alignment and stops are handled entirely inside pcm.c; driver merely calls fixed pcm.c callback. Remove pcm_record_more and do it just like playback; the original reason behind it isn't very practical in general. Everything checks out on supported targets. There wer some compat changes I can't check out on many unsupoorted but if there's a problem it will be a minor oops. Plugins become incompatible due to recording tweak-- full update. Sorted API.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26253 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/s3c2440/mini2440')
-rw-r--r--firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c b/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
index 486a235614..30db29c42c 100644
--- a/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
+++ b/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
@@ -254,35 +254,27 @@ void pcm_play_dma_pause(bool pause)
void fiq_handler(void)
{
- static unsigned char *start;
- static size_t size;
- register pcm_more_callback_type get_more; /* No stack for this */
+ static void *start;
+ static size_t size;
/* clear any pending interrupt */
SRCPND = DMA2_MASK;
/* Buffer empty. Try to get more. */
- get_more = pcm_callback_for_more;
- size = 0;
+ pcm_play_get_more_callback(&start, &size);
- if (get_more == NULL || (get_more(&start, &size), size == 0))
- {
- /* Callback missing or no more DMA to do */
- pcm_play_dma_stop();
- pcm_play_dma_stopped_callback();
- }
- else
- {
- /* Flush any pending cache writes */
- clean_dcache_range(start, size);
+ if (size == 0)
+ return;
- /* set the new DMA values */
- DCON2 = DMA_CONTROL_SETUP | (size >> 1);
- DISRC2 = (unsigned int)start + 0x30000000;
+ /* Flush any pending cache writes */
+ clean_dcache_range(start, size);
- /* Re-Activate the channel */
- DMASKTRIG2 = 0x2;
- }
+ /* set the new DMA values */
+ DCON2 = DMA_CONTROL_SETUP | (size >> 1);
+ DISRC2 = (unsigned int)start + 0x30000000;
+
+ /* Re-Activate the channel */
+ DMASKTRIG2 = 0x2;
}
size_t pcm_get_bytes_waiting(void)