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

Commit f02d95e8 authored by Sudheer Papothi's avatar Sudheer Papothi
Browse files

ASoC: msmcobalt: Check for number of aux codecs



Add a check for number of aux codecs before applying the
aux codec gain settings from machine driver to avoid
setting the gains if there are no aux codecs connected.

Change-Id: I86e6c4a15e6eed8e4650c6eb072f07f49890aecc
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
parent 626caf4e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2531,8 +2531,10 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
	 * Send speaker configuration only for WSA8810.
	 * Defalut configuration is for WSA8815.
	 */
	pr_debug("%s: Number of aux devices: %d\n",
		__func__, rtd->card->num_aux_devs);
	if (!strcmp(dev_name(codec_dai->dev), "tavil_codec")) {
		if (rtd_aux && rtd_aux->component)
		if (rtd->card->num_aux_devs && rtd_aux && rtd_aux->component)
			if (!strcmp(rtd_aux->component->name, WSA8810_NAME_1) ||
			    !strcmp(rtd_aux->component->name, WSA8810_NAME_2)) {
				tavil_set_spkr_mode(rtd->codec, SPKR_MODE_1);
@@ -2551,7 +2553,7 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
		pdata->codec_root = entry;
		tavil_codec_info_create_codec_entry(pdata->codec_root, codec);
	} else {
		if (rtd_aux && rtd_aux->component)
		if (rtd->card->num_aux_devs && rtd_aux && rtd_aux->component)
			if (!strcmp(rtd_aux->component->name, WSA8810_NAME_1) ||
			    !strcmp(rtd_aux->component->name, WSA8810_NAME_2)) {
				tasha_set_spkr_mode(rtd->codec, SPKR_MODE_1);