All of lore.kernel.org
 help / color / mirror / Atom feed
From: Koro Chen <koro.chen@mediatek.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
	p.zabel@pengutronix.de, kuninori.morimoto.gx@renesas.com
Subject: Re: Question about patch ASoC: Prevent components from being bound to multiple cards
Date: Mon, 5 Oct 2015 19:28:54 +0800	[thread overview]
Message-ID: <1444044534.32571.41.camel@mtksdaap41> (raw)
In-Reply-To: <20151005100717.GN12635@sirena.org.uk>

On Mon, 2015-10-05 at 11:07 +0100, Mark Brown wrote:
> On Sat, Oct 03, 2015 at 11:01:40PM +0800, Koro Chen wrote:
> > On Fri, 2015-10-02 at 15:48 +0100, Mark Brown wrote:
> > > On Fri, Oct 02, 2015 at 06:34:24PM +0800, Koro Chen wrote:
> 
> > > > I have two cards originally but the second one failed because of the
> > > > patch ASoC: Prevent components from being bound to multiple cards.
> 
> > > > My configuration is like this:
> > > > card0: use platform's DAI component A
> > > > card1: use the same platform's DAI component B
> 
> > > What do you mean by "DAI component" here?  It's not a term I'm familiar
> > > with...
> 
> > Sorry I didn't make myself clear enough. In the
> > sound/soc/mediatek/mtk-afe-pcm.c, I register two components
> > "mtk_afe_pcm_dai_component" and "mtk_afe_hdmi_dai_component", each has
> > its corresponding DAIs. Card0 (which is mt8173-rt5676-rt5650.c) uses
> > DAIs from the first component, and card1 (new) uses DAIs of the second
> > component. These two components are probed successfully and separately
> > by card0 and card1, but card1 failed to probe another component created
> > by snd_soc_register_platform(), which is already bound to card0.
> 
> OK, I see.  We probably do want to relax that restriction, it makes more
> sense at the DAI level but at the component level when we have
> components that have a bunch of independant DAIs hanging off a DMA
> controler as one component (which does make sense) then it breaks.
Thanks for your suggestion. Is it make sense if we use
component->registered_as_component, which is only true in case of
snd_soc_register_component() and will be false for components created by
snd_soc_register_platform() or snd_soc_register_codec(), then modify the
check condition like this:

@@ -1102,11 +1102,12 @@ static int soc_probe_component(struct
snd_soc_card *card,
        struct snd_soc_dai *dai;
        int ret;

        if (!strcmp(component->name, "snd-soc-dummy"))
                return 0;

        if (component->card) {
-               if (component->card != card) {
+               if (component->card != card &&
component->registered_as_component) {

      parent reply	other threads:[~2015-10-05 11:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 14:40 Missing return check of of_property_read_*() Takashi Iwai
2015-09-09 14:51 ` Mark Brown
2015-09-09 14:55   ` Brian Austin
2015-09-09 15:05     ` Takashi Iwai
2015-09-09 15:57       ` Mark Brown
2015-09-09 16:01         ` Takashi Iwai
2015-09-09 16:19           ` Mark Brown
2015-09-09 16:27             ` Takashi Iwai
2015-09-10  3:10               ` Fengguang Wu
2015-09-10  3:23                 ` Fengguang Wu
2015-09-10  5:32                   ` Takashi Iwai
2015-09-10  5:45                     ` Takashi Iwai
2015-09-10  6:24                     ` Fengguang Wu
2015-09-10 10:54                       ` Mark Brown
2015-09-10 11:17                         ` Fengguang Wu
2015-09-10 18:19           ` Mark Brown
2015-09-09 15:13     ` Mark Brown
2015-09-09 15:01   ` Takashi Iwai
2015-09-09 15:05     ` Lars-Peter Clausen
2015-09-09 15:07       ` Takashi Iwai
2015-09-09 15:33       ` Mark Brown
2015-10-02 10:34       ` Question about patch ASoC: Prevent components from being bound to multiple cards Koro Chen
2015-10-02 14:48         ` Mark Brown
2015-10-03 15:01           ` Koro Chen
2015-10-05 10:07             ` Mark Brown
2015-10-05 10:08               ` Mark Brown
2015-10-05 11:28               ` Koro Chen [this message]

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=1444044534.32571.41.camel@mtksdaap41 \
    --to=koro.chen@mediatek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lars@metafoo.de \
    --cc=p.zabel@pengutronix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.