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) | |
download | rockbox-4d04132c76700b30708bf99fc0ef664e8bb0b58d.tar.gz rockbox-4d04132c76700b30708bf99fc0ef664e8bb0b58d.zip |
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) | |||
431 | 431 | ||
432 | void pcm_play_dma_start(const void *addr, size_t size) | 432 | void pcm_play_dma_start(const void *addr, size_t size) |
433 | { | 433 | { |
434 | addr = (void *)(((long)addr + 2) & ~3); | ||
435 | size &= ~3; | ||
436 | |||
437 | #if NUM_CORES > 1 | 434 | #if NUM_CORES > 1 |
438 | /* This will become more important later - and different ! */ | 435 | /* This will become more important later - and different ! */ |
439 | dma_play_data.core = processor_id(); /* save initiating core */ | 436 | dma_play_data.core = processor_id(); /* save initiating core */ |
@@ -441,9 +438,6 @@ void pcm_play_dma_start(const void *addr, size_t size) | |||
441 | 438 | ||
442 | pcm_play_dma_stop(); | 439 | pcm_play_dma_stop(); |
443 | 440 | ||
444 | if (size == 0) | ||
445 | return; | ||
446 | |||
447 | #ifdef CPU_PP502x | 441 | #ifdef CPU_PP502x |
448 | if ((unsigned long)addr < UNCACHED_BASE_ADDR) { | 442 | if ((unsigned long)addr < UNCACHED_BASE_ADDR) { |
449 | /* Flush any pending cache writes */ | 443 | /* Flush any pending cache writes */ |
@@ -691,9 +685,8 @@ void fiq_record(void) | |||
691 | #endif /* SANSA_E200 */ | 685 | #endif /* SANSA_E200 */ |
692 | 686 | ||
693 | /* Continue transferring data in */ | 687 | /* Continue transferring data in */ |
694 | void pcm_record_more(void *start, size_t size) | 688 | void pcm_rec_dma_record_more(void *start, size_t size) |
695 | { | 689 | { |
696 | pcm_rec_peak_addr = start; /* Start peaking at dest */ | ||
697 | dma_rec_data.addr = (unsigned long)start; /* Start of RX buffer */ | 690 | dma_rec_data.addr = (unsigned long)start; /* Start of RX buffer */ |
698 | dma_rec_data.size = size; /* Bytes to transfer */ | 691 | dma_rec_data.size = size; /* Bytes to transfer */ |
699 | } | 692 | } |
@@ -718,7 +711,6 @@ void pcm_rec_dma_start(void *addr, size_t size) | |||
718 | { | 711 | { |
719 | pcm_rec_dma_stop(); | 712 | pcm_rec_dma_stop(); |
720 | 713 | ||
721 | pcm_rec_peak_addr = addr; | ||
722 | dma_rec_data.addr = (unsigned long)addr; | 714 | dma_rec_data.addr = (unsigned long)addr; |
723 | dma_rec_data.size = size; | 715 | dma_rec_data.size = size; |
724 | #if NUM_CORES > 1 | 716 | #if NUM_CORES > 1 |
@@ -749,17 +741,9 @@ void pcm_rec_dma_init(void) | |||
749 | pcm_rec_dma_stop(); | 741 | pcm_rec_dma_stop(); |
750 | } /* pcm_init */ | 742 | } /* pcm_init */ |
751 | 743 | ||
752 | const void * pcm_rec_dma_get_peak_buffer(int *count) | 744 | const void * pcm_rec_dma_get_peak_buffer(void) |
753 | { | 745 | { |
754 | unsigned long addr, end; | 746 | return (void *)((unsigned long)dma_rec_data.addr & ~3); |
755 | |||
756 | int status = disable_fiq_save(); | ||
757 | addr = (unsigned long)pcm_rec_peak_addr; | ||
758 | end = dma_rec_data.addr; | ||
759 | restore_fiq(status); | ||
760 | |||
761 | *count = (end >> 2) - (addr >> 2); | ||
762 | return (void *)(addr & ~3); | ||
763 | } /* pcm_rec_dma_get_peak_buffer */ | 747 | } /* pcm_rec_dma_get_peak_buffer */ |
764 | 748 | ||
765 | #endif /* HAVE_RECORDING */ | 749 | #endif /* HAVE_RECORDING */ |