diff options
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-dapm.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 873e6e76ee87..d0a4be38dc0f 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -1017,10 +1017,29 @@ EXPORT_SYMBOL_GPL(dapm_reg_event); | |||
1017 | int dapm_regulator_event(struct snd_soc_dapm_widget *w, | 1017 | int dapm_regulator_event(struct snd_soc_dapm_widget *w, |
1018 | struct snd_kcontrol *kcontrol, int event) | 1018 | struct snd_kcontrol *kcontrol, int event) |
1019 | { | 1019 | { |
1020 | if (SND_SOC_DAPM_EVENT_ON(event)) | 1020 | int ret; |
1021 | |||
1022 | if (SND_SOC_DAPM_EVENT_ON(event)) { | ||
1023 | if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) { | ||
1024 | ret = regulator_allow_bypass(w->regulator, true); | ||
1025 | if (ret != 0) | ||
1026 | dev_warn(w->dapm->dev, | ||
1027 | "Failed to bypass %s: %d\n", | ||
1028 | w->name, ret); | ||
1029 | } | ||
1030 | |||
1021 | return regulator_enable(w->regulator); | 1031 | return regulator_enable(w->regulator); |
1022 | else | 1032 | } else { |
1033 | if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) { | ||
1034 | ret = regulator_allow_bypass(w->regulator, false); | ||
1035 | if (ret != 0) | ||
1036 | dev_warn(w->dapm->dev, | ||
1037 | "Failed to unbypass %s: %d\n", | ||
1038 | w->name, ret); | ||
1039 | } | ||
1040 | |||
1023 | return regulator_disable_deferred(w->regulator, w->shift); | 1041 | return regulator_disable_deferred(w->regulator, w->shift); |
1042 | } | ||
1024 | } | 1043 | } |
1025 | EXPORT_SYMBOL_GPL(dapm_regulator_event); | 1044 | EXPORT_SYMBOL_GPL(dapm_regulator_event); |
1026 | 1045 | ||