From patchwork Fri Jul 4 16:07:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Cousson X-Patchwork-Id: 4481871 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B7CFDBEEAA for ; Fri, 4 Jul 2014 16:12:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0BB092034A for ; Fri, 4 Jul 2014 16:12:04 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E40A82022D for ; Fri, 4 Jul 2014 16:12:02 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id EC7A9265A50; Fri, 4 Jul 2014 18:12: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 BFB6D265A1B; Fri, 4 Jul 2014 18:10:14 +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 938EA265A3E; Fri, 4 Jul 2014 18:10:13 +0200 (CEST) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by alsa0.perex.cz (Postfix) with ESMTP id 26A50265A31 for ; Fri, 4 Jul 2014 18:09:34 +0200 (CEST) Received: by mail-we0-f178.google.com with SMTP id x48so1860504wes.37 for ; Fri, 04 Jul 2014 09:09:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7OoIJK5zRICoopM7gPJKvDxDwtWkVIuJkopkjfVfczw=; b=PUedo+Fi5VOK9ZFMPP9ElQMg99SM9OiXFEssxVKYs5wpXTpahThZduXAjkh+Rj+kb0 QYVS87MbOb8YCMTWGfc+x33exVR7bKmQr/iRFJlrpHH0/bLbWJjTGEyqlUAAmlMLmDMf pIiESnV4ZP0+1XZAbWzZMb8/eRphCKuZrE04KnGS3/qub3aMhCAqDAQU7MO4Ra53TIs/ 57iSWrh0QDnx80glg7u7CUdASdXoAlqV7PSGIUfTQpMwZC6P4Nj69U2WnCWa5hZb6wVz p3vvoAyCkw0FrjOsBiQP7dXbv3RxtyycWVWlBMJsTMLCb27YVrkeHdfuT9t5Nz3kGH1d fwrA== X-Gm-Message-State: ALoCoQlh4jgGqj/+GrQv5eMfEYUXdatCW9lUEYFfLGOaEkZihXHGRmV39+QzKmYyTW7WAqDt9wor X-Received: by 10.194.92.244 with SMTP id cp20mr5136218wjb.109.1404490173744; Fri, 04 Jul 2014 09:09:33 -0700 (PDT) Received: from localhost.localdomain ([46.218.123.34]) by mx.google.com with ESMTPSA id bx2sm69840593wjb.47.2014.07.04.09.09.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Jul 2014 09:09:33 -0700 (PDT) From: Benoit Cousson To: broonie@kernel.org, lgirdwood@gmail.com, lars@metafoo.de Date: Fri, 4 Jul 2014 18:07:54 +0200 Message-Id: <1404490075-24997-5-git-send-email-bcousson@baylibre.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1404490075-24997-1-git-send-email-bcousson@baylibre.com> References: <1404490075-24997-1-git-send-email-bcousson@baylibre.com> Cc: Vinod Koul , misael.lopez@ti.com, alsa-devel@alsa-project.org, Benoit Cousson Subject: [alsa-devel] [PATCH v5 4/5] ASoC: compress: Prevent multicodec for compressed stream 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 Multiple codecs does not make sense in the case of compressed stream. Exit with error if it happens. Signed-off-by: Benoit Cousson Cc: Vinod Koul Acked-by: Vinod Koul --- sound/soc/soc-compress.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index f96fb96..27c06ac 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -629,6 +629,11 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) char new_name[64]; int ret = 0, direction = 0; + if (rtd->num_codecs > 1) { + dev_err(rtd->card->dev, "Multicodec not supported for compressed stream\n"); + return -EINVAL; + } + /* check client and interface hw capabilities */ snprintf(new_name, sizeof(new_name), "%s %s-%d", rtd->dai_link->stream_name, codec_dai->name, num);