From patchwork Tue Jul 7 13:57:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 6732741 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2B92FC05AC for ; Tue, 7 Jul 2015 13:58:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5065E2053D for ; Tue, 7 Jul 2015 13:58:08 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7D32E20693 for ; Tue, 7 Jul 2015 13:58:04 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 68D7D2656EE; Tue, 7 Jul 2015 15:58:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 4F6632654E0; Tue, 7 Jul 2015 15:57:53 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 16F7C2654E0; Tue, 7 Jul 2015 15:57:52 +0200 (CEST) Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id BA67E26548E for ; Tue, 7 Jul 2015 15:57:44 +0200 (CEST) Received: from 234.27.125.91.dyn.plus.net ([91.125.27.234] helo=finisterre) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1ZCTNS-0001MT-UT; Tue, 07 Jul 2015 13:57:39 +0000 Received: from broonie by finisterre with local (Exim 4.86_RC4) (envelope-from ) id 1ZCTNL-0005Q4-7A; Tue, 07 Jul 2015 14:57:31 +0100 From: Mark Brown To: Koro Chen , Mark Brown In-Reply-To: <1436148130-22739-1-git-send-email-koro.chen@mediatek.com> Message-Id: Date: Tue, 07 Jul 2015 14:57:31 +0100 X-SA-Exim-Connect-IP: 91.125.27.234 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] Applied "ASoC: dpcm: Add checks of playback/capture before dpcm_get_be" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The patch ASoC: dpcm: Add checks of playback/capture before dpcm_get_be has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From c5b8540dca22526517f4d96857678466613467d1 Mon Sep 17 00:00:00 2001 From: Koro Chen Date: Mon, 6 Jul 2015 10:02:10 +0800 Subject: [PATCH] ASoC: dpcm: Add checks of playback/capture before dpcm_get_be In dpcm_get_be(), it looks for a BE rtd that has the DAI widget according to current stream type. Only playback_widgets are searched in the case of playback stream and vice versa. However, the DAI widget itself can be playback or capture. If the DAI widget is capture, but current stream type is playback, dpcm_get_be() will always fail to find a rtd, print error messages, and continue to the next DAI widget in list. We can just skip this DAI widget to further suppress error messages. This happens in a special case when 2 codecs are inter-connected, and the 1st codec's "capture" widget is used to send data to the 2nd codec during "playback": mtk-rt5650-rt5676 sound: ASoC: can't get playback BE for Sub AIF2 Capture rt5650_rt5676 Playback: ASoC: no BE found for Sub AIF2 Capture Add checks to continue to next DAI widget if current DAI widget's direction does not match the stream type. Signed-off-by: Koro Chen Signed-off-by: Mark Brown --- sound/soc/soc-pcm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 256b9c9..a6d3313 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1306,7 +1306,12 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, switch (list->widgets[i]->id) { case snd_soc_dapm_dai_in: + if (stream != SNDRV_PCM_STREAM_PLAYBACK) + continue; + break; case snd_soc_dapm_dai_out: + if (stream != SNDRV_PCM_STREAM_CAPTURE) + continue; break; default: continue;