diff options
-rw-r--r-- | sound/soc/soc-dapm.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 78aa19257143..e1863d7e8012 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -1719,7 +1719,7 @@ static inline void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm) | |||
1719 | #endif | 1719 | #endif |
1720 | 1720 | ||
1721 | /* test and update the power status of a mux widget */ | 1721 | /* test and update the power status of a mux widget */ |
1722 | int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget, | 1722 | static int soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget, |
1723 | struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e) | 1723 | struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e) |
1724 | { | 1724 | { |
1725 | struct snd_soc_dapm_path *path; | 1725 | struct snd_soc_dapm_path *path; |
@@ -1758,10 +1758,22 @@ int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget, | |||
1758 | 1758 | ||
1759 | return 0; | 1759 | return 0; |
1760 | } | 1760 | } |
1761 | |||
1762 | int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget, | ||
1763 | struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e) | ||
1764 | { | ||
1765 | struct snd_soc_card *card = widget->dapm->card; | ||
1766 | int ret; | ||
1767 | |||
1768 | mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_PCM); | ||
1769 | ret = soc_dapm_mux_update_power(widget, kcontrol, mux, e); | ||
1770 | mutex_unlock(&card->dapm_mutex); | ||
1771 | return ret; | ||
1772 | } | ||
1761 | EXPORT_SYMBOL_GPL(snd_soc_dapm_mux_update_power); | 1773 | EXPORT_SYMBOL_GPL(snd_soc_dapm_mux_update_power); |
1762 | 1774 | ||
1763 | /* test and update the power status of a mixer or switch widget */ | 1775 | /* test and update the power status of a mixer or switch widget */ |
1764 | int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, | 1776 | static int soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, |
1765 | struct snd_kcontrol *kcontrol, int connect) | 1777 | struct snd_kcontrol *kcontrol, int connect) |
1766 | { | 1778 | { |
1767 | struct snd_soc_dapm_path *path; | 1779 | struct snd_soc_dapm_path *path; |
@@ -1790,6 +1802,18 @@ int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, | |||
1790 | 1802 | ||
1791 | return 0; | 1803 | return 0; |
1792 | } | 1804 | } |
1805 | |||
1806 | int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, | ||
1807 | struct snd_kcontrol *kcontrol, int connect) | ||
1808 | { | ||
1809 | struct snd_soc_card *card = widget->dapm->card; | ||
1810 | int ret; | ||
1811 | |||
1812 | mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_PCM); | ||
1813 | ret = soc_dapm_mixer_update_power(widget, kcontrol, connect); | ||
1814 | mutex_unlock(&card->dapm_mutex); | ||
1815 | return ret; | ||
1816 | } | ||
1793 | EXPORT_SYMBOL_GPL(snd_soc_dapm_mixer_update_power); | 1817 | EXPORT_SYMBOL_GPL(snd_soc_dapm_mixer_update_power); |
1794 | 1818 | ||
1795 | /* show dapm widget status in sys fs */ | 1819 | /* show dapm widget status in sys fs */ |
@@ -2393,7 +2417,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
2393 | update.val = val; | 2417 | update.val = val; |
2394 | widget->dapm->update = &update; | 2418 | widget->dapm->update = &update; |
2395 | 2419 | ||
2396 | snd_soc_dapm_mixer_update_power(widget, kcontrol, connect); | 2420 | soc_dapm_mixer_update_power(widget, kcontrol, connect); |
2397 | 2421 | ||
2398 | widget->dapm->update = NULL; | 2422 | widget->dapm->update = NULL; |
2399 | } | 2423 | } |
@@ -2485,7 +2509,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, | |||
2485 | update.val = val; | 2509 | update.val = val; |
2486 | widget->dapm->update = &update; | 2510 | widget->dapm->update = &update; |
2487 | 2511 | ||
2488 | snd_soc_dapm_mux_update_power(widget, kcontrol, mux, e); | 2512 | soc_dapm_mux_update_power(widget, kcontrol, mux, e); |
2489 | 2513 | ||
2490 | widget->dapm->update = NULL; | 2514 | widget->dapm->update = NULL; |
2491 | } | 2515 | } |
@@ -2547,7 +2571,7 @@ int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol, | |||
2547 | 2571 | ||
2548 | widget->value = ucontrol->value.enumerated.item[0]; | 2572 | widget->value = ucontrol->value.enumerated.item[0]; |
2549 | 2573 | ||
2550 | snd_soc_dapm_mux_update_power(widget, kcontrol, widget->value, e); | 2574 | soc_dapm_mux_update_power(widget, kcontrol, widget->value, e); |
2551 | } | 2575 | } |
2552 | } | 2576 | } |
2553 | 2577 | ||
@@ -2651,7 +2675,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, | |||
2651 | update.val = val; | 2675 | update.val = val; |
2652 | widget->dapm->update = &update; | 2676 | widget->dapm->update = &update; |
2653 | 2677 | ||
2654 | snd_soc_dapm_mux_update_power(widget, kcontrol, mux, e); | 2678 | soc_dapm_mux_update_power(widget, kcontrol, mux, e); |
2655 | 2679 | ||
2656 | widget->dapm->update = NULL; | 2680 | widget->dapm->update = NULL; |
2657 | } | 2681 | } |