alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org,
	patches@opensource.wolfsonmicro.com, liam.r.girdwood@intel.com
Subject: [PATCH v2] ASoC: dapm: Add support for platform and CODEC drivers	on same device
Date: Fri, 15 Mar 2013 15:38:21 +0000	[thread overview]
Message-ID: <20130315153821.GD2141@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20130315153540.GC2141@opensource.wolfsonmicro.com>

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

In general we want to retain the existing playback and capture widgets
because routes may have already been added to them. This patch will
check for existing widgets during snd_soc_dapm_new_dai_widgets and
only create new widgets if none exist.

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

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 33acd8b..6959304 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3351,7 +3351,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
 	memset(&template, 0, sizeof(template));
 	template.reg = SND_SOC_NOPM;
 
-	if (dai->driver->playback.stream_name) {
+	if (dai->driver->playback.stream_name && !dai->playback_widget) {
 		template.id = snd_soc_dapm_dai;
 		template.name = dai->driver->playback.stream_name;
 		template.sname = dai->driver->playback.stream_name;
@@ -3369,7 +3369,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
 		dai->playback_widget = w;
 	}
 
-	if (dai->driver->capture.stream_name) {
+	if (dai->driver->capture.stream_name && !dai->capture_widget) {
 		template.id = snd_soc_dapm_dai;
 		template.name = dai->driver->capture.stream_name;
 		template.sname = dai->driver->capture.stream_name;
-- 
1.7.2.5

  reply	other threads:[~2013-03-15 15:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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     ` Charles Keepax [this message]
2013-03-15 18:00       ` [PATCH v2] ASoC: dapm: " Mark Brown
2013-03-15 17:02     ` [PATCH] ASoC: core: " Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130315153821.GD2141@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).