From abf41e34811adc426ac932d350abc3f1d151e449 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Tue, 13 Mar 2007 15:05:46 +0000 Subject: H100 Series: Fix FS#6810 - Distortion on Bass/Treble usage. Coldfire PCM needed a refinement in the init sequence for the UDA1380 after audio init changes. Apparently it doesn't like its registers altered before the Coldfire I2S is properly initialized. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12752 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/coldfire/pcm-coldfire.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'firmware/target') diff --git a/firmware/target/coldfire/pcm-coldfire.c b/firmware/target/coldfire/pcm-coldfire.c index 0662e289a0..b827887636 100644 --- a/firmware/target/coldfire/pcm-coldfire.c +++ b/firmware/target/coldfire/pcm-coldfire.c @@ -135,6 +135,10 @@ bool _pcm_apply_settings(bool clear_reset) /* Reprogramming bits 15-12 requires FIFO to be in a reset condition - Users Manual 17-8, Note 11 */ or_l(IIS_FIFO_RESET, &IIS_PLAY); + /* Important for TLV320 - this must happen in the correct order + or starting recording will sound absolutely awful once in + awhile - audiohw_set_frequency then coldfire_set_pllcr_audio_bits + */ audiohw_set_frequency(freq_ent[FPARM_FSEL]); coldfire_set_pllcr_audio_bits(PLLCR_SET_AUDIO_BITS_DEFPARM); did_reset = true; @@ -252,14 +256,20 @@ void pcm_init(void) /* Call pcm_close_recording to put in closed state */ pcm_close_recording(); + /* Setup Coldfire I2S before initializing hardware or changing + other settings. */ + or_l(IIS_FIFO_RESET, &IIS_PLAY); + pcm_set_frequency(HW_FREQ_DEFAULT); + audio_set_output_source(AUDIO_SRC_PLAYBACK); + SET_IIS_PLAY(IIS_FIFO_RESET | IIS_PLAY_DEFPARM); + /* Initialize default register values. */ audiohw_init(); - audio_set_output_source(AUDIO_SRC_PLAYBACK); audio_set_source(AUDIO_SRC_PLAYBACK, SRCF_PLAYBACK); - pcm_set_frequency(HW_FREQ_DEFAULT); - _pcm_apply_settings(false); + audiohw_set_frequency(freq_ent[FPARM_FSEL]); + coldfire_set_pllcr_audio_bits(PLLCR_SET_AUDIO_BITS_DEFPARM); #if defined(HAVE_SPDIF_IN) || defined(HAVE_SPDIF_OUT) spdif_init(); -- cgit