diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-09-03 11:16:05 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-09-03 14:36:24 +0300 |
commit | 157ab71286e6dd71676052275ab5dfa3955c5cdb (patch) | |
tree | 9da77369231a7a16a71b8145ffac01d65061fb44 /sound/soc/generic | |
parent | 39c66b6ef6f3aaf5bac61555db70ffb2864161c6 (diff) | |
download | linux-157ab71286e6dd71676052275ab5dfa3955c5cdb.tar.xz |
ASoC: audio-graph: indicate rebind issue
ALSA SoC try to rebind Sound Card if Card/CPU/Codec/Platform
were unbinded and re-binded again.
But, Audio Graph Card might can't rebind again if user do for example
unbind CPU or Codec driver
bind CPU or Codec driver
Because Audio Graph Card is still pointing old/unbinded
CPU or Codec driver's DAI name at dlc->dai_name.
To avoid this issue, it needs to alloc memory and keep DAI name
even though if CPU or Codec driver was unbinded.
Or, always do unbind/bind at Sound Card.
For now, this patch indicates this issue as FIXME.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sgpdu75m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/audio-graph-card.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 288df245b2f0..6007e6305735 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -129,6 +129,25 @@ static int asoc_simple_parse_dai(struct device_node *ep, args.args[0] = graph_get_dai_id(ep); args.args_count = (of_graph_get_endpoint_count(node) > 1); + /* + * FIXME + * + * Here, dlc->dai_name is pointer to CPU/Codec DAI name. + * If user unbinded CPU or Codec driver, but not for Sound Card, + * dlc->dai_name is keeping unbinded CPU or Codec + * driver's pointer. + * + * If user re-bind CPU or Codec driver again, ALSA SoC will try + * to rebind Card via snd_soc_try_rebind_card(), but because of + * above reason, it might can't bind Sound Card. + * Because Sound Card is pointing to released dai_name pointer. + * + * To avoid this rebind Card issue, + * 1) It needs to alloc memory to keep dai_name eventhough + * CPU or Codec driver was unbinded, or + * 2) user need to rebind Sound Card everytime + * if he unbinded CPU or Codec. + */ ret = snd_soc_get_dai_name(&args, &dlc->dai_name); if (ret < 0) return ret; |