Skip to content

Commit

Permalink
ASoC: snd_soc_dapm_get_pin_status: Match other contexts too
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Warren authored and Mark Brown committed Apr 20, 2011
1 parent a32955d commit a68b38a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2403,6 +2403,12 @@ int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm,
return w->connected;
}

/* Try again in other contexts */
list_for_each_entry(w, &dapm->card->widgets, list) {
if (!strcmp(w->name, pin))
return w->connected;
}

return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_get_pin_status);
Expand Down

0 comments on commit a68b38a

Please sign in to comment.