public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jhnikula@gmail.com>
To: Stephen Warren <swarren@nvidia.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"broonie@opensource.wolfsonmicro.com"
	<broonie@opensource.wolfsonmicro.com>, "lrg@ti.com" <lrg@ti.com>
Subject: Re: [PATCH] ASoC: Fix dapm_is_shared_kcontrol so everything isn't shared
Date: Thu, 26 May 2011 09:57:52 +0300	[thread overview]
Message-ID: <20110526095752.a450fe6d.jhnikula@gmail.com> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF0498A48449@HQMAIL01.nvidia.com>

On Wed, 25 May 2011 08:24:59 -0700
Stephen Warren <swarren@nvidia.com> wrote:

> > Then we must skip test for widgets that are in different dapm context,
> > i.e. we don't want to share mux controls if they are in different device
> > instance. Does it work for you if you add the dapm test below to your
> > patch?
> 
> I suppose that's technically correct, and I'm fine adding this to the
> patch. However, I'm surprised that change is needed; do we actually have
> a situation where two widgets in different DAPM contexts point at the
> same control definition? It seems like that'd be a bug; why would there
> be two controls pointing at the same register field, yet in different
> DAPM contexts?
> 
Yes, I noticed this can happen when you have multiple same codecs in a
system. Let's assume we have multiple wm8903 codecs and we have these
in the driver:

static const struct snd_kcontrol_new adcinput_mux =
	SOC_DAPM_ENUM("ADC Input", adcinput_enum);

static const struct snd_soc_dapm_widget wm8903_dapm_widgets[] = {
  SND_SOC_DAPM_MUX("Left ADC Input", SND_SOC_NOPM, 0, 0, &adcinput_mux),
};

Even the core duplicates widgets for each codec instance in this
example, they still point to same adcinput_mux and thus
dapm_is_shared_kcontrol() miss detects them as shared if we don't skip
different dapm context.

-- 
Jarkko

  reply	other threads:[~2011-05-26  6:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 23:12 [PATCH] ASoC: Fix dapm_is_shared_kcontrol so everything isn't shared Stephen Warren
2011-05-25  7:01 ` Jarkko Nikula
2011-05-25 14:52   ` Jarkko Nikula
2011-05-25 15:24     ` Stephen Warren
2011-05-26  6:57       ` Jarkko Nikula [this message]
2011-05-26 15:38         ` Stephen Warren
  -- strict thread matches above, loose matches on Subject: below --
2011-05-26 15:57 Stephen Warren
2011-05-26 18:02 ` Jarkko Nikula
2011-05-27  9:19 ` Liam Girdwood
2011-05-27 13:59 ` 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=20110526095752.a450fe6d.jhnikula@gmail.com \
    --to=jhnikula@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@ti.com \
    --cc=swarren@nvidia.com \
    /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