diff options
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 86ded22e36af..bbb2135a0b21 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -979,7 +979,10 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event) | |||
979 | break; | 979 | break; |
980 | 980 | ||
981 | default: | 981 | default: |
982 | power = w->power_check(w); | 982 | if (!w->force) |
983 | power = w->power_check(w); | ||
984 | else | ||
985 | power = 1; | ||
983 | if (power) | 986 | if (power) |
984 | sys_power = 1; | 987 | sys_power = 1; |
985 | break; | 988 | break; |
@@ -2134,6 +2137,36 @@ int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin) | |||
2134 | EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin); | 2137 | EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin); |
2135 | 2138 | ||
2136 | /** | 2139 | /** |
2140 | * snd_soc_dapm_force_enable_pin - force a pin to be enabled | ||
2141 | * @codec: SoC codec | ||
2142 | * @pin: pin name | ||
2143 | * | ||
2144 | * Enables input/output pin regardless of any other state. This is | ||
2145 | * intended for use with microphone bias supplies used in microphone | ||
2146 | * jack detection. | ||
2147 | * | ||
2148 | * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to | ||
2149 | * do any widget power switching. | ||
2150 | */ | ||
2151 | int snd_soc_dapm_force_enable_pin(struct snd_soc_codec *codec, const char *pin) | ||
2152 | { | ||
2153 | struct snd_soc_dapm_widget *w; | ||
2154 | |||
2155 | list_for_each_entry(w, &codec->dapm_widgets, list) { | ||
2156 | if (!strcmp(w->name, pin)) { | ||
2157 | pr_debug("dapm: %s: pin %s\n", codec->name, pin); | ||
2158 | w->connected = 1; | ||
2159 | w->force = 1; | ||
2160 | return 0; | ||
2161 | } | ||
2162 | } | ||
2163 | |||
2164 | pr_err("dapm: %s: configuring unknown pin %s\n", codec->name, pin); | ||
2165 | return -EINVAL; | ||
2166 | } | ||
2167 | EXPORT_SYMBOL_GPL(snd_soc_dapm_force_enable_pin); | ||
2168 | |||
2169 | /** | ||
2137 | * snd_soc_dapm_disable_pin - disable pin. | 2170 | * snd_soc_dapm_disable_pin - disable pin. |
2138 | * @codec: SoC codec | 2171 | * @codec: SoC codec |
2139 | * @pin: pin name | 2172 | * @pin: pin name |