linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiada Wang <jiada_wang@mentor.com>
To: <lgirdwood@gmail.com>, <broonie@kernel.org>, <perex@perex.cz>,
	<tiwai@suse.com>, <kuninori.morimoto.gx@renesas.com>
Cc: <jiada_wang@mentor.com>, <twischer@de.adit-jv.com>,
	<alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/1] ASoC: rsnd: allow to register kctrl with different cfg
Date: Fri, 1 Feb 2019 12:02:25 +0900	[thread overview]
Message-ID: <20190201030225.11391-1-jiada_wang@mentor.com> (raw)

Currently kctrl with same name can only be created once,
but in "MIX Playback Volume" case, same kctrl is used to
control different MIX volume for different dai-link.

this patch by check kctrl's cfg, allow to create kctrl
with same name but different cfg.

Fixes: commit 9c698e8481a1 ("ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()")

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
---
 sound/soc/sh/rcar/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 79659f7b32b9..909ee0948da1 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1526,14 +1526,15 @@ int rsnd_kctrl_new(struct rsnd_mod *mod,
 	int ret;
 
 	/*
-	 * 1) Avoid duplicate register (ex. MIXer case)
+	 * 1) Avoid duplicate register (ex. DVC case)
 	 * 2) re-register if card was rebinded
 	 */
 	list_for_each_entry(kctrl, &card->controls, list) {
 		struct rsnd_kctrl_cfg *c = kctrl->private_data;
 
 		if (strcmp(kctrl->id.name, name) == 0 &&
-		    c->mod == mod)
+		    c->mod == mod &&
+		    &c->val == &cfg->val)
 			return 0;
 	}
 
-- 
2.19.2


             reply	other threads:[~2019-02-01  3:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-01  3:02 Jiada Wang [this message]
2019-02-01  7:39 ` [PATCH 1/1] ASoC: rsnd: allow to register kctrl with different cfg Kuninori Morimoto

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=20190201030225.11391-1-jiada_wang@mentor.com \
    --to=jiada_wang@mentor.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=twischer@de.adit-jv.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;
as well as URLs for NNTP newsgroup(s).