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

Commit 7c3fd8d9 authored by Bhalchandra Gajare's avatar Bhalchandra Gajare Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd9335: Reserve slimbus port for MAD



MAD (Microphone Activity Detection) audio data is always sent over the
slimbus port TX12. Reserve this port for MAD codec dai. This port on
codec will be setup whenever there is successful keyword detection.

Change-Id: I631629ded5ae013ba4cd0d8a6c3bdeb1d717b334
Signed-off-by: default avatarBhalchandra Gajare <gajare@codeaurora.org>
parent 7d1ff9a3
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -6359,6 +6359,7 @@ static int tasha_set_channel_map(struct snd_soc_dai *dai,
{
	struct tasha_priv *tasha;
	struct wcd9xxx *core;
	struct wcd9xxx_codec_dai_data *dai_data = NULL;

	if (!dai) {
		pr_err("%s: dai is empty\n", __func__);
@@ -6380,6 +6381,12 @@ static int tasha_set_channel_map(struct snd_soc_dai *dai,
	if (tasha->intf_type == WCD9XXX_INTERFACE_TYPE_SLIMBUS) {
		wcd9xxx_init_slimslave(core, core->slim->laddr,
					   tx_num, tx_slot, rx_num, rx_slot);
		/* Reserve TX12 for MAD data channel */
		dai_data = &tasha->dai[AIF4_MAD_TX];
		if (dai_data) {
			list_add_tail(&core->tx_chs[TASHA_TX12].list,
				      &dai_data->wcd9xxx_ch_list);
		}
	}
	return 0;
}
@@ -6688,7 +6695,8 @@ static int tasha_hw_params(struct snd_pcm_substream *substream,
				__func__, tx_fs_rate);
			return -EINVAL;
		}
		if (dai->id != AIF4_VIFEED) {
		if (dai->id != AIF4_VIFEED &&
		    dai->id != AIF4_MAD_TX) {
			ret = tasha_set_decimator_rate(dai, tx_fs_rate,
					params_rate(params));
			if (ret < 0) {