From: Mark Brown Date: Sat, 4 Dec 2010 12:41:04 +0000 (+0000) Subject: ASoC: Add post-CODEC bias level callback for machine driver X-Git-Tag: v2.6.38-rc1~236^2^2~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1badabd980da3bc09933c14970017067940ecd57;p=thirdparty%2Fkernel%2Flinux.git ASoC: Add post-CODEC bias level callback for machine driver Currently the machine driver can only do bias level configuration before the CODEC bias level is brought up. This means that the machine cannot do any configuration which depends on the CODEC bias level being maintained. Provide a post-CODEC callback which allows the machine driver to do things like enable the FLL on a CODEC which is brought down to BIAS_OFF when idle. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- diff --git a/include/sound/soc.h b/include/sound/soc.h index 0eea08e1bdd5e..4abc2f8fe77a8 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -632,6 +632,8 @@ struct snd_soc_card { /* callbacks */ int (*set_bias_level)(struct snd_soc_card *, enum snd_soc_bias_level level); + int (*set_bias_level_post)(struct snd_soc_card *, + enum snd_soc_bias_level level); long pmdown_time; diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 6a29d59dabaf2..9af2d8ad08952 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -162,6 +162,10 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_card *card, else dapm->bias_level = level; } + if (ret == 0) { + if (card && card->set_bias_level_post) + ret = card->set_bias_level_post(card, level); + } trace_snd_soc_bias_level_done(card, level);