Skip to contentSkip to conversation

ASoC: Allow idle_bias_off to be specified in CODEC drivers

PATCH In review Mark Brown 2 participants 2 messages Aug 22, 2011

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Allow idle_bias_off to be specified in CODEC drivers

If devices can unconditionally support idle_bias_off let them flag it in their driver structure.

---
 include/sound/soc.h  |    1 +
 sound/soc/soc-core.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)
include/sound/soc.h +1 -0
index 3fe658e..6da55a1 100644
@@ -633,6 +633,7 @@ struct snd_soc_codec_driver {
 	/* codec bias level */
 	int (*set_bias_level)(struct snd_soc_codec *,
 			      enum snd_soc_bias_level level);
+	bool idle_bias_off;
 
 	void (*seq_notifier)(struct snd_soc_dapm_context *,
 			     enum snd_soc_dapm_type, int);
sound/soc/soc-core.c +2 -0
index ae93aa8..f8f985a 100644
@@ -956,6 +956,8 @@ static int soc_probe_codec(struct snd_soc_card *card,
 		snd_soc_dapm_new_controls(&codec->dapm, driver->dapm_widgets,
 					  driver->num_dapm_widgets);
 
+	codec->dapm.idle_bias_off = driver->idle_bias_off;
+
 	if (driver->probe) {
 		ret = driver->probe(codec);
 		if (ret < 0) {
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Mark Brown

If devices can unconditionally support idle_bias_off let them flag it in their driver structure.

Quoted 30 lines
---
 include/sound/soc.h  |    1 +
 sound/soc/soc-core.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)
include/sound/soc.h +1 -0
index 3fe658e..6da55a1 100644
@@ -633,6 +633,7 @@ struct snd_soc_codec_driver {
 	/* codec bias level */
 	int (*set_bias_level)(struct snd_soc_codec *,
 			      enum snd_soc_bias_level level);
+	bool idle_bias_off;
 
 	void (*seq_notifier)(struct snd_soc_dapm_context *,
 			     enum snd_soc_dapm_type, int);
sound/soc/soc-core.c +2 -0
index ae93aa8..f8f985a 100644
@@ -956,6 +956,8 @@ static int soc_probe_codec(struct snd_soc_card *card,
 		snd_soc_dapm_new_controls(&codec->dapm, driver->dapm_widgets,
 					  driver->num_dapm_widgets);
 
+	codec->dapm.idle_bias_off = driver->idle_bias_off;
+
 	if (driver->probe) {
 		ret = driver->probe(codec);
 		if (ret < 0) {