From 33040275cfccdc1f1c33e0a9ef3b5a2b88aa3679 Mon Sep 17 00:00:00 2001 From: Bob Cousins Date: Sun, 1 Nov 2009 22:58:08 +0000 Subject: Improvements to mini2440/UDA1341 audio git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23478 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'firmware/target/arm') 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 +#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); } -- cgit v1.2.3