Skip to content

Commit

Permalink
ASoC: Provide default set_bias_level() implementation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Aug 19, 2009
1 parent d1a5e44 commit 474e09c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 474e09c

Please sign in to comment.