[alsa-devel] [PATCH] ASoC: Added the condition for the channels_min of cpu_dai
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@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 cf191e6..c405e39 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2018,9 +2018,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; }
On Tue, Apr 30, 2013 at 03:31:16PM +0900, JongHo Kim wrote:
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().
This doesn't appear to apply against current -next, can you please check and resend?
2013/5/1 Mark Brown broonie@kernel.org
On Tue, Apr 30, 2013 at 03:31:16PM +0900, JongHo Kim wrote:
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().
This doesn't appear to apply against current -next, can you please check and resend?
Please excuse my poor English. I don't understand what you're talking about. I need a more detailed explanation of the 'current -next'.
On Thu, May 02, 2013 at 04:04:55PM +0900, JongHo Kim wrote:
Please excuse my poor English. I don't understand what you're talking about. I need a more detailed explanation of the 'current -next'.
Stephen Rothwell's linux-next integration tree:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
or my tree (in general you should be using whatever tree is listed in MAINTAINERS).
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@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; }
participants (2)
-
JongHo Kim
-
Mark Brown