Commit 607fa205 authored by Bard Liao's avatar Bard Liao Committed by Mark Brown

ASoC: core: only convert non DPCM link to DPCM link

Additional checks for valid DAIs expose a corner case, where existing
BE dailinks get modified, e.g. HDMI links are tagged with
dpcm_capture=1 even if the DAIs are for playback.

This patch makes those changes conditional and flags configuration
issues when a BE dailink is has no_pcm=0 but dpcm_playback or
dpcm_capture=1 (which makes no sense).

As discussed on the alsa-devel mailing list, there are redundant flags
for dpcm_playback, dpcm_capture, playback_only, capture_only. This
will have to be cleaned-up in a future update. For now only correct
and flag problematic configurations.

Fixes: 218fe9b7 ("ASoC: soc-core: Set dpcm_playback / dpcm_capture")
Suggested-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: default avatarDaniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200608194415.4663-3-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b73287f0
......@@ -1648,9 +1648,25 @@ static void soc_check_tplg_fes(struct snd_soc_card *card)
dai_link->platforms->name = component->name;
/* convert non BE into BE */
if (!dai_link->no_pcm) {
dai_link->no_pcm = 1;
dai_link->dpcm_playback = 1;
dai_link->dpcm_capture = 1;
if (dai_link->dpcm_playback)
dev_warn(card->dev,
"invalid configuration, dailink %s has flags no_pcm=0 and dpcm_playback=1\n",
dai_link->name);
if (dai_link->dpcm_capture)
dev_warn(card->dev,
"invalid configuration, dailink %s has flags no_pcm=0 and dpcm_capture=1\n",
dai_link->name);
/* convert normal link into DPCM one */
if (!(dai_link->dpcm_playback ||
dai_link->dpcm_capture)) {
dai_link->dpcm_playback = !dai_link->capture_only;
dai_link->dpcm_capture = !dai_link->playback_only;
}
}
/*
* override any BE fixups
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment