diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-04-07 19:18:44 +0900 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-04-08 09:18:11 +0900 |
commit | b7af1dafdfaf8419065399d07fb7cbae14b286ef (patch) | |
tree | 1b7a97fdc716edeed1b236e65d8afd3c3cbd03d3 /sound/soc/soc-core.c | |
parent | d9b3e4c5156476a4baf0d7e0f47ba2816b4fff8e (diff) | |
download | lwn-b7af1dafdfaf8419065399d07fb7cbae14b286ef.tar.gz lwn-b7af1dafdfaf8419065399d07fb7cbae14b286ef.zip |
ASoC: Add data based control initialisation for CODECs and cards
Allow CODEC and card drivers to point to an array of controls from their
driver structure rather than explicitly calling snd_soc_add_controls().
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 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f31afe9d4edd..f75f13926049 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1493,6 +1493,9 @@ static int soc_probe_codec(struct snd_soc_card *card, } } + if (driver->controls) + snd_soc_add_controls(codec, driver->controls, + driver->num_controls); if (driver->dapm_widgets) snd_soc_dapm_new_controls(&codec->dapm, driver->dapm_widgets, driver->num_dapm_widgets); @@ -1890,6 +1893,14 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) } } + /* We should have a non-codec control add function but we don't */ + if (card->controls) + snd_soc_add_controls(list_first_entry(&card->codec_dev_list, + struct snd_soc_codec, + card_list), + card->controls, + card->num_controls); + if (card->dapm_widgets) snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, card->num_dapm_widgets); |