summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s3c2440/mini2440
diff options
context:
space:
mode:
authorBob Cousins <bobc@rockbox.org>2009-11-01 22:58:08 +0000
committerBob Cousins <bobc@rockbox.org>2009-11-01 22:58:08 +0000
commit33040275cfccdc1f1c33e0a9ef3b5a2b88aa3679 (patch)
treeb985669b775e9f482ca1d724f09d8a5cc74cd1cb /firmware/target/arm/s3c2440/mini2440
parent5d40b9a24a5ffe096691fbc117c718561d4bb30c (diff)
downloadrockbox-33040275cfccdc1f1c33e0a9ef3b5a2b88aa3679.tar.gz
rockbox-33040275cfccdc1f1c33e0a9ef3b5a2b88aa3679.zip
Improvements to mini2440/UDA1341 audio
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23478 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/s3c2440/mini2440')
-rw-r--r--firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c b/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
index 237bf264f5..9c898f88d9 100644
--- a/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
+++ b/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
@@ -19,6 +19,7 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include <stdlib.h> 21#include <stdlib.h>
22#include "config.h"
22#include "system.h" 23#include "system.h"
23#include "kernel.h" 24#include "kernel.h"
24#include "logf.h" 25#include "logf.h"
@@ -48,7 +49,7 @@ static struct
48static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] = 49static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] =
49{ 50{
50 [HW_FREQ_64] = { 2, IISMOD_MASTER_CLOCK_256FS }, 51 [HW_FREQ_64] = { 2, IISMOD_MASTER_CLOCK_256FS },
51 [HW_FREQ_44] = { 3, IISMOD_MASTER_CLOCK_384FS }, 52 [HW_FREQ_44] = { 2, IISMOD_MASTER_CLOCK_384FS },
52 [HW_FREQ_22] = { 8, IISMOD_MASTER_CLOCK_256FS }, 53 [HW_FREQ_22] = { 8, IISMOD_MASTER_CLOCK_256FS },
53 [HW_FREQ_11] = { 17, IISMOD_MASTER_CLOCK_256FS }, 54 [HW_FREQ_11] = { 17, IISMOD_MASTER_CLOCK_256FS },
54}; 55};
@@ -127,9 +128,12 @@ void pcm_postinit(void)
127void pcm_dma_apply_settings(void) 128void pcm_dma_apply_settings(void)
128{ 129{
129#ifdef HAVE_UDA1341 130#ifdef HAVE_UDA1341
131 unsigned int reg_val;
130 /* set prescaler and master clock rate according to freq */ 132 /* set prescaler and master clock rate according to freq */
131 IISPSR = (pcm_freq_parms [pcm_fsel][0] * IISPSR_PRESCALER_A) | pcm_freq_parms [pcm_fsel][0]; 133 reg_val = (pcm_freq_parms [pcm_fsel][0] << 5) | pcm_freq_parms [pcm_fsel][0];
132 IISMOD |= ~IISMOD_MASTER_CLOCK_384FS | pcm_freq_parms [pcm_fsel][1] ; 134
135 IISMOD = (IISMOD & ~IISMOD_MASTER_CLOCK_384FS) | pcm_freq_parms [pcm_fsel][1] ;
136 IISPSR = reg_val;
133#endif 137#endif
134 138
135 audiohw_set_frequency(pcm_fsel); 139 audiohw_set_frequency(pcm_fsel);
@@ -156,6 +160,11 @@ static void play_start_pcm(void)
156 /* turn off the idle */ 160 /* turn off the idle */
157 IISCON &= ~(1<<3); 161 IISCON &= ~(1<<3);
158 162
163#ifdef HAVE_UDA1341
164 IISMOD = (IISMOD & ~IISMOD_MASTER_CLOCK_384FS) | pcm_freq_parms [pcm_fsel][1] ;
165 IISPSR = (pcm_freq_parms [pcm_fsel][0] << 5) | pcm_freq_parms [pcm_fsel][0];
166#endif
167
159 /* start the IIS */ 168 /* start the IIS */
160 IISCON |= (1<<0); 169 IISCON |= (1<<0);
161} 170}