aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 025060b26fb..4d181df95dc 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -291,9 +291,9 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
291 if (dapm->codec->driver->set_bias_level) 291 if (dapm->codec->driver->set_bias_level)
292 ret = dapm->codec->driver->set_bias_level(dapm->codec, 292 ret = dapm->codec->driver->set_bias_level(dapm->codec,
293 level); 293 level);
294 else 294 } else
295 dapm->bias_level = level; 295 dapm->bias_level = level;
296 } 296
297 if (ret != 0) 297 if (ret != 0)
298 goto out; 298 goto out;
299 299
@@ -324,11 +324,10 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
324 324
325 val = soc_widget_read(w, reg); 325 val = soc_widget_read(w, reg);
326 val = (val >> shift) & mask; 326 val = (val >> shift) & mask;
327 if (invert)
328 val = max - val;
327 329
328 if ((invert && !val) || (!invert && val)) 330 p->connect = !!val;
329 p->connect = 1;
330 else
331 p->connect = 0;
332 } 331 }
333 break; 332 break;
334 case snd_soc_dapm_mux: { 333 case snd_soc_dapm_mux: {
@@ -3668,10 +3667,13 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_free);
3668 3667
3669static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm) 3668static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm)
3670{ 3669{
3670 struct snd_soc_card *card = dapm->card;
3671 struct snd_soc_dapm_widget *w; 3671 struct snd_soc_dapm_widget *w;
3672 LIST_HEAD(down_list); 3672 LIST_HEAD(down_list);
3673 int powerdown = 0; 3673 int powerdown = 0;
3674 3674
3675 mutex_lock(&card->dapm_mutex);
3676
3675 list_for_each_entry(w, &dapm->card->widgets, list) { 3677 list_for_each_entry(w, &dapm->card->widgets, list) {
3676 if (w->dapm != dapm) 3678 if (w->dapm != dapm)
3677 continue; 3679 continue;
@@ -3694,6 +3696,8 @@ static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm)
3694 snd_soc_dapm_set_bias_level(dapm, 3696 snd_soc_dapm_set_bias_level(dapm,
3695 SND_SOC_BIAS_STANDBY); 3697 SND_SOC_BIAS_STANDBY);
3696 } 3698 }
3699
3700 mutex_unlock(&card->dapm_mutex);
3697} 3701}
3698 3702
3699/* 3703/*