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

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

ASoC: wcd934x: Avoid soundwire enable when codec is in power collapse



During SSR, when the playback on speaker gets started before codec
is out of digital core power collapse, results in soundwire
register read/write failures. Check for codec power state before
enabling the soundwire during speaker device path enablement for
playback usecase to avoid soundwire register read/write failures.

Change-Id: I3b45ef0c34ad4f97aad89afaf719989ffbda7485
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
parent 662dec1e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2974,6 +2974,11 @@ static int __tavil_codec_enable_swr(struct snd_soc_dapm_widget *w, int event)
			tavil->swr.rx_8_count++;
		ch_cnt = !!(tavil->swr.rx_7_count) + tavil->swr.rx_8_count;

		if (wcd9xxx_get_current_power_state(tavil->wcd9xxx,
						WCD9XXX_DIG_CORE_REGION_1)
					!= WCD_REGION_POWER_COLLAPSE_REMOVE)
			goto done;

		swrm_wcd_notify(tavil->swr.ctrl_data[0].swr_pdev,
				SWR_DEVICE_UP, NULL);
		swrm_wcd_notify(tavil->swr.ctrl_data[0].swr_pdev,
@@ -2994,6 +2999,7 @@ static int __tavil_codec_enable_swr(struct snd_soc_dapm_widget *w, int event)

		break;
	}
done:
	dev_dbg(tavil->dev, "%s: %s: current swr ch cnt: %d\n",
		__func__, w->name, ch_cnt);