From 3ad156903c3f2ee55c083a0064dd62f272250277 Mon Sep 17 00:00:00 2001 From: Chris Fries Date: Mon, 29 Nov 2010 15:45:05 -0600 Subject: [PATCH] [ARM] mfd: cpcap: Tune the STDAC enable time Some sounds (Camcorder start, Audible Selections) are quiet when the hardware is being turned on from an off state. These sounds have most of their energy in the first 100 msec and it takes this long for STDAC to warm up. Add a short delay to the Stereo DAC enable for ST Micro devices. Also, fix a checkpatch complaint. Change-Id: I71fc9c8be3a6378e4b90613e0f4a3d03941116d1 Signed-off-by: Iliyan Malchev --- drivers/mfd/cpcap-audio-core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/cpcap-audio-core.c b/drivers/mfd/cpcap-audio-core.c index 143c2592bbaa..d08e3ddccdbe 100644 --- a/drivers/mfd/cpcap-audio-core.c +++ b/drivers/mfd/cpcap-audio-core.c @@ -32,6 +32,7 @@ #include #define SLEEP_ACTIVATE_POWER_DELAY_MS 2 +#define STM_STDAC_ACTIVATE_RAMP_TIME 60 #define CLOCK_TREE_RESET_DELAY_MS 1 #define CPCAP_AUDIO_SPI_READBACK 1 @@ -766,6 +767,9 @@ static void cpcap_audio_configure_stdac(struct cpcap_audio_state *state, logged_cpcap_write(state->cpcap, CPCAP_REG_SDAC, stdac_changes.value, stdac_changes.mask); + if ((stdac_changes.value | CPCAP_BIT_ST_DAC_EN) && + (state->cpcap->vendor == CPCAP_VENDOR_ST)) + msleep(STM_STDAC_ACTIVATE_RAMP_TIME); } } @@ -829,8 +833,9 @@ static void cpcap_audio_configure_output_gains( reg_changes.value |= ((temp_output_gain << 2) | (temp_output_gain << 8)); - /* VOL_EXTx is disabled, it's not connected, disable to reduce noise. */ - /* If you need it, add | (temp_output_gain << 12) */ + /* VOL_EXTx is disabled, it's not connected, disable to reduce + * noise. If you need it, add | (temp_output_gain << 12) + */ reg_changes.mask = 0xFF3C; logged_cpcap_write(state->cpcap, CPCAP_REG_RXVC, -- 2.34.1