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

Commit 3612525b authored by Sudheer Papothi's avatar Sudheer Papothi Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd9335: Configure DMIC clock rate for ECPP path



DMIC clock on ECPP(Echo Cancellation Ping-Pong) hardware path
can run at lower clock rate to avoid power consumption. Select
ECPP dmic clock rate when decimator is connected only to ECPP
path.

CRs-fixed: 1022917
Change-Id: I968e1fe6b099ebf5334eadb209219181293b207f
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: default avatarVidyakumar Athota <vathota@codeaurora.org>
parent 00e8fad3
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -5639,6 +5639,18 @@ static u32 tasha_get_dmic_sample_rate(struct snd_soc_codec *codec,
		tx_stream_fs = snd_soc_read(codec, tx_fs_reg) & 0x0F;
		dmic_fs = tx_stream_fs <= 4 ? WCD9XXX_DMIC_SAMPLE_RATE_2P4MHZ :
					WCD9XXX_DMIC_SAMPLE_RATE_4P8MHZ;

		/*
		 * Check for ECPP path selection and DEC1 not connected to
		 * any other audio path to apply ECPP DMIC sample rate
		 */
		if ((adc_mux_index == 1) &&
		    ((snd_soc_read(codec, WCD9335_CPE_SS_US_EC_MUX_CFG)
				   & 0x0F) == 0x0A) &&
		    ((snd_soc_read(codec, WCD9335_CDC_IF_ROUTER_TX_MUX_CFG0)
				   & 0x0C) == 0x00)) {
			dmic_fs = pdata->ecpp_dmic_sample_rate;
		}
	} else {
		dmic_fs = pdata->dmic_sample_rate;
	}
@@ -12299,6 +12311,17 @@ static int tasha_handle_pdata(struct tasha_priv *tasha,
		 */
		pdata->mad_dmic_sample_rate = pdata->dmic_sample_rate;
	}
	if (pdata->ecpp_dmic_sample_rate ==
	    WCD9XXX_DMIC_SAMPLE_RATE_UNDEFINED) {
		dev_info(codec->dev,
			 "%s: ecpp_dmic_rate invalid default = %d\n",
			 __func__, def_dmic_rate);
		/*
		 * use dmic_sample_rate as the default for ECPP DMIC
		 * if ecpp dmic sample rate is undefined
		 */
		pdata->ecpp_dmic_sample_rate = pdata->dmic_sample_rate;
	}

	if (pdata->dmic_clk_drv ==
	    WCD9XXX_DMIC_CLK_DRIVE_UNDEFINED) {