From 9366ce6e8b1e5a5f52347ad8c6b7ee0400bf928c Mon Sep 17 00:00:00 2001 From: Karthikeyan Mani Date: Wed, 6 Nov 2019 11:43:36 -0800 Subject: [PATCH] asoc: codecs: bolero: add delay after toggling hpf gate Add delay after toggling hpf gate to reduce noise levels while starting recording use case. Change-Id: I1a7b1b0a339abb3642ca8420753e9d07023acf89 Signed-off-by: Karthikeyan Mani --- asoc/codecs/bolero/tx-macro.c | 6 ++++++ asoc/codecs/bolero/va-macro.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/asoc/codecs/bolero/tx-macro.c b/asoc/codecs/bolero/tx-macro.c index 31745d60d5e8..13faf84109ca 100644 --- a/asoc/codecs/bolero/tx-macro.c +++ b/asoc/codecs/bolero/tx-macro.c @@ -911,6 +911,12 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, usleep_range(1000, 1010); snd_soc_component_update_bits(component, hpf_gate_reg, 0x02, 0x00); + snd_soc_component_update_bits(component, + hpf_gate_reg, 0x01, 0x01); + /* + * 6ms delay is required as per HW spec + */ + usleep_range(6000, 6010); } /* apply gain after decimator is enabled */ snd_soc_component_write(component, tx_gain_ctl_reg, diff --git a/asoc/codecs/bolero/va-macro.c b/asoc/codecs/bolero/va-macro.c index c5f0ef9c0373..e78b1da463b2 100644 --- a/asoc/codecs/bolero/va-macro.c +++ b/asoc/codecs/bolero/va-macro.c @@ -1037,6 +1037,12 @@ static int va_macro_enable_dec(struct snd_soc_dapm_widget *w, usleep_range(1000, 1010); snd_soc_component_update_bits(component, hpf_gate_reg, 0x02, 0x00); + snd_soc_component_update_bits(component, + hpf_gate_reg, 0x01, 0x01); + /* + * 6ms delay is required as per HW spec + */ + usleep_range(6000, 6010); } /* schedule work queue to Remove Mute */ schedule_delayed_work(&va_priv->va_mute_dwork[decimator].dwork,