Skip to content

Commit

Permalink
ASoC: rsnd: fixup MIX kctrl registration
Browse files Browse the repository at this point in the history
commit 7aea8a9 upstream.

Renesas sound device has many IPs and many situations.
If platform/board uses MIXer, situation will be more complex.
To avoid duplicate DVC kctrl registration when MIXer was used,
it had original flags.
But it was issue when sound card was re-binded, because
no one can't cleanup this flags then.

To solve this issue, commit 9c698e8 ("ASoC: rsnd: tidyup
registering method for rsnd_kctrl_new()") checks registered
card->controls, because if card was re-binded, these were cleanuped
automatically. This patch could solve re-binding issue.
But, it start to avoid MIX kctrl.

To solve these issues, we need below.
To avoid card re-binding issue: check registered card->controls
To avoid duplicate DVC registration: check registered rsnd_kctrl_cfg
To allow multiple MIX registration: check registered rsnd_kctrl_cfg
This patch do it.

Fixes: 9c698e8 ("ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()")
Reported-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-By: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Kuninori Morimoto authored and Greg Kroah-Hartman committed Dec 13, 2019
1 parent 17559e3 commit 9852d0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sound/soc/sh/rcar/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,14 +1345,14 @@ int rsnd_kctrl_new(struct rsnd_mod *mod,
int ret;

/*
* 1) Avoid duplicate register (ex. MIXer case)
* 2) re-register if card was rebinded
* 1) Avoid duplicate register for DVC with MIX case
* 2) Allow duplicate register for MIX
* 3) 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)
if (c == cfg)
return 0;
}

Expand Down

0 comments on commit 9852d0c

Please sign in to comment.