Skip to contentSkip to conversation

ASoC: Add post-CODEC bias level callback for machine driver

PATCH In review Mark Brown 2 participants 2 messages Dec 4, 2010 – Dec 6, 2010

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 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.

---
 include/sound/soc.h  |    2 ++
 sound/soc/soc-dapm.c |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)
include/sound/soc.h +2 -0
index 0eea08e..4abc2f8 100644
@@ -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;
 
sound/soc/soc-dapm.c +4 -0
index 6a29d59..9af2d8a 100644
@@ -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);
 
Signature · 1 line
1.7.2.3
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Mark Brown

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.

include/sound/soc.h struct snd_soc_card { · line 634

Quoted 13 lines
---
 include/sound/soc.h  |    2 ++
 sound/soc/soc-dapm.c |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)
include/sound/soc.h +0 -0
index 0eea08e..4abc2f8 100644
@@ -632,6 +632,8 @@ struct snd_soc_card {
 	/* callbacks */
 	int (*set_bias_level)(struct snd_soc_card *,
 			      enum snd_soc_bias_level level);

I wonder if it's best we now make this

set_bias_level_pre() ?

to avoid any confusion.

Liam

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk