alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/12] ASoC: Create codec DAPM widgets before calling the codecs probe function
@ 2011-05-05 14:59 Lars-Peter Clausen
  2011-05-05 14:59 ` [PATCH 02/12] ASoC: SSM2602: Cleanup coeff handling Lars-Peter Clausen
                   ` (12 more replies)
  0 siblings, 13 replies; 27+ messages in thread
From: Lars-Peter Clausen @ 2011-05-05 14:59 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: device-driver-devel, alsa-devel, Lars-Peter Clausen,
	Mike Frysinger

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: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/soc-core.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 133edeb..a477e21 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -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);
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2011-05-08 23:46 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-05 14:59 [PATCH 01/12] ASoC: Create codec DAPM widgets before calling the codecs probe function Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 02/12] ASoC: SSM2602: Cleanup coeff handling Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 03/12] ASoC: SSM2602: Remove duplicate control Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 04/12] ASoC: SSM2602: Properly annotate i2c probe and remove functions Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 05/12] ASoC: SSM2602: Remove unused struct and define Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 06/12] ASoC: SSM2602: Fix reg_cache_size Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 07/12] ASoC: SSM2602: Do not power the codec up in probe Lars-Peter Clausen
2011-05-06 10:00   ` Mark Brown
2011-05-05 14:59 ` [PATCH 08/12] ASoC: SSM2602: Fix 'Mic Boost2' control Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 09/12] ASoC: SSM2602: Add SSM2604 support Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 10/12] ASoC: SSM2602: Add entry for the ssm2603 to the device id table Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 11/12] ASoC: SSM2602: Model power supply for the digital core as a DAPM widget Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 12/12] ASoC: SSM2602: Provide dB ranges for the volume controls Lars-Peter Clausen
2011-05-05 19:08 ` [PATCH 01/12] ASoC: Create codec DAPM widgets before calling the codecs probe function Mike Frysinger
2011-05-05 23:01   ` Mike Frysinger
2011-05-07 18:11 ` Liam Girdwood
2011-05-07 18:21   ` Mark Brown
2011-05-08 11:16     ` Liam Girdwood
2011-05-08 13:56       ` Mark Brown
2011-05-08 16:24         ` [PATCH 2/6] ASoC: SSM2602: Do not power the codec up in probe Lars-Peter Clausen
     [not found]         ` <20110508135613.GA15968-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-05-08 16:24           ` [PATCH 1/6] ASoC: SSM2602: Fix default register cache Lars-Peter Clausen
2011-05-08 20:53             ` Liam Girdwood
2011-05-08 23:46             ` Mark Brown
2011-05-08 16:24           ` [PATCH 3/6] ASoC: SSM2602: Add SSM2604 support Lars-Peter Clausen
2011-05-08 16:24           ` [PATCH 5/6] ASoC: SSM2602: Model power supply for the digital core as a DAPM widget Lars-Peter Clausen
2011-05-08 16:24         ` [PATCH 4/6] ASoC: SSM2602: Add entry for the ssm2603 to the device id table Lars-Peter Clausen
2011-05-08 16:24         ` [PATCH 6/6] ASoC: SSM2602: Provide dB ranges for the volume controls Lars-Peter Clausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).