diff options
author | Stephen Warren <swarren@nvidia.com> | 2011-11-23 12:42:04 -0700 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-23 21:34:54 +0000 |
commit | 1633281b79fd276f1c7c2fb37c3b97da74e42ae5 (patch) | |
tree | be8fe06be86f436efb3ddece45338e28a394ccdb /sound/soc/soc-core.c | |
parent | d4a2eca781bfd7323bfd98dbc7fd63c7d613fef2 (diff) |
ASoC: Implement fully_routed card property
A card is fully routed if the DAPM route table describes all connections on
the board.
When a card is fully routed, some operations can be automated by the ASoC
core. The first, and currently only, such operation is described below, and
implemented by this patch.
Codecs often have a large number of external pins, and not all of these pins
will be connected on all board designs. Some machine drivers therefore call
snd_soc_dapm_nc_pin() for all the unused pins, in order to tell the ASoC core
never to activate them.
However, when a card is fully routed, the information needed to derive the
set of unused pins is present in card->dapm_routes. In this case, have
the ASoC core automatically call snd_soc_dapm_nc_pin() for each unused
codec pin.
This has been tested with soc/tegra/tegra_wm8903.c and soc/tegra/trimslice.c.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b194842c4cc..2abaf6dcdb0 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1488,6 +1488,10 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) snd_soc_dapm_new_widgets(&card->dapm); + if (card->fully_routed) + list_for_each_entry(codec, &codec_list, list) + snd_soc_dapm_auto_nc_codec_pins(codec); + ret = snd_card_register(card->snd_card); if (ret < 0) { printk(KERN_ERR "asoc: failed to register soundcard for %s\n", card->name); |