alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: core: Add support for platform and CODEC drivers on same device
@ 2013-01-24  9:49 Charles Keepax
  2013-01-26  9:19 ` Mark Brown
  2013-01-26  9:20 ` Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Charles Keepax @ 2013-01-24  9:49 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, tiwai, patches, liam.r.girdwood, Charles Keepax

Currently DAI playback and capture widgets are created during
soc_probe_codec and soc_probe_platform, using the device associated with
the DAI to check which widgets should be created. If a device registers
both a CODEC and platform driver this leads the CODEC playback and
capture widgets being overwritten by the widgets created by the platform
probe.

It is more sensible to retain the CODEC widgets as the most common use
case for registering both a CODEC and platform driver on the same chip
is a CODEC which contains a DSP for compressed playback. In this
situation it is more sensible to attach the routing information to the
CODEC and add a thin platform driver interface to link into the
compressed API.

So this patch will check for existing widgets during soc_probe_platform
and only create new widgets if no existing ones exist.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
 sound/soc/soc-core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 04af2a6..53efe1d 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1159,7 +1159,8 @@ static int soc_probe_platform(struct snd_soc_card *card,
 
 	/* Create DAPM widgets for each DAI stream */
 	list_for_each_entry(dai, &dai_list, list) {
-		if (dai->dev != platform->dev)
+		if (dai->dev != platform->dev ||
+		    dai->playback_widget || dai->capture_widget)
 			continue;
 
 		snd_soc_dapm_new_dai_widgets(&platform->dapm, dai);
-- 
1.7.2.5

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

end of thread, other threads:[~2013-03-15 18:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-24  9:49 [PATCH] ASoC: core: Add support for platform and CODEC drivers on same device Charles Keepax
2013-01-26  9:19 ` Mark Brown
2013-01-26  9:20 ` Mark Brown
2013-03-15 15:35   ` Charles Keepax
2013-03-15 15:38     ` [PATCH v2] ASoC: dapm: " Charles Keepax
2013-03-15 18:00       ` Mark Brown
2013-03-15 17:02     ` [PATCH] ASoC: core: " Mark Brown

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).