mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
asoc: bolero: add different unmute_delay for AMIC and DMIC
unmute_delay for AMIC and DMIC may be different and use same flag may affect the powerup time. Add different unmute_delay flag for AMIC and DMIC to resolve the issue. Change-Id: I7697b1fae92a2b37530106c1c7b79a5d1bd74021 Signed-off-by: Meng Wang <mengw@codeaurora.org>
This commit is contained in:
parent
a78b32247d
commit
e5cd004630
2 changed files with 28 additions and 13 deletions
|
|
@ -48,9 +48,13 @@
|
|||
#define TX_MACRO_DMIC_HPF_DELAY_MS 300
|
||||
#define TX_MACRO_AMIC_HPF_DELAY_MS 300
|
||||
|
||||
static int tx_unmute_delay = TX_MACRO_DMIC_UNMUTE_DELAY_MS;
|
||||
module_param(tx_unmute_delay, int, 0664);
|
||||
MODULE_PARM_DESC(tx_unmute_delay, "delay to unmute the tx path");
|
||||
static int tx_amic_unmute_delay = TX_MACRO_AMIC_UNMUTE_DELAY_MS;
|
||||
module_param(tx_amic_unmute_delay, int, 0664);
|
||||
MODULE_PARM_DESC(tx_amic_unmute_delay, "delay to unmute the tx amic path");
|
||||
|
||||
static int tx_dmic_unmute_delay = TX_MACRO_DMIC_UNMUTE_DELAY_MS;
|
||||
module_param(tx_dmic_unmute_delay, int, 0664);
|
||||
MODULE_PARM_DESC(tx_dmic_unmute_delay, "delay to unmute the tx dmic path");
|
||||
|
||||
static const DECLARE_TLV_DB_SCALE(digital_gain, 0, 1, 0);
|
||||
|
||||
|
|
@ -1099,13 +1103,16 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w,
|
|||
if (is_amic_enabled(component, decimator)) {
|
||||
hpf_delay = TX_MACRO_AMIC_HPF_DELAY_MS;
|
||||
unmute_delay = TX_MACRO_AMIC_UNMUTE_DELAY_MS;
|
||||
if (unmute_delay < tx_amic_unmute_delay)
|
||||
unmute_delay = tx_amic_unmute_delay;
|
||||
} else {
|
||||
if (unmute_delay < tx_dmic_unmute_delay)
|
||||
unmute_delay = tx_dmic_unmute_delay;
|
||||
}
|
||||
if (tx_unmute_delay < unmute_delay)
|
||||
tx_unmute_delay = unmute_delay;
|
||||
/* schedule work queue to Remove Mute */
|
||||
queue_delayed_work(system_freezable_wq,
|
||||
&tx_priv->tx_mute_dwork[decimator].dwork,
|
||||
msecs_to_jiffies(tx_unmute_delay));
|
||||
msecs_to_jiffies(unmute_delay));
|
||||
if (tx_priv->tx_hpf_work[decimator].hpf_cut_off_freq !=
|
||||
CF_MIN_3DB_150HZ) {
|
||||
queue_delayed_work(system_freezable_wq,
|
||||
|
|
|
|||
|
|
@ -57,9 +57,14 @@
|
|||
#define VA_MACRO_CHILD_DEVICES_MAX 3
|
||||
|
||||
static const DECLARE_TLV_DB_SCALE(digital_gain, 0, 1, 0);
|
||||
static int va_tx_unmute_delay = BOLERO_CDC_VA_TX_DMIC_UNMUTE_DELAY_MS;
|
||||
module_param(va_tx_unmute_delay, int, 0664);
|
||||
MODULE_PARM_DESC(va_tx_unmute_delay, "delay to unmute the tx path");
|
||||
|
||||
static int va_tx_amic_unmute_delay = BOLERO_CDC_VA_TX_AMIC_UNMUTE_DELAY_MS;
|
||||
module_param(va_tx_amic_unmute_delay, int, 0664);
|
||||
MODULE_PARM_DESC(va_tx_amic_unmute_delay, "delay to unmute the tx amic path");
|
||||
|
||||
static int va_tx_dmic_unmute_delay = BOLERO_CDC_VA_TX_DMIC_UNMUTE_DELAY_MS;
|
||||
module_param(va_tx_dmic_unmute_delay, int, 0664);
|
||||
MODULE_PARM_DESC(va_tx_dmic_unmute_delay, "delay to unmute the tx dmic path");
|
||||
|
||||
static int va_macro_core_vote(void *handle, bool enable);
|
||||
|
||||
|
|
@ -1210,11 +1215,14 @@ static int va_macro_enable_dec(struct snd_soc_dapm_widget *w,
|
|||
TX_HPF_CUT_OFF_FREQ_MASK,
|
||||
CF_MIN_3DB_150HZ << 5);
|
||||
}
|
||||
if (is_amic_enabled(component, decimator) < BOLERO_ADC_MAX) {
|
||||
if (is_amic_enabled(component, decimator)) {
|
||||
hpf_delay = BOLERO_CDC_VA_TX_AMIC_HPF_DELAY_MS;
|
||||
unmute_delay = BOLERO_CDC_VA_TX_AMIC_UNMUTE_DELAY_MS;
|
||||
if (va_tx_unmute_delay < unmute_delay)
|
||||
va_tx_unmute_delay = unmute_delay;
|
||||
if (unmute_delay < va_tx_amic_unmute_delay)
|
||||
unmute_delay = va_tx_amic_unmute_delay;
|
||||
} else {
|
||||
if (unmute_delay < va_tx_dmic_unmute_delay)
|
||||
unmute_delay = va_tx_dmic_unmute_delay;
|
||||
}
|
||||
snd_soc_component_update_bits(component,
|
||||
hpf_gate_reg, 0x03, 0x02);
|
||||
|
|
@ -1234,7 +1242,7 @@ static int va_macro_enable_dec(struct snd_soc_dapm_widget *w,
|
|||
/* schedule work queue to Remove Mute */
|
||||
queue_delayed_work(system_freezable_wq,
|
||||
&va_priv->va_mute_dwork[decimator].dwork,
|
||||
msecs_to_jiffies(va_tx_unmute_delay));
|
||||
msecs_to_jiffies(unmute_delay));
|
||||
if (va_priv->va_hpf_work[decimator].hpf_cut_off_freq !=
|
||||
CF_MIN_3DB_150HZ)
|
||||
queue_delayed_work(system_freezable_wq,
|
||||
|
|
|
|||
Loading…
Reference in a new issue