Commit 44ce45f8 authored by Mark Brown's avatar Mark Brown

Merge series "ASoC: Fix dailink checks for DPCM" from Pierre-Louis Bossart...

Merge series "ASoC: Fix dailink checks for DPCM" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

We've had a couple of changes that introduce regressions with the
multi-cpu DAI solutions, and while trying to fix them we found
additional inconsistencies that should also go to stable branches.

Bard Liao (1):
  ASoC: core: only convert non DPCM link to DPCM link

Pierre-Louis Bossart (3):
  ASoC: soc-pcm: dpcm: fix playback/capture checks
  ASoC: Intel: boards: replace capture_only by dpcm_capture
  ASoC: SOF: nocodec: conditionally set dpcm_capture/dpcm_playback flags

 sound/soc/intel/boards/glk_rt5682_max98357a.c |  2 +-
 sound/soc/intel/boards/kbl_da7219_max98927.c  |  4 +-
 sound/soc/intel/boards/kbl_rt5663_max98927.c  |  2 +-
 .../intel/boards/kbl_rt5663_rt5514_max98927.c |  2 +-
 sound/soc/soc-core.c                          | 22 ++++++++--
 sound/soc/soc-pcm.c                           | 44 ++++++++++++++-----
 sound/soc/sof/nocodec.c                       |  6 ++-
 7 files changed, 62 insertions(+), 20 deletions(-)

base-commit: 8a9144c1
--
2.20.1
parents 79d4f823 ba4e5abc
...@@ -407,7 +407,7 @@ static struct snd_soc_dai_link geminilake_dais[] = { ...@@ -407,7 +407,7 @@ static struct snd_soc_dai_link geminilake_dais[] = {
.name = "Glk Audio Echo Reference cap", .name = "Glk Audio Echo Reference cap",
.stream_name = "Echoreference Capture", .stream_name = "Echoreference Capture",
.init = NULL, .init = NULL,
.capture_only = 1, .dpcm_capture = 1,
.nonatomic = 1, .nonatomic = 1,
.dynamic = 1, .dynamic = 1,
SND_SOC_DAILINK_REG(echoref, dummy, platform), SND_SOC_DAILINK_REG(echoref, dummy, platform),
......
...@@ -692,7 +692,7 @@ static struct snd_soc_dai_link kabylake_dais[] = { ...@@ -692,7 +692,7 @@ static struct snd_soc_dai_link kabylake_dais[] = {
.name = "Kbl Audio Echo Reference cap", .name = "Kbl Audio Echo Reference cap",
.stream_name = "Echoreference Capture", .stream_name = "Echoreference Capture",
.init = NULL, .init = NULL,
.capture_only = 1, .dpcm_capture = 1,
.nonatomic = 1, .nonatomic = 1,
SND_SOC_DAILINK_REG(echoref, dummy, platform), SND_SOC_DAILINK_REG(echoref, dummy, platform),
}, },
...@@ -858,7 +858,7 @@ static struct snd_soc_dai_link kabylake_max98_927_373_dais[] = { ...@@ -858,7 +858,7 @@ static struct snd_soc_dai_link kabylake_max98_927_373_dais[] = {
.name = "Kbl Audio Echo Reference cap", .name = "Kbl Audio Echo Reference cap",
.stream_name = "Echoreference Capture", .stream_name = "Echoreference Capture",
.init = NULL, .init = NULL,
.capture_only = 1, .dpcm_capture = 1,
.nonatomic = 1, .nonatomic = 1,
SND_SOC_DAILINK_REG(echoref, dummy, platform), SND_SOC_DAILINK_REG(echoref, dummy, platform),
}, },
......
...@@ -672,7 +672,7 @@ static struct snd_soc_dai_link kabylake_dais[] = { ...@@ -672,7 +672,7 @@ static struct snd_soc_dai_link kabylake_dais[] = {
.name = "Kbl Audio Echo Reference cap", .name = "Kbl Audio Echo Reference cap",
.stream_name = "Echoreference Capture", .stream_name = "Echoreference Capture",
.init = NULL, .init = NULL,
.capture_only = 1, .dpcm_capture = 1,
.nonatomic = 1, .nonatomic = 1,
SND_SOC_DAILINK_REG(echoref, dummy, platform), SND_SOC_DAILINK_REG(echoref, dummy, platform),
}, },
......
...@@ -566,7 +566,7 @@ static struct snd_soc_dai_link kabylake_dais[] = { ...@@ -566,7 +566,7 @@ static struct snd_soc_dai_link kabylake_dais[] = {
.name = "Kbl Audio Echo Reference cap", .name = "Kbl Audio Echo Reference cap",
.stream_name = "Echoreference Capture", .stream_name = "Echoreference Capture",
.init = NULL, .init = NULL,
.capture_only = 1, .dpcm_capture = 1,
.nonatomic = 1, .nonatomic = 1,
SND_SOC_DAILINK_REG(echoref, dummy, platform), SND_SOC_DAILINK_REG(echoref, dummy, platform),
}, },
......
...@@ -1648,9 +1648,25 @@ static void soc_check_tplg_fes(struct snd_soc_card *card) ...@@ -1648,9 +1648,25 @@ static void soc_check_tplg_fes(struct snd_soc_card *card)
dai_link->platforms->name = component->name; dai_link->platforms->name = component->name;
/* convert non BE into BE */ /* convert non BE into BE */
if (!dai_link->no_pcm) {
dai_link->no_pcm = 1; 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 * override any BE fixups
......
...@@ -2789,20 +2789,44 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) ...@@ -2789,20 +2789,44 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
struct snd_pcm *pcm; struct snd_pcm *pcm;
char new_name[64]; char new_name[64];
int ret = 0, playback = 0, capture = 0; int ret = 0, playback = 0, capture = 0;
int stream;
int i; int i;
if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) { if (rtd->dai_link->dynamic && rtd->num_cpus > 1) {
cpu_dai = asoc_rtd_to_cpu(rtd, 0);
if (rtd->num_cpus > 1) {
dev_err(rtd->dev, dev_err(rtd->dev,
"DPCM doesn't support Multi CPU yet\n"); "DPCM doesn't support Multi CPU for Front-Ends yet\n");
return -EINVAL;
}
if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
if (rtd->dai_link->dpcm_playback) {
stream = SNDRV_PCM_STREAM_PLAYBACK;
for_each_rtd_cpu_dais(rtd, i, cpu_dai)
if (!snd_soc_dai_stream_valid(cpu_dai,
stream)) {
dev_err(rtd->card->dev,
"CPU DAI %s for rtd %s does not support playback\n",
cpu_dai->name,
rtd->dai_link->stream_name);
return -EINVAL; return -EINVAL;
} }
playback = 1;
}
if (rtd->dai_link->dpcm_capture) {
stream = SNDRV_PCM_STREAM_CAPTURE;
playback = rtd->dai_link->dpcm_playback && for_each_rtd_cpu_dais(rtd, i, cpu_dai)
snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_PLAYBACK); if (!snd_soc_dai_stream_valid(cpu_dai,
capture = rtd->dai_link->dpcm_capture && stream)) {
snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_CAPTURE); dev_err(rtd->card->dev,
"CPU DAI %s for rtd %s does not support capture\n",
cpu_dai->name,
rtd->dai_link->stream_name);
return -EINVAL;
}
capture = 1;
}
} else { } else {
/* Adapt stream for codec2codec links */ /* Adapt stream for codec2codec links */
int cpu_capture = rtd->dai_link->params ? int cpu_capture = rtd->dai_link->params ?
......
...@@ -52,7 +52,9 @@ static int sof_nocodec_bes_setup(struct device *dev, ...@@ -52,7 +52,9 @@ static int sof_nocodec_bes_setup(struct device *dev,
links[i].platforms->name = dev_name(dev); links[i].platforms->name = dev_name(dev);
links[i].codecs->dai_name = "snd-soc-dummy-dai"; links[i].codecs->dai_name = "snd-soc-dummy-dai";
links[i].codecs->name = "snd-soc-dummy"; links[i].codecs->name = "snd-soc-dummy";
if (ops->drv[i].playback.channels_min)
links[i].dpcm_playback = 1; links[i].dpcm_playback = 1;
if (ops->drv[i].capture.channels_min)
links[i].dpcm_capture = 1; links[i].dpcm_capture = 1;
} }
......
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