From patchwork Sat Jun 17 00:33:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Banajit Goswami X-Patchwork-Id: 9793863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F0D4600C5 for ; Sat, 17 Jun 2017 00:36:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40D3028552 for ; Sat, 17 Jun 2017 00:36:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3595D285DA; Sat, 17 Jun 2017 00:36:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1B4A28552 for ; Sat, 17 Jun 2017 00:36:00 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 210E1266CBB; Sat, 17 Jun 2017 02:35:58 +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 290A7266CC0; Sat, 17 Jun 2017 02:35:51 +0200 (CEST) Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by alsa0.perex.cz (Postfix) with ESMTP id 590BD266C87 for ; Sat, 17 Jun 2017 02:35:47 +0200 (CEST) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9F7D5612E9; Sat, 17 Jun 2017 00:35:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1497659745; bh=eoqeVKxXaMIwx63MpO6e8dn9HVNjNM9r2RZy07SpyTQ=; h=From:To:Cc:Subject:Date:From; b=VKWAEBF24jvS9qXbM04sII/Zn+Z3o+QxsNhCtPGcGK/3T/stMRP2CNPRDHdrVz2x9 9ZEsYT+pnnzETIIfwWpPaVIrmR7Od8lGKYhc1RQ/onumaw7it6L4G/1/5iLBnjUCOY HnWBUNT4YqwP+tdxfeTo1lRYjlFfobWGGQpEcT+8= Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: bgoswami@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2EFD961211; Sat, 17 Jun 2017 00:35:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1497659745; bh=eoqeVKxXaMIwx63MpO6e8dn9HVNjNM9r2RZy07SpyTQ=; h=From:To:Cc:Subject:Date:From; b=VKWAEBF24jvS9qXbM04sII/Zn+Z3o+QxsNhCtPGcGK/3T/stMRP2CNPRDHdrVz2x9 9ZEsYT+pnnzETIIfwWpPaVIrmR7Od8lGKYhc1RQ/onumaw7it6L4G/1/5iLBnjUCOY HnWBUNT4YqwP+tdxfeTo1lRYjlFfobWGGQpEcT+8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2EFD961211 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=bgoswami@codeaurora.org From: bgoswami@codeaurora.org To: broonie@kernel.org Date: Fri, 16 Jun 2017 17:33:40 -0700 Message-Id: <1497659620-7197-1-git-send-email-bgoswami@codeaurora.org> X-Mailer: git-send-email 1.9.1 Cc: vinod.koul@intel.com, alsa-devel@alsa-project.org, Banajit Goswami , plai@codeaurora.org, Satish Babu Patakokila Subject: [alsa-devel] [PATCH] ASoC: compress: Derive substream from stream based on direction 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 From: Satish Babu Patakokila Currently compress driver hardcodes direction as playback to get substream from the stream. This results in getting the incorrect substream for compressed capture usecase. To fix this, remove the hardcoding and derive substream based on the stream direction. Signed-off-by: Satish Babu Patakokila Signed-off-by: Banajit Goswami Acked-By: Vinod Koul --- sound/soc/soc-compress.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index bfd71b8..206f36b 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -81,7 +81,8 @@ static int soc_compr_open(struct snd_compr_stream *cstream) static int soc_compr_open_fe(struct snd_compr_stream *cstream) { struct snd_soc_pcm_runtime *fe = cstream->private_data; - struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream; + struct snd_pcm_substream *fe_substream = + fe->pcm->streams[cstream->direction].substream; struct snd_soc_platform *platform = fe->platform; struct snd_soc_dai *cpu_dai = fe->cpu_dai; struct snd_soc_dpcm *dpcm; @@ -467,7 +468,8 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream, struct snd_compr_params *params) { struct snd_soc_pcm_runtime *fe = cstream->private_data; - struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream; + struct snd_pcm_substream *fe_substream = + fe->pcm->streams[cstream->direction].substream; struct snd_soc_platform *platform = fe->platform; struct snd_soc_dai *cpu_dai = fe->cpu_dai; int ret = 0, stream;