aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-07-24 09:27:36 -0400
committerMark Brown <broonie@linaro.org>2013-07-24 09:56:19 -0400
commitc3f48ae6fd5a1ebdcaff5efe35f88f31daaee225 (patch)
tree6c4b3a672a50f214b6a4ab19ba77307398a3c39d
parent63c69a6e4134a2085d40e40c02a395dd1bd8c023 (diff)
ASoC: dapm: Pass snd_soc_card directly to soc_dpcm_runtime_update()
soc_dpcm_runtime_update() operates on a ASoC card as a whole. Currently it takes a snd_soc_dapm_widget as its only parameter though. The widget is then used to look up the card and is otherwise unused. This patch changes the function to take a pointer to the card directly. This makes it possible to to call soc_dpcm_runtime_update() for updates which are not related to one specific widget. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--include/sound/soc-dpcm.h2
-rw-r--r--sound/soc/soc-dapm.c4
-rw-r--r--sound/soc/soc-pcm.c10
3 files changed, 4 insertions, 12 deletions
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h
index 04598f1efd77..047d657c331c 100644
--- a/include/sound/soc-dpcm.h
+++ b/include/sound/soc-dpcm.h
@@ -133,6 +133,6 @@ void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream,
133/* internal use only */ 133/* internal use only */
134int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute); 134int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute);
135int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); 135int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd);
136int soc_dpcm_runtime_update(struct snd_soc_dapm_widget *); 136int soc_dpcm_runtime_update(struct snd_soc_card *);
137 137
138#endif 138#endif
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 378655839f74..8d9c09b266fd 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1986,7 +1986,7 @@ int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
1986 ret = soc_dapm_mux_update_power(widget, kcontrol, mux, e); 1986 ret = soc_dapm_mux_update_power(widget, kcontrol, mux, e);
1987 mutex_unlock(&card->dapm_mutex); 1987 mutex_unlock(&card->dapm_mutex);
1988 if (ret > 0) 1988 if (ret > 0)
1989 soc_dpcm_runtime_update(widget); 1989 soc_dpcm_runtime_update(card);
1990 return ret; 1990 return ret;
1991} 1991}
1992EXPORT_SYMBOL_GPL(snd_soc_dapm_mux_update_power); 1992EXPORT_SYMBOL_GPL(snd_soc_dapm_mux_update_power);
@@ -2032,7 +2032,7 @@ int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
2032 ret = soc_dapm_mixer_update_power(widget, kcontrol, connect); 2032 ret = soc_dapm_mixer_update_power(widget, kcontrol, connect);
2033 mutex_unlock(&card->dapm_mutex); 2033 mutex_unlock(&card->dapm_mutex);
2034 if (ret > 0) 2034 if (ret > 0)
2035 soc_dpcm_runtime_update(widget); 2035 soc_dpcm_runtime_update(card);
2036 return ret; 2036 return ret;
2037} 2037}
2038EXPORT_SYMBOL_GPL(snd_soc_dapm_mixer_update_power); 2038EXPORT_SYMBOL_GPL(snd_soc_dapm_mixer_update_power);
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index b6c640332a17..5c2c66209808 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1832,18 +1832,10 @@ static int dpcm_run_old_update(struct snd_soc_pcm_runtime *fe, int stream)
1832/* Called by DAPM mixer/mux changes to update audio routing between PCMs and 1832/* Called by DAPM mixer/mux changes to update audio routing between PCMs and
1833 * any DAI links. 1833 * any DAI links.
1834 */ 1834 */
1835int soc_dpcm_runtime_update(struct snd_soc_dapm_widget *widget) 1835int soc_dpcm_runtime_update(struct snd_soc_card *card)
1836{ 1836{
1837 struct snd_soc_card *card;
1838 int i, old, new, paths; 1837 int i, old, new, paths;
1839 1838
1840 if (widget->codec)
1841 card = widget->codec->card;
1842 else if (widget->platform)
1843 card = widget->platform->card;
1844 else
1845 return -EINVAL;
1846
1847 mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_RUNTIME); 1839 mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
1848 for (i = 0; i < card->num_rtd; i++) { 1840 for (i = 0; i < card->num_rtd; i++) {
1849 struct snd_soc_dapm_widget_list *list; 1841 struct snd_soc_dapm_widget_list *list;