alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: broonie@opensource.wolfsonmicro.com
Cc: alsa-devel@alsa-project.org, tiwai@suse.de,
	patches@opensource.wolfsonmicro.com, liam.r.girdwood@intel.com,
	Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Subject: [PATCH] ASoC: core: Add support for platform and CODEC drivers on same device
Date: Thu, 24 Jan 2013 09:49:11 +0000	[thread overview]
Message-ID: <1359020951-25904-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)

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

             reply	other threads:[~2013-01-24  9:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24  9:49 Charles Keepax [this message]
2013-01-26  9:19 ` [PATCH] ASoC: core: Add support for platform and CODEC drivers on same device 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

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=1359020951-25904-1-git-send-email-ckeepax@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).