ASoC: rk3308_codec: Fix the broken loopback sometimes

We need to insert some delay after enabling ADC current
and waiting ADCs are stable for BIST mode mainly.

Change-Id: Ib3cdc6aa36f8674ba8d8defadb47baac72f4745e
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
This commit is contained in:
Xing Zheng
2018-08-29 20:51:46 +08:00
committed by Tao Huang
parent 1b7bbc2354
commit 6ac47e547b

View File

@@ -2366,6 +2366,14 @@ static int rk3308_codec_adc_ana_enable(struct rk3308_codec_priv *rk3308,
RK3308_ADC_CURRENT_EN);
}
/*
* This is mainly used for BIST mode that wait ADCs are stable.
*
* By tested results, the type delay is >40us, but we need to leave
* enough delay margin.
*/
usleep_range(400, 500);
/* vendor step 4*/
for (idx = 0; adc_for_each_grp(rk3308, type, idx, &grp); idx++) {
if (grp < 0 || grp > ADC_LR_GROUP_MAX - 1)