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

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

Merge "ASoC: wcd9335: Fix digital power collapse when XO shutdown"

parents 30592e78 279f92c8
Loading
Loading
Loading
Loading
+24 −8
Original line number Diff line number Diff line
@@ -10008,15 +10008,9 @@ static struct snd_soc_dai_driver tasha_dai[] = {
	},
};

static void tasha_codec_power_gate_work(struct work_struct *work)
static void tasha_codec_power_gate_digital_core(struct tasha_priv *tasha)
{
	struct tasha_priv *tasha;
	struct delayed_work *dwork;
	struct snd_soc_codec *codec;

	dwork = to_delayed_work(work);
	tasha = container_of(dwork, struct tasha_priv, power_gate_work);
	codec = tasha->codec;
	struct snd_soc_codec *codec = tasha->codec;

	if (!codec)
		return;
@@ -10047,6 +10041,22 @@ exit:
	mutex_unlock(&tasha->power_lock);
}

static void tasha_codec_power_gate_work(struct work_struct *work)
{
	struct tasha_priv *tasha;
	struct delayed_work *dwork;
	struct snd_soc_codec *codec;

	dwork = to_delayed_work(work);
	tasha = container_of(dwork, struct tasha_priv, power_gate_work);
	codec = tasha->codec;

	if (!codec)
		return;

	tasha_codec_power_gate_digital_core(tasha);
}

/* called under power_lock acquisition */
static int tasha_dig_core_remove_power_collapse(struct snd_soc_codec *codec)
{
@@ -11551,7 +11561,13 @@ static struct snd_soc_codec_driver soc_codec_dev_tasha = {
#ifdef CONFIG_PM
static int tasha_suspend(struct device *dev)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct tasha_priv *tasha = platform_get_drvdata(pdev);

	dev_dbg(dev, "%s: system suspend\n", __func__);
	if (cancel_delayed_work_sync(&tasha->power_gate_work))
		tasha_codec_power_gate_digital_core(tasha);

	return 0;
}