From patchwork Sat Jul 15 06:15:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Lai X-Patchwork-Id: 9842095 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 A88EA602BD for ; Sat, 15 Jul 2017 06:15:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9191728751 for ; Sat, 15 Jul 2017 06:15:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85C7A2875A; Sat, 15 Jul 2017 06:15:22 +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 8140428751 for ; Sat, 15 Jul 2017 06:15:20 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 070A6266C25; Sat, 15 Jul 2017 08:15:17 +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 B0042266C39; Sat, 15 Jul 2017 08:15:15 +0200 (CEST) Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by alsa0.perex.cz (Postfix) with ESMTP id CE37B2669F3 for ; Sat, 15 Jul 2017 08:15:13 +0200 (CEST) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E06336128C; Sat, 15 Jul 2017 06:15:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1500099311; bh=swCGM4QTcz4PmtIh0PfLxTRu0/ibygucfMQxinH35Wc=; h=From:To:Cc:Subject:Date:From; b=GtdQpO49WSfm3egBvKM6zW8XrnaKcKAXDZCSZvngPQvd5GtQc4e8qwoyo5o0VuRHE Ogz53w8yHzWC1daA/G5cGox1iIHO7rOqXqaKI30aCSFBdsiVoA1vIoXF3bNfou0Eir u93ySVDsblJDLvBNVGvYjODWv9z9bBS/+iKY0zXg= Received: from plai-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: plai@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4763561255; Sat, 15 Jul 2017 06:15:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1500099311; bh=swCGM4QTcz4PmtIh0PfLxTRu0/ibygucfMQxinH35Wc=; h=From:To:Cc:Subject:Date:From; b=GtdQpO49WSfm3egBvKM6zW8XrnaKcKAXDZCSZvngPQvd5GtQc4e8qwoyo5o0VuRHE Ogz53w8yHzWC1daA/G5cGox1iIHO7rOqXqaKI30aCSFBdsiVoA1vIoXF3bNfou0Eir u93ySVDsblJDLvBNVGvYjODWv9z9bBS/+iKY0zXg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4763561255 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=plai@codeaurora.org From: Patrick Lai To: broonie@kernel.org Date: Fri, 14 Jul 2017 23:15:05 -0700 Message-Id: <1500099305-16438-1-git-send-email-plai@codeaurora.org> X-Mailer: git-send-email 1.9.1 Cc: alsa-devel@alsa-project.org, bgoswami@codeaurora.org, Gopikrishnaiah Anandan , Patrick Lai Subject: [alsa-devel] [PATCH] ASoC: do not close shared backend dailink 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: Banajit Goswami Multiple frontend dailinks may be connected to a backend dailink at the same time. When one of frontend dailinks is closed, the associated backend dailink should not be closed if it is connected to other active frontend dailinks. Change ensures that backend dailink is closed only after all connected frontend dailinks are closed. Signed-off-by: Gopikrishnaiah Anandan Signed-off-by: Banajit Goswami Signed-off-by: Patrick Lai --- sound/soc/soc-pcm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index efc5831..3d2c69f 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -181,6 +181,10 @@ int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", be->dai_link->name, event, dir); + if ((event == SND_SOC_DAPM_STREAM_STOP) && + (be->dpcm[dir].users >= 1)) + continue; + snd_soc_dapm_stream_event(be, dir, event); }