summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-09-04 19:44:06 +0200
committerZidan Wang <zidan.wang@freescale.com>2015-10-30 14:58:01 +0800
commitf42914b80a3ef5d04cd9ac56b57b1f6b9c94f09a (patch)
tree3b81c86529f07285eaffaa44ffa2e43d5c5c6f67 /include
parentb2ac46adf4c2f49f3c94f3c15c33d4abf27b7a6a (diff)
ASoC: Add support for automatically going to BIAS_OFF on suspend
There is a substantial amount of drivers that in go to SND_SOC_BIAS_OFF on suspend and go back to SND_SOC_BIAS_SUSPEND on resume (Often this is even the only thing done in the suspend and resume handlers). This patch introduces a new suspend_bias_off flag, which when set by a driver will let the ASoC core automatically put the device's DAPM context at the SND_SOC_BIAS_OFF level during suspend. Once the device is resumed the DAPM context will go back to SND_SOC_BIAS_STANDBY (if the context is idle, otherwise to SND_SOC_BIAS_ON). This will allow us to remove a fair bit of duplicated code from the drivers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 86dbf2ac6fcb2d2932d4610f2dfe0954aa0633f7) Conflicts: sound/soc/soc-core.c
Diffstat (limited to 'include')
-rw-r--r--include/sound/soc-dapm.h3
-rw-r--r--include/sound/soc.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 13412ab158ee..5f2ce73096c8 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -625,7 +625,8 @@ struct snd_soc_dapm_context {
enum snd_soc_bias_level suspend_bias_level;
struct delayed_work delayed_work;
unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
-
+ /* Go to BIAS_OFF in suspend if the DAPM context is idle */
+ unsigned int suspend_bias_off:1;
void (*seq_notifier)(struct snd_soc_dapm_context *,
enum snd_soc_dapm_type, int);
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 59a47851f5c8..91a9efd80b16 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -774,6 +774,7 @@ struct snd_soc_codec_driver {
int (*set_bias_level)(struct snd_soc_codec *,
enum snd_soc_bias_level level);
bool idle_bias_off;
+ bool suspend_bias_off;
void (*seq_notifier)(struct snd_soc_dapm_context *,
enum snd_soc_dapm_type, int);