diff options
Diffstat (limited to 'firmware/target/arm/s3c2440')
-rw-r--r-- | firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c | 15 |
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 | |||
48 | static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] = | 49 | static 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) | |||
127 | void pcm_dma_apply_settings(void) | 128 | void 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 | } |