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

Commit e8125f04 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

ASoC: uda1380: Cleanup manual bias level transitions



Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.

Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.

The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f114040e
Loading
Loading
Loading
Loading
+2 −18
Original line number Diff line number Diff line
@@ -693,18 +693,6 @@ static struct snd_soc_dai_driver uda1380_dai[] = {
},
};

static int uda1380_suspend(struct snd_soc_codec *codec)
{
	uda1380_set_bias_level(codec, SND_SOC_BIAS_OFF);
	return 0;
}

static int uda1380_resume(struct snd_soc_codec *codec)
{
	uda1380_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
	return 0;
}

static int uda1380_probe(struct snd_soc_codec *codec)
{
	struct uda1380_platform_data *pdata =codec->dev->platform_data;
@@ -739,8 +727,6 @@ static int uda1380_probe(struct snd_soc_codec *codec)

	INIT_WORK(&uda1380->work, uda1380_flush_work);

	/* power on device */
	uda1380_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
	/* set clock input */
	switch (pdata->dac_clk) {
	case UDA1380_DAC_CLK_SYSCLK:
@@ -766,8 +752,6 @@ static int uda1380_remove(struct snd_soc_codec *codec)
{
	struct uda1380_platform_data *pdata =codec->dev->platform_data;

	uda1380_set_bias_level(codec, SND_SOC_BIAS_OFF);

	gpio_free(pdata->gpio_reset);
	gpio_free(pdata->gpio_power);

@@ -777,11 +761,11 @@ static int uda1380_remove(struct snd_soc_codec *codec)
static struct snd_soc_codec_driver soc_codec_dev_uda1380 = {
	.probe =	uda1380_probe,
	.remove =	uda1380_remove,
	.suspend =	uda1380_suspend,
	.resume =	uda1380_resume,
	.read =		uda1380_read_reg_cache,
	.write =	uda1380_write,
	.set_bias_level = uda1380_set_bias_level,
	.suspend_bias_off = true,

	.reg_cache_size = ARRAY_SIZE(uda1380_reg),
	.reg_word_size = sizeof(u16),
	.reg_cache_default = uda1380_reg,