From patchwork Fri Jul 16 12:30:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 478406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03EACC07E95 for ; Fri, 16 Jul 2021 12:13:49 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3749B613C3 for ; Fri, 16 Jul 2021 12:13:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3749B613C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D03B81677; Fri, 16 Jul 2021 14:12:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D03B81677 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1626437624; bh=yxlkhkoTzKLNDsj+NJNTC+0A7qcx+co1YNmO4JoiP0U=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=RbzggSAu98TPovJSac9Kp+F6gzEw6qYDVSLnedQjmG5Nxn/vg4tH65T7a9k8XfWNZ jC29x5ZrldPrvT+GquuzkwTpJk/K8bMuLANaZghQz4dbSJScDPY88LRqv1wINjLdPs +fA+m85VQpWdnU4+tRSBsgBnYAMaiXCdrViSVJRg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4341CF80253; Fri, 16 Jul 2021 14:12:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 010BFF80254; Fri, 16 Jul 2021 14:12:52 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2089.outbound.protection.outlook.com [40.107.101.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 117EAF8013C for ; Fri, 16 Jul 2021 14:12:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 117EAF8013C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="COv3AnqD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fPuJ5Sh2Mi0zhekzaQd/4H45DZmVYQxY1AFLB+MGlaJmeS6jJO0yAwouzYxFr9KEy3i4jaeUAmajAyAexMAEVfb5gk27QqtEx3QZcO9dTx0oSjRJR4C7pdVNpnfrB4Guj+lVDQRO8KwrdelokiLVI9D/dvf2iCzhxD1eH5mfA+9WI6Ul9CtdBzV1/nsyr+fKOOuUc3SC4wa862ifdouyGRNt5A79q9jfDpKF9y3WQ7WwMRxL58HfgTomzlACha47l/0t7Qz4Srf8/rNqR96ab34FRMtAn6GoVUoxCoCA+fNzub4ALS08V+QYn0hz5llulTtmQWDx6Q/dTwdqxzkNkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e45xSRnjwqdlPmwQN/T+aBqP+lPZCLkGt89nZwAhdp0=; b=OhRMRACJ+O7yuIOGFy77KOJkz7HPIa+AuN1xvJnplPE+7VjrMPrc2K/mhG9vG54fMImKCxtng9/F31QjAuY1CLjj2XkXnGdD4BkkgqqEKB1WQYaHpRLl9HJbjRzBHA9wyzTvWIxk69rEB3vxdYkP8CGBDUu+dL6oPQvXVbDqy87wdlpRIEY/Q9j0JQZB22D/GulTiVQfoHrZJljWBUSmd0PZEgHMemyBqwusvTZwfZ/vBdZAGjzeq0R6rKn23kjqRSzMO0vtDR9nFpb/UdWOvlpEzBZM/IGULdbbFYXeKh4uRfyHkqLMQdxGDn+BXUDT8ZVXj2TNaqTkaf1RNarMug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e45xSRnjwqdlPmwQN/T+aBqP+lPZCLkGt89nZwAhdp0=; b=COv3AnqD4RW1QIM2ArEl3Fox2zne21gx6wLECp+0Mguqof9KyarNFs5XsC20lGgn7e7QTnEnzaiiFm+9lVIfD+t60xSIZ/yoFR2Ok5ZilYJBARnJBEZAADnJGxBOtla1sUbXfc+i60krSFd7TFEIYMHduDDBgXg/a35RaAZb8+M= Received: from MWHPR11CA0025.namprd11.prod.outlook.com (2603:10b6:300:115::11) by BN8PR12MB3140.namprd12.prod.outlook.com (2603:10b6:408:67::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.23; Fri, 16 Jul 2021 12:12:39 +0000 Received: from CO1NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:300:115:cafe::82) by MWHPR11CA0025.outlook.office365.com (2603:10b6:300:115::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Fri, 16 Jul 2021 12:12:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT003.mail.protection.outlook.com (10.13.175.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4331.21 via Frontend Transport; Fri, 16 Jul 2021 12:12:38 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Fri, 16 Jul 2021 07:12:36 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Fri, 16 Jul 2021 07:12:36 -0500 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2242.4 via Frontend Transport; Fri, 16 Jul 2021 07:12:26 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 1/2] ASoC: soc-pcm: add a flag to reverse the stop sequence Date: Fri, 16 Jul 2021 18:00:12 +0530 Message-ID: <20210716123015.15697-1-vijendar.mukunda@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cac498e5-c32b-4b2b-1aa5-08d9485300ef X-MS-TrafficTypeDiagnostic: BN8PR12MB3140: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ExGm4RHfj6936NIWkHR9UXaFrHyx0hzz/mtJ+leC+Ya+b+qj2NwxfwT3ygSEDb23I1Jmw7vPzbXdsWB7W04O0sg8+u29rQ1SVUTlXY1rMER75oanHfDpKW1X6tezi/zgUimgSy6KLs5+RbZ5yqijl/ImzNdxz4DGqWYOJqJaCi8IP8iyovOBF0q4czjyWJiMR4iOrZjZv7SuECKu7fG5G6P3ajYugBDyrZK3HP3KKex92ib5F+AxiHtoYd0I1KIidNtIOgA5UqNps8GVDmrAESXSyau7cdN4YADoq2ZthamUOM4dp/CyvWyia4lXI0wZKMKcHO0i098H2CS3ge+92UNQ2ILMOmUzmsDQebg5d4iXTlS/VsOuF1Y0GeIMkSzkg5K8MXhlPp/gM1Jiwo55DPHNLcvlqGjkNetyGzGM+QWjsT9+VK1HHpjT5pkt5XpEW8ckzkZfXGnfWcaPr7Re4qC/NMb1BKMpr2kHV6zlBCpF/Bx4cqyb//pM6/PKxvFpg7AvWfMDW8gX6H3DzC2cB0ZHZdGcUMU+Feq6QQpJgcyhBHAMYma74SrAF2ZuVX/wJEzbaogvO5DDUS3NV5aZup9foRpKSOs858axIJBH6wg2bnXn4mgFyjVHUdzEbhH5345uVH8s7XwTwFgsP7rHG+2wt+TM3BF8leh1YWnpEqMp1TvjMaXHQdO1SVTMj6kJTNna2++7CH1cL8Zyc9Icr+DndntL9BGDaqZbNEGBnY4= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(346002)(396003)(39860400002)(136003)(376002)(46966006)(36840700001)(2906002)(356005)(86362001)(8676002)(316002)(6666004)(5660300002)(82740400003)(70586007)(70206006)(7416002)(110136005)(26005)(54906003)(1076003)(7696005)(426003)(478600001)(36860700001)(4326008)(81166007)(47076005)(186003)(336012)(2616005)(8936002)(36756003)(44832011)(83380400001)(82310400003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2021 12:12:38.3112 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cac498e5-c32b-4b2b-1aa5-08d9485300ef X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3140 Cc: Pierre-Louis Bossart , Sunil-kumar.Dommati@amd.com, amistry@google.com, open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Peter Ujfalusi , Vijendar Mukunda , Alexander.Deucher@amd.com, nartemiev@google.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On stream stop, currently CPU DAI stop sequence invoked first followed by DMA. For Few platforms, it is required to stop the DMA first before stopping CPU DAI. Introduced new flag in dai_link structure for reordering stop sequence. Based on flag check, ASoC core will re-order the stop sequence. Fixes: 4378f1fbe92405 ("ASoC: soc-pcm: Use different sequence for start/stop trigger") Signed-off-by: Vijendar Mukunda --- include/sound/soc.h | 6 ++++++ sound/soc/soc-pcm.c | 22 ++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 675849d07284..8e6dd8a257c5 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -712,6 +712,12 @@ struct snd_soc_dai_link { /* Do not create a PCM for this DAI link (Backend link) */ unsigned int ignore:1; + /* This flag will reorder stop sequence. By enabling this flag + * DMA controller stop sequence will be invoked first followed by + * CPU DAI driver stop sequence + */ + unsigned int stop_dma_first:1; + #ifdef CONFIG_SND_SOC_TOPOLOGY struct snd_soc_dobj dobj; /* For topology */ #endif diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 46513bb97904..d1c570ca21ea 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1015,6 +1015,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); int ret = -EINVAL, _ret = 0; int rollback = 0; @@ -1055,14 +1056,23 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - ret = snd_soc_pcm_dai_trigger(substream, cmd, rollback); - if (ret < 0) - break; + if (rtd->dai_link->stop_dma_first) { + ret = snd_soc_pcm_component_trigger(substream, cmd, rollback); + if (ret < 0) + break; - ret = snd_soc_pcm_component_trigger(substream, cmd, rollback); - if (ret < 0) - break; + ret = snd_soc_pcm_dai_trigger(substream, cmd, rollback); + if (ret < 0) + break; + } else { + ret = snd_soc_pcm_dai_trigger(substream, cmd, rollback); + if (ret < 0) + break; + ret = snd_soc_pcm_component_trigger(substream, cmd, rollback); + if (ret < 0) + break; + } ret = snd_soc_link_trigger(substream, cmd, rollback); break; } From patchwork Fri Jul 16 12:30:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 479292 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79125C07E95 for ; Fri, 16 Jul 2021 12:14:37 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E9599613AF for ; Fri, 16 Jul 2021 12:14:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9599613AF Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 78EEC1685; Fri, 16 Jul 2021 14:13:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 78EEC1685 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1626437675; bh=qU0yxfkh6BqiFkhbHalAHiUBDV/KgwH88Ttiu3XCjl8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JUVRBQW5rsCHqkCcmv1QVTry/yIc3UEyJp/k0YEHvDzZtcz7/Ni/C3AYvE5K0kldY tnz8Hw0EPszAXDdwbosW4UMG/uLAHeOR38kQ8Ui4aBHoerSJlQEqOqRO0UkBlzMzn7 ag7B7guGkfqL7xd8sUn3Qkr1B700kMj/y6PUpUd0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 42EEDF80269; Fri, 16 Jul 2021 14:13:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 33781F8026D; Fri, 16 Jul 2021 14:13:10 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2040.outbound.protection.outlook.com [40.107.220.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4C31FF80254 for ; Fri, 16 Jul 2021 14:13:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4C31FF80254 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="NaDX8oUX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IQj26NLWMml1HAf/rY0XFozCdPrfZacBONuHdOXajNpqoeiD4vDD1dLdFTqfzs4eYEMzJRsaJ4AWoz3k+theN4Oq31hTm7/NUWL0jDHzai0ptVyB/oM8fvPvekNpp1cEjCUgJh633JufdrenD4kHHGpI9AQHKFPeiCUQK02YjfLqHQ3eMVfr0XEy+mGV2QqoTIqyarWsEy/Q2vNc19XpeBJOzR39gXFJsbn4yqCemzf3itw7QlSiOiWFp28mx8ao0DjJvgQ+QbkDiGMuroML6WEWVPJ4ndUnRIGOV1KYjS5nAIaYnVLnH5UTIYKxyMI+Bgfs2nlUPUib5uex8lBHOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/37BxLM1lJhqQptDhmGzO1FQuWPqqTduxYBkwiDlBC0=; b=d85B4knnq2QPdhNFnpnZzjCwjuXS6KddjB5/yGokReKwzdV+GYVd77OPvlc/g2MpuihuUOYkhxcHWdQywGgeuCz8qBABtjhfkrxHi3LyycqQ3WKKShpNAWx2/gvkLL4OYIKd13yTbIDUPFN+BkrM/4YI60zzzmfSj3mPq1hdKT8xFmsmS/BurelY67LdJ43c3zTy4F7Utk/kn35Q6FH4phbEVkQ+A+g+OjL4v9YpBtGEPQ1+06ITjT7jZOvwBnAFBznHbk+7fRhN9N7k4V3GZ6xafNAbXoEZ+K48DRjsbGMiqYu2T0HG6CStcJ+v+rsbDvPFx3Q7eLmLCpFqqT7QUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/37BxLM1lJhqQptDhmGzO1FQuWPqqTduxYBkwiDlBC0=; b=NaDX8oUXwjbpjHzTghflQRrTYXKySB//2ED6u9TFWZLZ/9LjaePeJhLlDAth/IhN2cON8A9PM5DlyI56G2yabc5dhY9pleA77V4aQamBSCU1XQJthzGx7jxCgtXRAt0Gbah2ksC+WqB/8oOKFnaD1G5J961ITxVcR3soF5CA1Tg= Received: from CO2PR18CA0043.namprd18.prod.outlook.com (2603:10b6:104:2::11) by BN6PR12MB1217.namprd12.prod.outlook.com (2603:10b6:404:20::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Fri, 16 Jul 2021 12:13:00 +0000 Received: from CO1NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:104:2:cafe::e0) by CO2PR18CA0043.outlook.office365.com (2603:10b6:104:2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Fri, 16 Jul 2021 12:13:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT056.mail.protection.outlook.com (10.13.175.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4331.21 via Frontend Transport; Fri, 16 Jul 2021 12:13:00 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Fri, 16 Jul 2021 07:12:59 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Fri, 16 Jul 2021 07:12:58 -0500 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2242.4 via Frontend Transport; Fri, 16 Jul 2021 07:12:48 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 2/2] ASoC: amd: reverse stop sequence for stoneyridge platform Date: Fri, 16 Jul 2021 18:00:13 +0530 Message-ID: <20210716123015.15697-2-vijendar.mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210716123015.15697-1-vijendar.mukunda@amd.com> References: <20210716123015.15697-1-vijendar.mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 596177fa-1e8c-45c3-cb46-08d948530de6 X-MS-TrafficTypeDiagnostic: BN6PR12MB1217: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:741; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0suPSnrbCLrXladIvfloKTBm2LY1S+SXe+f5CGzceg6eMXjNkKKq+81BnLMeJbpPXHXE5OaQVp7Ph3F4ky+npHiAab2+7z2HHfeiZn+3F85Q0KMzSziRaunx5p4gcexEjIu4Q6BtIVagJ3xdL79rI7U40U3TcgaHOlsSHwTiqFohg4kUpPgna0fEbkTfRCFWWHadZm8pOiNhYVc4fvA1Lk3t+jGRYubqL77fFzwCPAVu9QD4dxUB77EUlH5oG9UeY6B9aEeB1KqMWhti4hNTSsPNokSXRqSJIHRzY/XgK0r7VWit1Mca02ydcme9JiuN7/Ycu4AyidzghwTjPlDLlB8JwTSSxy5wAD8bVsfvANArTk56GMFYtu8KjVNhlwHUmuxEy8zs4dz/NLiGE5lX7HYWhNQe1VjlTBqABb5puPCdL8oXyA2BWl1L36iKxbpZY4VzHn5bnyDfLRcj50+fdnl6iCSbS4x/yGxdpCDgj45KLJ4weChsGrIwDfZEorGfCv7GNLX+SkYX/z4P4+2loHGWSzne2EBGj8lUC65Txeqw70X8c+DQJrKL0H2MiB6PNgrcj3ONRC8xrmd3h+BxtwknGVZ9W9dMnlEJ4AKhkVvkWWdfCwKO8Wbay4sSt9EVS9khOoC/kUpn4nJENaq3FXbV/hF0lC6oPUDE2rYltScPEmTaz/fjekBcuSnqoquudjuZCbfrk5aTtLyyzd4nu5QiwGD6JX15GAJWFqVmGZI= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(39860400002)(136003)(46966006)(36840700001)(478600001)(36756003)(36860700001)(82310400003)(426003)(316002)(4326008)(7696005)(2616005)(186003)(26005)(336012)(86362001)(5660300002)(110136005)(356005)(6666004)(82740400003)(70586007)(54906003)(8676002)(47076005)(2906002)(1076003)(81166007)(7416002)(44832011)(8936002)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2021 12:13:00.0711 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 596177fa-1e8c-45c3-cb46-08d948530de6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1217 Cc: Sunil-kumar.Dommati@amd.com, amistry@google.com, Kuninori Morimoto , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Chuhong Yuan , Liam Girdwood , Vijendar Mukunda , Alexander.Deucher@amd.com, nartemiev@google.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" For Stoneyridge platform, it is required to invoke DMA driver stop first rather than invoking DWC I2S controller stop. Enable dai_link structure stop_dma_fist flag to reverse the stop sequence. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/acp-da7219-max98357a.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c index 84e3906abd4f..9449fb40a956 100644 --- a/sound/soc/amd/acp-da7219-max98357a.c +++ b/sound/soc/amd/acp-da7219-max98357a.c @@ -576,6 +576,7 @@ static struct snd_soc_dai_link cz_dai_5682_98357[] = { | SND_SOC_DAIFMT_CBM_CFM, .init = cz_rt5682_init, .dpcm_playback = 1, + .stop_dma_first = 1, .ops = &cz_rt5682_play_ops, SND_SOC_DAILINK_REG(designware1, rt5682, platform), }, @@ -585,6 +586,7 @@ static struct snd_soc_dai_link cz_dai_5682_98357[] = { .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, .dpcm_capture = 1, + .stop_dma_first = 1, .ops = &cz_rt5682_cap_ops, SND_SOC_DAILINK_REG(designware2, rt5682, platform), }, @@ -594,6 +596,7 @@ static struct snd_soc_dai_link cz_dai_5682_98357[] = { .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, .dpcm_playback = 1, + .stop_dma_first = 1, .ops = &cz_rt5682_max_play_ops, SND_SOC_DAILINK_REG(designware3, mx, platform), }, @@ -604,6 +607,7 @@ static struct snd_soc_dai_link cz_dai_5682_98357[] = { .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, .dpcm_capture = 1, + .stop_dma_first = 1, .ops = &cz_rt5682_dmic0_cap_ops, SND_SOC_DAILINK_REG(designware3, adau, platform), }, @@ -614,6 +618,7 @@ static struct snd_soc_dai_link cz_dai_5682_98357[] = { .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, .dpcm_capture = 1, + .stop_dma_first = 1, .ops = &cz_rt5682_dmic1_cap_ops, SND_SOC_DAILINK_REG(designware2, adau, platform), },