Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6dd1374 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "asoc: bolero: add different unmute_delay for AMIC and DMIC"

parents 99d88807 e5cd0046
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -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,
+15 −7
Original line number Diff line number Diff line
@@ -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,