提交 77530150 编写于 作者: L Lars-Peter Clausen 提交者: Mark Brown

ASoC: Create codec DAPM widgets before calling the codecs probe function

This allows to create DAPM routes depending on those widgets in the
codecs probe function.  This is helpful when supporting similar codecs
with minor differences in the DAPM routing with the same driver.

Something similar has already been done for cards in commit
a841ebb9 (ASoC: Create card DAPM widgets early so they can be used in
callbacks).
Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Acked-by: NLiam Girdwood <lrg@ti.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 20ed0938
......@@ -1495,6 +1495,10 @@ static int soc_probe_codec(struct snd_soc_card *card,
soc_init_codec_debugfs(codec);
if (driver->dapm_widgets)
snd_soc_dapm_new_controls(&codec->dapm, driver->dapm_widgets,
driver->num_dapm_widgets);
if (driver->probe) {
ret = driver->probe(codec);
if (ret < 0) {
......@@ -1508,9 +1512,6 @@ 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);
if (driver->dapm_routes)
snd_soc_dapm_add_routes(&codec->dapm, driver->dapm_routes,
driver->num_dapm_routes);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册