[alsa-devel] [PATCH] ASoC: Added the condition for the channels_min of cpu_dai

JongHo Kim furmuwon at gmail.com
Thu May 2 11:10:53 CEST 2013


Only playback device, the pcm substream for capture does not need to be
generated. If codec dai driver has both playback.channels_min and
capture.channels_min, and cpu dai driver has only playback.channels_min,
soc_new_pcm() will make the pcm substream for capture although
DataIN is not connected.
So added the condition for the channels_min of cpu_dai in soc_new_pcm().

Signed-off-by: JongHo Kim <furmuwon at gmail.com>
---
 sound/soc/soc-pcm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 73bb8ee..a9fddf0 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2011,9 +2011,11 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int
num)
                if (cpu_dai->driver->capture.channels_min)
                        capture = 1;
        } else {
-               if (codec_dai->driver->playback.channels_min)
+               if (codec_dai->driver->playback.channels_min &&
+                   cpu_dai->driver->playback.channels_min)
                        playback = 1;
-               if (codec_dai->driver->capture.channels_min)
+               if (codec_dai->driver->capture.channels_min &&
+                   cpu_dai->driver->capture.channels_min)
                        capture = 1;
        }

-- 
1.8.1.1


More information about the Alsa-devel mailing list