diff options
author | Jarkko Nikula <jhnikula@gmail.com> | 2010-12-14 05:18:31 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-12-15 13:01:01 -0500 |
commit | 97c866defc0fc6e18b49603ac19f732f53e79c46 (patch) | |
tree | 66ba8412fad0974ebf9a30c45ad5d81f26607e6e /sound/soc/codecs/wm8960.c | |
parent | 8ddab3f5107c3955e70e87a632d4d179ddba1189 (diff) |
ASoC: Move widgets from DAPM context to snd_soc_card
Decoupling widgets from DAPM context is required when extending the ASoC
core to cross-device paths. Even the list of widgets are now kept in
struct snd_soc_card, the widget listing in sysfs and debugs remain sorted
per device.
This patch makes possible to build cross-device paths but does not extend
yet the DAPM to handle codec bias and widget power changes of an another
device.
Cross-device paths are registered by listing the widgets from device A in
a map for device B. In case of conflicting widget names between the devices,
a uniform name prefix is needed to separate them. See commit ead9b91
"ASoC: Add optional name_prefix for kcontrol, widget and route names" for
help.
An example below shows a path that connects MONO out of A into Line In of B:
static const struct snd_soc_dapm_route mapA[] = {
{"MONO", NULL, "DAC"},
};
static const struct snd_soc_dapm_route mapB[] = {
{"Line In", NULL, "MONO"},
};
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8960.c')
-rw-r--r-- | sound/soc/codecs/wm8960.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index 2c5712dce1d5..054f5737319c 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c | |||
@@ -418,7 +418,9 @@ static int wm8960_add_widgets(struct snd_soc_codec *codec) | |||
418 | * list each time to find the desired power state do so now | 418 | * list each time to find the desired power state do so now |
419 | * and save the result. | 419 | * and save the result. |
420 | */ | 420 | */ |
421 | list_for_each_entry(w, &codec->dapm.widgets, list) { | 421 | list_for_each_entry(w, &codec->card->widgets, list) { |
422 | if (w->dapm != &codec->dapm) | ||
423 | continue; | ||
422 | if (strcmp(w->name, "LOUT1 PGA") == 0) | 424 | if (strcmp(w->name, "LOUT1 PGA") == 0) |
423 | wm8960->lout1 = w; | 425 | wm8960->lout1 = w; |
424 | if (strcmp(w->name, "ROUT1 PGA") == 0) | 426 | if (strcmp(w->name, "ROUT1 PGA") == 0) |