From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Current DAPM will lost correct route settings if some CPU/Codec was using same stream name, and it will be problem when DPCM case. For example, stream name of Renesas sound drver / ak4642 / dummy for DPCM have same name as "Playback", like below
FE CPU (rsnd): "DAI0 Playback" Codec (dummy): "Playback"
BE CPU (dummy): "Playback" Codec (ak4642): "Playback"
Then, "Playback" - "DAI0 Playback" can't match correctly. This patch adds "driver name" prefix for this case. We can use "ak4642-hifi Playback" - "DAI0 Playback" here.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/soc-dapm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index d4b331d..722b922 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2417,10 +2417,12 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, { struct snd_soc_dapm_widget *wsource = NULL, *wsink = NULL, *w; struct snd_soc_dapm_widget *wtsource = NULL, *wtsink = NULL; + struct snd_soc_dai *w_dai; const char *sink; const char *source; char prefixed_sink[80]; char prefixed_source[80]; + char _w_name[80], *w_name; const char *prefix; int ret;
@@ -2442,6 +2444,17 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, * current DAPM context */ list_for_each_entry(w, &dapm->card->widgets, list) { + w_dai = w->priv; + w_name = NULL; + if (w_dai) { + snprintf(_w_name, sizeof(_w_name), "%s %s", + w_dai->name, w->name); + + w_name = _w_name; + } + + snd_soc_dapm_route_scan(w, dapm, w_name, &wsource, &wtsource, source); + snd_soc_dapm_route_scan(w, dapm, w_name, &wsink, &wtsink, sink); snd_soc_dapm_route_scan(w, dapm, w->name, &wsource, &wtsource, source); snd_soc_dapm_route_scan(w, dapm, w->name, &wsink, &wtsink, sink); }