ASoC: Provide default set_bias_level() implementation
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 19 Aug 2009 13:18:53 +0000 (14:18 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 19 Aug 2009 13:18:53 +0000 (14:18 +0100)
If the CODEC does not provide a set_bias_level() then update the
bias_level variable for it since other parts of the system expect
that to be maintained.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-dapm.c

index 88461310dc967d8df8bea62544b0eb8d7e488689..5cfc90941e492c7545ad669b18db23e9271af4f0 100644 (file)
@@ -148,8 +148,12 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev,
 
        if (card->set_bias_level)
                ret = card->set_bias_level(card, level);
-       if (ret == 0 && codec->set_bias_level)
-               ret = codec->set_bias_level(codec, level);
+       if (ret == 0) {
+               if (codec->set_bias_level)
+                       ret = codec->set_bias_level(codec, level);
+               else
+                       codec->bias_level = level;
+       }
 
        return ret;
 }