ASoC: es8328: Cleanup manual bias level transitions
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 6 Sep 2014 12:29:32 +0000 (14:29 +0200)
committerMark Brown <broonie@kernel.org>
Sat, 6 Sep 2014 12:38:30 +0000 (13:38 +0100)
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.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/es8328.c

index 3ff787063304381ee086876031df2eb5a9ee7ac9..f27325155acef31e1f4a7fff4ea970b9405ca8a7 100644 (file)
@@ -602,8 +602,6 @@ static int es8328_suspend(struct snd_soc_codec *codec)
 
        es8328 = snd_soc_codec_get_drvdata(codec);
 
-       es8328_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
        clk_disable_unprepare(es8328->clk);
 
        ret = regulator_bulk_disable(ARRAY_SIZE(es8328->supplies),
@@ -643,7 +641,6 @@ static int es8328_resume(struct snd_soc_codec *codec)
                return ret;
        }
 
-       es8328_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
        return 0;
 }
 
@@ -712,6 +709,8 @@ static struct snd_soc_codec_driver es8328_codec_driver = {
        .resume           = es8328_resume,
        .remove           = es8328_remove,
        .set_bias_level   = es8328_set_bias_level,
+       .suspend_bias_off = true,
+
        .controls         = es8328_snd_controls,
        .num_controls     = ARRAY_SIZE(es8328_snd_controls),
        .dapm_widgets     = es8328_dapm_widgets,