[ARM] mfd: cpcap-audio: CPCAP CODEC Capture pop
authorChris Fries <C.Fries@motorola.com>
Tue, 11 Jan 2011 05:01:57 +0000 (23:01 -0600)
committerIliyan Malchev <malchev@google.com>
Wed, 12 Jan 2011 02:35:56 +0000 (18:35 -0800)
There appears to be a warm-up time for the CODEC to stabilize of
25 milliseconds (by measurement).  Avoid noise at the start of
audio capture by holding off the CODEC enable for this duration.

Change-Id: I078af9272875cb77388fbbbd2796c4ba69301cb4
Signed-off-by: Iliyan Malchev <malchev@google.com>
drivers/mfd/cpcap-audio-core.c

index d7180f43bbea641b88a769995bddab72dc8afd42..599172728819652b20a42ddaa1b97d06d755c600 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <mach/cpcap_audio.h>
 
+#define CODEC_WARMUP_TIME_MS            25
 #define SLEEP_ACTIVATE_POWER_DELAY_MS  2
 #define STM_STDAC_ACTIVATE_RAMP_TIME   1
 #define CLOCK_TREE_RESET_DELAY_MS      1
@@ -671,6 +672,8 @@ static void cpcap_audio_configure_codec(struct cpcap_audio_state *state,
                mdelay(CLOCK_TREE_RESET_DELAY_MS);
        }
 
+       /* Todo: Follow-up with STMicro about why this is needed */
+       msleep(CODEC_WARMUP_TIME_MS);
        /* Clear old settings */
        codec_changes.mask = codec_changes.value | prev_codec_data;
        prev_codec_data    = codec_changes.value;