From 3a50469cbe68ae4d9487536fb23aba48a02184ce Mon Sep 17 00:00:00 2001 From: Vatsal Bucha Date: Wed, 25 Aug 2021 16:57:19 +0530 Subject: [PATCH] asoc: codecs: Fix mute if hpf cut off freq set to 150hz There is mute in recorded sound when hpf cut off freq is 150hz as hpf is never gated for the same. Gate hpf register in order to avoid mute. Change-Id: Ic6bb6da529d78140a734675dae8c8b9f220e0054 Signed-off-by: Vatsal Bucha --- asoc/codecs/bolero/tx-macro.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/asoc/codecs/bolero/tx-macro.c b/asoc/codecs/bolero/tx-macro.c index b70f80187f30..3b4de35fb2c8 100644 --- a/asoc/codecs/bolero/tx-macro.c +++ b/asoc/codecs/bolero/tx-macro.c @@ -1106,22 +1106,21 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, &tx_priv->tx_mute_dwork[decimator].dwork, msecs_to_jiffies(unmute_delay)); if (tx_priv->tx_hpf_work[decimator].hpf_cut_off_freq != - CF_MIN_3DB_150HZ) { + CF_MIN_3DB_150HZ) queue_delayed_work(system_freezable_wq, &tx_priv->tx_hpf_work[decimator].dwork, msecs_to_jiffies(hpf_delay)); + snd_soc_component_update_bits(component, + hpf_gate_reg, 0x03, 0x02); + if (!is_smic_enabled(component, decimator)) snd_soc_component_update_bits(component, - hpf_gate_reg, 0x03, 0x02); - if (!is_smic_enabled(component, decimator)) - snd_soc_component_update_bits(component, - hpf_gate_reg, 0x03, 0x00); - snd_soc_component_update_bits(component, - hpf_gate_reg, 0x03, 0x01); - /* - * 6ms delay is required as per HW spec - */ - usleep_range(6000, 6010); - } + hpf_gate_reg, 0x03, 0x00); + snd_soc_component_update_bits(component, + hpf_gate_reg, 0x03, 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, snd_soc_component_read32(component,