alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Nikula <jhnikula@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCHv2 2/3] ASoC: Move widgets from DAPM context to snd_soc_card
Date: Fri, 12 Nov 2010 15:57:56 +0200	[thread overview]
Message-ID: <20101112155756.bd8a95be.jhnikula@gmail.com> (raw)
In-Reply-To: <20101112131840.GB17283@rakim.wolfsonmicro.main>

On Fri, 12 Nov 2010 13:18:41 +0000
Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:

> On Fri, Nov 12, 2010 at 11:23:25AM +0200, Jarkko Nikula wrote:
> 
> > Cross-device paths are registered by listing the widgets from device A in
> > a map for device B. An example below shows a path that connects MONO out of
> > A into Line In of B:
> 
> > static const struct snd_soc_dapm_route mapA[] = {
> > 	{"MONO", NULL, "DAC"},
> > };
> 
> > static const struct snd_soc_dapm_route mapB[] = {
> > 	{"Line In", NULL, "MONO"},
> > };
> 
> This is going to fall over if we have widgets in two devices with the
> same name (and especially if we have two devices of the same kind in the
> system).  Adding source device names to the paths would probably cover
> it with the same format but it should be considered and noted here.
> 
That's the reason why the code favors a widget from current DAPM
context in snd_soc_dapm_add_route so that no current machine would
(hopefully) break because of this patch.

Of course any new code implementing cross-device paths between codecs
with conflicting widget names would need the name prefixing stuff also.

> >  struct snd_soc_dapm_context {
> > -	struct list_head widgets;
> > +	int n_widgets; /* number of widgets in this context */
> 
> I'm not sure why we need to count the number of widgets here; 
> 
True, this should go the next patch actually.

> > index 835087d..77be6b3 100644
> > --- a/include/sound/soc.h
> > +++ b/include/sound/soc.h
> > @@ -618,6 +618,7 @@ struct snd_soc_card {
> >  	struct list_head platform_dev_list;
> >  	struct list_head dai_dev_list;
> >  
> > +	struct list_head widgets;
> >  	struct list_head paths;
> >  
> 
> If we keep moving stuff into the card it's questionable what the context
> is buying us...

DAPM context represent the parent device (codecs currently and other
devices in someday) and its state so I don't see we'll be removing it in
near future even now the widgets and paths are moved to card.


-- 
Jarkko

  reply	other threads:[~2010-11-12 13:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12  9:23 [PATCHv2 0/3] ASoC: Extend DAPM to handle cross-device paths Jarkko Nikula
2010-11-12  9:23 ` [PATCHv2 1/3] ASoC: Move DAPM paths from DAPM context to snd_soc_card Jarkko Nikula
2010-11-12  9:23 ` [PATCHv2 2/3] ASoC: Move widgets " Jarkko Nikula
2010-11-12 13:18   ` Mark Brown
2010-11-12 13:57     ` Jarkko Nikula [this message]
2010-11-12 14:25       ` Jarkko Nikula
2010-11-12 14:40       ` Mark Brown
2010-11-12  9:23 ` [PATCHv2 3/3] ASoC: Extend DAPM to handle power changes on cross-device paths Jarkko Nikula
2010-11-12 15:13   ` Mark Brown
2010-11-12 13:51 ` [PATCHv2 0/3] ASoC: Extend DAPM to handle " Mark Brown
2010-11-12 13:54   ` Mark Brown
2010-11-12 14:15     ` Jarkko Nikula
2010-11-12 14:32       ` Mark Brown
2010-11-12 14:07   ` Jarkko Nikula

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=20101112155756.bd8a95be.jhnikula@gmail.com \
    --to=jhnikula@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@slimlogic.co.uk \
    /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).