Skip to contentSkip to conversation

ASoC: rsnd: allow to register kctrl with different cfg

PATCH In review Jiada Wang 2 participants 2 messages Feb 1, 2019

Subsystems (3)
lore
Share & tools
lore

Jiada Wang

author
#0 lore raw

PATCH 1/1 ASoC: rsnd: allow to register kctrl with different cfg

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()")
---
 sound/soc/sh/rcar/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/sh/rcar/core.c +3 -2
index 79659f7b32b9..909ee0948da1 100644
@@ -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;
 	}
 
Signature · 1 line
2.19.2
#1 lore raw

Hi Mark

Quoted 11 lines

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()")

---

I and Jiada discussed about this issue locally,
and agreed we can use my patch instead of this.
I will post it soon, so, please drop this patch.

Best regards
---
Kuninori Morimoto