From patchwork Mon Jul 2 21:19:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 10502547 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 832736028F for ; Mon, 2 Jul 2018 22:25:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 726A728AB7 for ; Mon, 2 Jul 2018 22:25:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 664B728AD3; Mon, 2 Jul 2018 22:25:39 +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=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham 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 AC8C628AB7 for ; Mon, 2 Jul 2018 22:25:38 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7F5F1267766; Tue, 3 Jul 2018 00:25:37 +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 A277B267776; Tue, 3 Jul 2018 00:25:34 +0200 (CEST) Received: from mail-it0-f67.google.com (mail-it0-f67.google.com [209.85.214.67]) by alsa0.perex.cz (Postfix) with ESMTP id CA626267778 for ; Tue, 3 Jul 2018 00:25:31 +0200 (CEST) Received: by mail-it0-f67.google.com with SMTP id p4-v6so465877itf.2 for ; Mon, 02 Jul 2018 15:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aLEJflwbyrgEVsNYggmO2put4RpiCH6W7s/wUZagWVM=; b=LSxi6tZ8kTdoXjRRDFemln3HTfCo8YcVgPZM6143x5ktmDfbncC8J0qRPRFAXxQJz4 WyKAsFjVIOsYUH/UK6LfI12r2M/wxVL2NyWSCeeg2vuJzmG29tUKousOBo/1TIM+WVLq dEKCEjzdECk0gBAs+nA1BxkWX7892g7VBevQQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aLEJflwbyrgEVsNYggmO2put4RpiCH6W7s/wUZagWVM=; b=MHh7w9RiyKNShTdKuEQ+SCo/AVKYSozJndyeNU7eCEVuEJW1gkMvdU+2XYz9Bv+n1G A7jCLSfdzK6GoZ/V5d9L+m3XCSLpA3cx5sSeFZjdHjs/NirUml6BWTXx50PnkcMmypKm thIx3g5Hqin6/lYheGniwtyWxp3Le3YwTk2CVyp5TNTrANb/DMw5mL9OuUTYhbn6dxaO SNdhMFlGf34yG+DmO8898KomOPaZg3D0y4/T70uRFWz8wH5T0vGk1w2ANe1BPWoxB19M K4OZ4CvGy/d4uva6LCf844Z0OHGkQgub5taf+h6IiEwaw6/KW+MHvu3nyo++THaChiBG TUGA== X-Gm-Message-State: APt69E0gozt5+xtRSHU1o2GhPoJcokElasf33dLpxby/s1DXHt8ilMQX KlOI8lSfzhUE+0CSeYkh4ekq7SjFVxU= X-Google-Smtp-Source: AAOMgpchR2/dMsrkodqf5X2wWgRCrgXssqFy+/kGr0Lo4Jf2MMJT26X3t5GwtWHrgH89lOnSNTu6Dg== X-Received: by 2002:a02:8ac6:: with SMTP id i6-v6mr22209952jal.122.1530566417027; Mon, 02 Jul 2018 14:20:17 -0700 (PDT) Received: from djkurtz2.bld.corp.google.com ([2620:15c:183:0:1cfd:61a5:7215:5f9c]) by smtp.gmail.com with ESMTPSA id h75-v6sm776729ioh.50.2018.07.02.14.20.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 14:20:16 -0700 (PDT) From: Daniel Kurtz To: Date: Mon, 2 Jul 2018 15:19:55 -0600 Message-Id: <20180702211956.149355-6-djkurtz@chromium.org> X-Mailer: git-send-email 2.18.0.399.gad0ab374a1-goog In-Reply-To: <20180702211956.149355-1-djkurtz@chromium.org> References: <20180702211956.149355-1-djkurtz@chromium.org> Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list , Takashi Iwai , Daniel Kurtz , Liam Girdwood , Mark Brown , "Mukunda, Vijendar" , Alex Deucher , Guenter Roeck , Akshu Agrawal Subject: [alsa-devel] [PATCH 6/6] ASoC: AMD: Simplify trigger handler 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 Now that the I2S channel names are fixed, and DMA data flow order is consistent (ch1 then ch2), we can simplify channel start order: start the upstream channel and then the downstream channel for both playback and capture cases. Signed-off-by: Daniel Kurtz --- sound/soc/amd/acp-pcm-dma.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index ab60129f4f266..65c1033bd51cc 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -1024,10 +1024,7 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: rtd->bytescount = acp_get_byte_count(rtd); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - acp_dma_start(rtd->acp_mmio, rtd->ch1); - acp_dma_start(rtd->acp_mmio, rtd->ch2); - } else { + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { if (rtd->capture_channel == CAP_CHANNEL0) { acp_dma_cap_channel_disable(rtd->acp_mmio, CAP_CHANNEL1); @@ -1040,9 +1037,9 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) acp_dma_cap_channel_enable(rtd->acp_mmio, CAP_CHANNEL1); } - acp_dma_start(rtd->acp_mmio, rtd->ch2); - acp_dma_start(rtd->acp_mmio, rtd->ch1); } + acp_dma_start(rtd->acp_mmio, rtd->ch1); + acp_dma_start(rtd->acp_mmio, rtd->ch2); ret = 0; break; case SNDRV_PCM_TRIGGER_STOP: