All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jhnikula@gmail.com>
To: Liam Girdwood <lrg@ti.com>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Stephen Warren <swarren@nvidia.com>
Subject: Re: [PATCH] ASoC: dapm - fix prefix for DAPM muxes
Date: Tue, 24 May 2011 21:45:04 +0300	[thread overview]
Message-ID: <20110524214504.bc02203f.jhnikula@gmail.com> (raw)
In-Reply-To: <1306255149-4519-1-git-send-email-lrg@ti.com>

On Tue, 24 May 2011 17:39:09 +0100
Liam Girdwood <lrg@ti.com> wrote:

> Make sure DAPM muxes have a valid kcontrol name instead of NULL.
> 
> Signed-off-by: Liam Girdwood <lrg@ti.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 456617e..c5d98e3 100644
> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -489,10 +489,10 @@ static int dapm_new_mux(struct snd_soc_dapm_context *dapm,
>  	wlist->widgets[wlistentries - 1] = w;
>  
>  	if (!kcontrol) {
> -		if (dapm->codec)
> +		if (dapm->codec && dapm->codec->name_prefix)
>  			prefix = dapm->codec->name_prefix;
>  		else
> -			prefix = NULL;
> +			prefix = w->name;
>  
This didn't look correct to play with prefix. A quick look revealed
that there is indeed breakage from commit af46800 ("ASoC: Implement mux
control sharing") and this fix doesn't fix it on rx51.

I think the breakage must come from dapm_is_shared_kcontrol() that
returns always 1 and dapm_new_mux() ends up using w->kcontrol_news
[0].name instead of previous w->name.

dapm_is_shared_kcontrol() returns always 1 since it gets
&w->kcontrol_news[0] as an argument and &w->kcontrol_news[i] will
match when iterating the same widget with i==0.

	list_for_each_entry(w, &dapm->card->widgets, list) {
		for (i = 0; i < w->num_kcontrols; i++) {
			if (&w->kcontrol_news[i] == kcontrol_new) {
				if (w->kcontrols)
					*kcontrol = w->kcontrols[i];
				return 1;
			}
		}
	}

It works rx51 if I start the iteration from i==1 but it looks the
actual fix is to the check that we are not iterating the same widget.

-- 
Jarkko

  reply	other threads:[~2011-05-24 18:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 16:39 [PATCH] ASoC: dapm - fix prefix for DAPM muxes Liam Girdwood
2011-05-24 18:45 ` Jarkko Nikula [this message]
2011-05-24 19:37   ` Stephen Warren
2011-05-24 19:40     ` Liam Girdwood

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=20110524214504.bc02203f.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 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.