From: Chris Fries Date: Mon, 29 Nov 2010 21:45:05 +0000 (-0600) Subject: [ARM] mfd: cpcap: Tune the STDAC enable time X-Git-Tag: firefly_0821_release~9834^2~291 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3ad156903c3f2ee55c083a0064dd62f272250277;p=firefly-linux-kernel-4.4.55.git [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 --- 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,