summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s3c2440
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
parent5d40b9a24a5ffe096691fbc117c718561d4bb30c (diff)
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')
-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 @@
*
****************************************************************************/
#include <stdlib.h>
+#include "config.h"
#include "system.h"
#include "kernel.h"
#include "logf.h"
@@ -48,7 +49,7 @@ static struct
static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] =
{
[HW_FREQ_64] = { 2, IISMOD_MASTER_CLOCK_256FS },
- [HW_FREQ_44] = { 3, IISMOD_MASTER_CLOCK_384FS },
+ [HW_FREQ_44] = { 2, IISMOD_MASTER_CLOCK_384FS },
[HW_FREQ_22] = { 8, IISMOD_MASTER_CLOCK_256FS },
[HW_FREQ_11] = { 17, IISMOD_MASTER_CLOCK_256FS },
};
@@ -127,9 +128,12 @@ void pcm_postinit(void)
void pcm_dma_apply_settings(void)
{
#ifdef HAVE_UDA1341
+ unsigned int reg_val;
/* set prescaler and master clock rate according to freq */
- IISPSR = (pcm_freq_parms [pcm_fsel][0] * IISPSR_PRESCALER_A) | pcm_freq_parms [pcm_fsel][0];
- IISMOD |= ~IISMOD_MASTER_CLOCK_384FS | pcm_freq_parms [pcm_fsel][1] ;
+ reg_val = (pcm_freq_parms [pcm_fsel][0] << 5) | pcm_freq_parms [pcm_fsel][0];
+
+ IISMOD = (IISMOD & ~IISMOD_MASTER_CLOCK_384FS) | pcm_freq_parms [pcm_fsel][1] ;
+ IISPSR = reg_val;
#endif
audiohw_set_frequency(pcm_fsel);
@@ -156,6 +160,11 @@ static void play_start_pcm(void)
/* turn off the idle */
IISCON &= ~(1<<3);
+#ifdef HAVE_UDA1341
+ IISMOD = (IISMOD & ~IISMOD_MASTER_CLOCK_384FS) | pcm_freq_parms [pcm_fsel][1] ;
+ IISPSR = (pcm_freq_parms [pcm_fsel][0] << 5) | pcm_freq_parms [pcm_fsel][0];
+#endif
+
/* start the IIS */
IISCON |= (1<<0);
}