diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2010-05-12 14:05:36 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2010-05-12 14:05:36 +0000 |
commit | 4d04132c76700b30708bf99fc0ef664e8bb0b58d (patch) | |
tree | 4a32974c7d75d93477413fa3fe8cd152709e3d8c /firmware/target/arm/pcm-pp.c | |
parent | f2df42ee91ee61f793dac4844255cb4ec9049621 (diff) |
PCM bottom layer simplification. pcm_rec_peak_addr variable no longer has to be handled there. Driver can just return current pointer for recording peaks. A new define, HAVE_PCM_REC_DMA_ADDRESS, specifies that physical addresses are being used for recording and translation is needed before starting a new block. The drivers need not worry about aligning start and size nor should care if either will be zero. All this will be checked in the logical layer first.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25970 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/pcm-pp.c')
-rw-r--r-- | firmware/target/arm/pcm-pp.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/firmware/target/arm/pcm-pp.c b/firmware/target/arm/pcm-pp.c index bd12b13032..bad3f593fe 100644 --- a/firmware/target/arm/pcm-pp.c +++ b/firmware/target/arm/pcm-pp.c @@ -431,9 +431,6 @@ static void play_stop_pcm(void) void pcm_play_dma_start(const void *addr, size_t size) { - addr = (void *)(((long)addr + 2) & ~3); - size &= ~3; - #if NUM_CORES > 1 /* This will become more important later - and different ! */ dma_play_data.core = processor_id(); /* save initiating core */ @@ -441,9 +438,6 @@ void pcm_play_dma_start(const void *addr, size_t size) pcm_play_dma_stop(); - if (size == 0) - return; - #ifdef CPU_PP502x if ((unsigned long)addr < UNCACHED_BASE_ADDR) { /* Flush any pending cache writes */ @@ -691,9 +685,8 @@ void fiq_record(void) #endif /* SANSA_E200 */ /* Continue transferring data in */ -void pcm_record_more(void *start, size_t size) +void pcm_rec_dma_record_more(void *start, size_t size) { - pcm_rec_peak_addr = start; /* Start peaking at dest */ dma_rec_data.addr = (unsigned long)start; /* Start of RX buffer */ dma_rec_data.size = size; /* Bytes to transfer */ } @@ -718,7 +711,6 @@ void pcm_rec_dma_start(void *addr, size_t size) { pcm_rec_dma_stop(); - pcm_rec_peak_addr = addr; dma_rec_data.addr = (unsigned long)addr; dma_rec_data.size = size; #if NUM_CORES > 1 @@ -749,17 +741,9 @@ void pcm_rec_dma_init(void) pcm_rec_dma_stop(); } /* pcm_init */ -const void * pcm_rec_dma_get_peak_buffer(int *count) +const void * pcm_rec_dma_get_peak_buffer(void) { - unsigned long addr, end; - - int status = disable_fiq_save(); - addr = (unsigned long)pcm_rec_peak_addr; - end = dma_rec_data.addr; - restore_fiq(status); - - *count = (end >> 2) - (addr >> 2); - return (void *)(addr & ~3); + return (void *)((unsigned long)dma_rec_data.addr & ~3); } /* pcm_rec_dma_get_peak_buffer */ #endif /* HAVE_RECORDING */ |