diff options
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 8c8b291320a8..fefb6c44fc81 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -441,7 +441,9 @@ static int snd_soc_dapm_suspend_check(struct snd_soc_dapm_widget *widget) | |||
441 | switch (snd_power_get_state(codec->card)) { | 441 | switch (snd_power_get_state(codec->card)) { |
442 | case SNDRV_CTL_POWER_D3hot: | 442 | case SNDRV_CTL_POWER_D3hot: |
443 | case SNDRV_CTL_POWER_D3cold: | 443 | case SNDRV_CTL_POWER_D3cold: |
444 | return 0; | 444 | if (widget->ignore_suspend) |
445 | pr_debug("%s ignoring suspend\n", widget->name); | ||
446 | return widget->ignore_suspend; | ||
445 | default: | 447 | default: |
446 | return 1; | 448 | return 1; |
447 | } | 449 | } |
@@ -2137,6 +2139,33 @@ int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin) | |||
2137 | EXPORT_SYMBOL_GPL(snd_soc_dapm_get_pin_status); | 2139 | EXPORT_SYMBOL_GPL(snd_soc_dapm_get_pin_status); |
2138 | 2140 | ||
2139 | /** | 2141 | /** |
2142 | * snd_soc_dapm_ignore_suspend - ignore suspend status for DAPM endpoint | ||
2143 | * @codec: audio codec | ||
2144 | * @pin: audio signal pin endpoint (or start point) | ||
2145 | * | ||
2146 | * Mark the given endpoint or pin as ignoring suspend. When the | ||
2147 | * system is disabled a path between two endpoints flagged as ignoring | ||
2148 | * suspend will not be disabled. The path must already be enabled via | ||
2149 | * normal means at suspend time, it will not be turned on if it was not | ||
2150 | * already enabled. | ||
2151 | */ | ||
2152 | int snd_soc_dapm_ignore_suspend(struct snd_soc_codec *codec, const char *pin) | ||
2153 | { | ||
2154 | struct snd_soc_dapm_widget *w; | ||
2155 | |||
2156 | list_for_each_entry(w, &codec->dapm_widgets, list) { | ||
2157 | if (!strcmp(w->name, pin)) { | ||
2158 | w->ignore_suspend = 1; | ||
2159 | return 0; | ||
2160 | } | ||
2161 | } | ||
2162 | |||
2163 | pr_err("Unknown DAPM pin: %s\n", pin); | ||
2164 | return -EINVAL; | ||
2165 | } | ||
2166 | EXPORT_SYMBOL_GPL(snd_soc_dapm_ignore_suspend); | ||
2167 | |||
2168 | /** | ||
2140 | * snd_soc_dapm_free - free dapm resources | 2169 | * snd_soc_dapm_free - free dapm resources |
2141 | * @socdev: SoC device | 2170 | * @socdev: SoC device |
2142 | * | 2171 | * |