ASoC: ak4641: Cleanup manual bias level transitions
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 20 Oct 2014 08:56:30 +0000 (10:56 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 22 Oct 2014 10:28:25 +0000 (11:28 +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.

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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/ak4641.c

index 7afe8f4820887b695cb20912f9f68e0c17de7de1..70861c7b1631ab577acf506f8af18f2386a0852a 100644 (file)
@@ -505,39 +505,7 @@ static struct snd_soc_dai_driver ak4641_dai[] = {
 },
 };
 
-static int ak4641_suspend(struct snd_soc_codec *codec)
-{
-       ak4641_set_bias_level(codec, SND_SOC_BIAS_OFF);
-       return 0;
-}
-
-static int ak4641_resume(struct snd_soc_codec *codec)
-{
-       ak4641_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-       return 0;
-}
-
-static int ak4641_probe(struct snd_soc_codec *codec)
-{
-       /* power on device */
-       ak4641_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-       return 0;
-}
-
-static int ak4641_remove(struct snd_soc_codec *codec)
-{
-       ak4641_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
-       return 0;
-}
-
-
 static struct snd_soc_codec_driver soc_codec_dev_ak4641 = {
-       .probe                  = ak4641_probe,
-       .remove                 = ak4641_remove,
-       .suspend                = ak4641_suspend,
-       .resume                 = ak4641_resume,
        .controls               = ak4641_snd_controls,
        .num_controls           = ARRAY_SIZE(ak4641_snd_controls),
        .dapm_widgets           = ak4641_dapm_widgets,
@@ -545,6 +513,7 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4641 = {
        .dapm_routes            = ak4641_audio_map,
        .num_dapm_routes        = ARRAY_SIZE(ak4641_audio_map),
        .set_bias_level         = ak4641_set_bias_level,
+       .suspend_bias_off       = true,
 };
 
 static const struct regmap_config ak4641_regmap = {