diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-06-16 18:13:05 +0200 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-06-21 22:34:15 +0200 |
commit | 68f831c2724ab72c0088471b2ed1dc99e81948ef (patch) | |
tree | a012025f0f8ad7de6a9c9af02afc752f088d0c13 /sound/soc/soc-dapm.c | |
parent | Merge remote-tracking branch 'asoc/fix/core' into asoc-component (diff) | |
download | linux-68f831c2724ab72c0088471b2ed1dc99e81948ef.tar.xz linux-68f831c2724ab72c0088471b2ed1dc99e81948ef.zip |
ASoC: Add a set_bias_level() callback to the DAPM context struct
Currently the DAPM code directly looks at the CODEC driver struct to get a
handle to the set_bias_level() callback. This patch adds a new set_bias_level()
callback to the DAPM context struct. The DAPM code will use this new callback
instead of the CODEC callback. For CODECs the new callback is set up to call the
CODEC specific set_bias_level callback(). Not looking directly at the CODEC
driver struct will allow non CODEC DAPM contexts to implement a set_bias_level()
callback.
This is also similar to how the seq_notifier() and stream_event() callbacks are
currently handled.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index fab1a8813abf..6c94a6b3fce7 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -427,15 +427,10 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm, if (ret != 0) goto out; - if (dapm->codec) { - if (dapm->codec->driver->set_bias_level) - ret = dapm->codec->driver->set_bias_level(dapm->codec, - level); - else - dapm->bias_level = level; - } else if (!card || dapm != &card->dapm) { + if (dapm->set_bias_level) + ret = dapm->set_bias_level(dapm, level); + else if (!card || dapm != &card->dapm) dapm->bias_level = level; - } if (ret != 0) goto out; |