aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2011-04-19 17:25:11 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-04-20 08:50:06 -0400
commita68b38ada57bc9aeeec574d3e76e67ad89fea303 (patch)
treeebf9e6270beb7bb8f16aae827d3f010ea5a41da1 /sound/soc/soc-dapm.c
parenta32955dba2e2629bddacf7c1b9de3bf1b7c56acf (diff)
ASoC: snd_soc_dapm_get_pin_status: Match other contexts too
Not all widgets on a card are within the codec's DAPM context. Fix snd_soc_dapm_get_pin_status to search all contexts when looking for a widget. This change is required when modifying tegra_wm8903 to use snd_soc_card.widgets rather than calling snd_soc_dapm_new_controls; the former adds the widgets to the card's DAPM context, whereas tegra_wm8903 uses the codec's DAPM context when calling snd_soc_dapm_new_controls. By code inspection, I suspect this also applies to Samsung Speyside. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 2ee738c08ca4..4c868f9087f4 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2403,6 +2403,12 @@ int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm,
2403 return w->connected; 2403 return w->connected;
2404 } 2404 }
2405 2405
2406 /* Try again in other contexts */
2407 list_for_each_entry(w, &dapm->card->widgets, list) {
2408 if (!strcmp(w->name, pin))
2409 return w->connected;
2410 }
2411
2406 return 0; 2412 return 0;
2407} 2413}
2408EXPORT_SYMBOL_GPL(snd_soc_dapm_get_pin_status); 2414EXPORT_SYMBOL_GPL(snd_soc_dapm_get_pin_status);