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

Commit 07259582 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: msm8x10-wcd: update sound card state before/after ssr"

parents b6d69b22 fc001140
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -3007,10 +3007,21 @@ static struct regulator *wcd8x10_wcd_codec_find_regulator(

	return NULL;
}
static int msm8x10_wcd_device_down(struct snd_soc_codec *codec)
{
	dev_dbg(codec->dev, "%s: device down!\n", __func__);

	snd_soc_card_change_online_state(codec->card, 0);
	return 0;
}

static int msm8x10_wcd_device_up(struct snd_soc_codec *codec)
{
	pr_debug("%s: device up!\n", __func__);
	dev_dbg(codec->dev, "%s: device up!\n", __func__);

	snd_soc_card_change_online_state(codec->card, 1);
	/* delay is required to make sure sound card state updated */
	usleep_range(5000, 5100);

	mutex_lock(&codec->mutex);

@@ -3030,7 +3041,9 @@ static int adsp_state_callback(struct notifier_block *nb, unsigned long value,
	unsigned long timeout;
	static bool booted_once;

	if (value == SUBSYS_AFTER_POWERUP) {
	if (value == SUBSYS_BEFORE_SHUTDOWN)
		msm8x10_wcd_device_down(registered_codec);
	else if (value == SUBSYS_AFTER_POWERUP) {

		if (!booted_once) {
			booted_once = true;