mirror of
https://github.com/Fishwaldo/build.git
synced 2025-04-17 19:41:37 +00:00
72 lines
2.2 KiB
Text
72 lines
2.2 KiB
Text
From 61043fd422307935e5c026bfa92638cac747ad55 Mon Sep 17 00:00:00 2001
|
|
From: tonymac32 <tonymckahan@gmail.com>
|
|
Date: Sun, 19 Jul 2020 01:03:51 -0400
|
|
Subject: [PATCH] revert ASoC: soc-pcm: dpcm: fix playback/capture checks
|
|
|
|
Signed-off-by: tonymac32 <tonymckahan@gmail.com>
|
|
---
|
|
sound/soc/soc-pcm.c | 44 ++++++++++----------------------------------
|
|
1 file changed, 10 insertions(+), 34 deletions(-)
|
|
|
|
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
|
|
index fde097a7a..3b909533f 100644
|
|
--- a/sound/soc/soc-pcm.c
|
|
+++ b/sound/soc/soc-pcm.c
|
|
@@ -2908,44 +2908,20 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
|
|
struct snd_pcm *pcm;
|
|
char new_name[64];
|
|
int ret = 0, playback = 0, capture = 0;
|
|
- int stream;
|
|
int i;
|
|
|
|
- if (rtd->dai_link->dynamic && rtd->num_cpus > 1) {
|
|
- dev_err(rtd->dev,
|
|
- "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;
|
|
- }
|
|
- playback = 1;
|
|
- }
|
|
- if (rtd->dai_link->dpcm_capture) {
|
|
- stream = SNDRV_PCM_STREAM_CAPTURE;
|
|
-
|
|
- 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 capture\n",
|
|
- cpu_dai->name,
|
|
- rtd->dai_link->stream_name);
|
|
- return -EINVAL;
|
|
- }
|
|
- capture = 1;
|
|
+ cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
|
+ if (rtd->num_cpus > 1) {
|
|
+ dev_err(rtd->dev,
|
|
+ "DPCM doesn't support Multi CPU yet\n");
|
|
+ return -EINVAL;
|
|
}
|
|
+
|
|
+ playback = rtd->dai_link->dpcm_playback &&
|
|
+ snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_PLAYBACK);
|
|
+ capture = rtd->dai_link->dpcm_capture &&
|
|
+ snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_CAPTURE);
|
|
} else {
|
|
/* Adapt stream for codec2codec links */
|
|
int cpu_capture = rtd->dai_link->params ?
|
|
--
|
|
Created with Armbian build tools https://github.com/armbian/build
|
|
|