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

Commit 0217f400 authored by Surendar karka's avatar Surendar karka
Browse files

ASoC: wcd9335: set mic unmute delay based on DT



Based on dmic characteristics the initial pop time
that is observed in TX path is varying. Configure PGA
unmute delay based on DT value.

CRs-Fixed: 2085659
Change-Id: I80eae5c2cf384e39c2da0e6555e549a34f593448
Signed-off-by: default avatarSurendar karka <sukark@codeaurora.org>
parent f67a2861
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -140,6 +140,10 @@ Optional properties:
			 and micbias4 is directly controlled with a register
			 write.

 - qcom,cdc-mic-unmute-delay: based on dmic characteristics the initial pop
			      time that is observed in TX path is varying.
			      Configure PGA unmute delay based on DT value.

 - clock-names : clock name defined for external clock.
 - clocks : external clock defined for codec clock.

+11 −0
Original line number Diff line number Diff line
@@ -2703,6 +2703,7 @@ static struct wcd9xxx_pdata *wcd9xxx_populate_dt_pdata(struct device *dev)
	u32 mad_dmic_sample_rate = 0;
	u32 ecpp_dmic_sample_rate = 0;
	u32 dmic_clk_drive;
	u32 mic_unmute_delay = 0;
	const char *static_prop_name = "qcom,cdc-static-supplies";
	const char *ond_prop_name = "qcom,cdc-on-demand-supplies";
	const char *cp_supplies_name = "qcom,cdc-cp-supplies";
@@ -2856,6 +2857,16 @@ static struct wcd9xxx_pdata *wcd9xxx_populate_dt_pdata(struct device *dev)
	else
		pdata->dmic_clk_drv = dmic_clk_drive;

	ret = of_property_read_u32(dev->of_node,
				"qcom,cdc-mic-unmute-delay",
				&mic_unmute_delay);
	if (ret) {
		dev_err(dev, "Looking up %s property in node %s failed",
			"qcom,cdc-mic-unmute-delay",
			dev->of_node->full_name);
	}
	pdata->mic_unmute_delay = mic_unmute_delay;

	ret = of_property_read_string(dev->of_node,
				"qcom,cdc-variant",
				&cdc_name);
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -189,6 +189,7 @@ struct wcd9xxx_pdata {
	u32 mad_dmic_sample_rate;
	u32 ecpp_dmic_sample_rate;
	u32 dmic_clk_drv;
	u32 mic_unmute_delay;
	enum codec_variant cdc_variant;
	u16 use_pinctrl;
};
+5 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ MODULE_PARM_DESC(sido_buck_svs_voltage,

#define TASHA_TX_UNMUTE_DELAY_MS	25

static int tx_unmute_delay = TASHA_TX_UNMUTE_DELAY_MS;
static u32 tx_unmute_delay = TASHA_TX_UNMUTE_DELAY_MS;
module_param(tx_unmute_delay, int,
		S_IRUGO | S_IWUSR | S_IWGRP);
MODULE_PARM_DESC(tx_unmute_delay, "delay to unmute the tx path");
@@ -5831,6 +5831,7 @@ static int tasha_codec_enable_dec(struct snd_soc_dapm_widget *w,
	char *dec;
	u8 hpf_cut_off_freq;
	struct tasha_priv *tasha = snd_soc_codec_get_drvdata(codec);
	struct wcd9xxx_pdata *pdata = dev_get_platdata(codec->dev->parent);

	dev_dbg(codec->dev, "%s %d\n", __func__, event);

@@ -5923,6 +5924,9 @@ static int tasha_codec_enable_dec(struct snd_soc_dapm_widget *w,
			snd_soc_write(codec, WCD9335_MBHC_ZDET_RAMP_CTL, 0x83);
			snd_soc_write(codec, WCD9335_MBHC_ZDET_RAMP_CTL, 0x03);
		}
		if (pdata->mic_unmute_delay)
			tx_unmute_delay = pdata->mic_unmute_delay;

		/* schedule work queue to Remove Mute */
		schedule_delayed_work(&tasha->tx_mute_dwork[decimator].dwork,
				      msecs_to_jiffies(tx_unmute_delay));