aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/soc.h1
-rw-r--r--sound/soc/soc-core.c1
-rw-r--r--sound/soc/soc-dapm.c2
3 files changed, 4 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index be7a8cd..810d480 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -789,6 +789,7 @@ struct snd_soc_card {
struct mutex mutex;
struct mutex dapm_mutex;
struct mutex dsp_mutex;
+ struct mutex power_mutex;
bool instantiated;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 19ea797..b2bbd08 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3705,6 +3705,7 @@ int snd_soc_register_card(struct snd_soc_card *card)
mutex_init(&card->mutex);
mutex_init(&card->dapm_mutex);
mutex_init(&card->dsp_mutex);
+ mutex_init(&card->power_mutex);
mutex_lock(&client_mutex);
list_add(&card->list, &card_list);
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 443eb2c..008f620 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1498,6 +1498,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
/* Check which widgets we need to power and store them in
* lists indicating if they should be powered up or down.
*/
+ mutex_lock(&card->power_mutex);
list_for_each_entry(w, &card->widgets, list) {
switch (w->id) {
case snd_soc_dapm_pre:
@@ -1532,6 +1533,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
break;
}
}
+ mutex_unlock(&card->power_mutex);
/* If there are no DAPM widgets then try to figure out power from the
* event type.