summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-12-12 11:01:07 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-12-12 11:01:07 +0000
commite69d567d9ebf7d236ff9663b11ac396cc71dcd75 (patch)
tree093b9d1bc979d79be1fcd0daac1d8daf8ac55503 /firmware/target/arm/as3525
parent0ad97d13fc52b28de566dc0ddaf7245583eec2cc (diff)
downloadrockbox-e69d567d9ebf7d236ff9663b11ac396cc71dcd75.tar.gz
rockbox-e69d567d9ebf7d236ff9663b11ac396cc71dcd75.zip
Bring consistency to pcm implementation and samplerate handling. Less low-level duplication. A small test_sampr fix so it works on coldfire again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19400 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r--firmware/target/arm/as3525/pcm-as3525.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/firmware/target/arm/as3525/pcm-as3525.c b/firmware/target/arm/as3525/pcm-as3525.c
index d47f80ae77..fe694e0967 100644
--- a/firmware/target/arm/as3525/pcm-as3525.c
+++ b/firmware/target/arm/as3525/pcm-as3525.c
@@ -138,8 +138,10 @@ void pcm_postinit(void)
138 pcm_apply_settings(); 138 pcm_apply_settings();
139} 139}
140 140
141void pcm_set_frequency(unsigned int frequency) 141void pcm_dma_apply_settings(void)
142{ 142{
143 unsigned long frequency = pcm_sampr;
144
143 const int divider = (((AS3525_PLLA_FREQ/128) + (frequency/2)) / frequency) - 1; 145 const int divider = (((AS3525_PLLA_FREQ/128) + (frequency/2)) / frequency) - 1;
144 if(divider < 0 || divider > 511) 146 if(divider < 0 || divider > 511)
145 panicf("unsupported frequency %d", frequency); 147 panicf("unsupported frequency %d", frequency);
@@ -147,13 +149,6 @@ void pcm_set_frequency(unsigned int frequency)
147 CGU_AUDIO &= ~(((511 ^ divider) << 2) /* I2SOUT */ 149 CGU_AUDIO &= ~(((511 ^ divider) << 2) /* I2SOUT */
148 /*| ((511 ^ divider) << 14) */ /* I2SIN */ 150 /*| ((511 ^ divider) << 14) */ /* I2SIN */
149 ); 151 );
150
151 pcm_curr_sampr = frequency;
152}
153
154void pcm_apply_settings(void)
155{
156 pcm_set_frequency(HW_SAMPR_DEFAULT);
157} 152}
158 153
159size_t pcm_get_bytes_waiting(void) 154size_t pcm_get_bytes_waiting(void)