From patchwork Mon Jul 16 07:02:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10525615 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 98082603ED for ; Mon, 16 Jul 2018 07:13:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84C222885F for ; Mon, 16 Jul 2018 07:13:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7810D28A6D; Mon, 16 Jul 2018 07:13:41 +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=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=unavailable 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 0EC992885F for ; Mon, 16 Jul 2018 07:13:38 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E8FE02673ED; Mon, 16 Jul 2018 09:03:33 +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 C7CC326767C; Mon, 16 Jul 2018 09:03:30 +0200 (CEST) Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730078.outbound.protection.outlook.com [40.107.73.78]) by alsa0.perex.cz (Postfix) with ESMTP id 6C0C526720C for ; Mon, 16 Jul 2018 09:03:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B+BTeOYsMttBsTNtmGexOm4hZugHFsi7R0o5MQZArlo=; b=bKiU7/UbvaBOq8lC9vhQUzlXqjq1kGTCg6sdWsOA5m7BHGFzKXKgQ8/DSTNPx4LS+OqQmgszNED18w3DQDjLE3Uv0J9CwWh1FXcPA0rDKCuvjQ9lKTabS18chKVpviPpa30bgn8yMwRqCjFDcmsm8+iEHnodUa3SP2uO4cnC8J4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Akshu.Agrawal@amd.com; Received: from akshu-HP-EliteBook-745-G2.amd.com (202.56.249.162) by SN1PR12MB2365.namprd12.prod.outlook.com (2603:10b6:802:25::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Mon, 16 Jul 2018 07:03:13 +0000 From: Akshu Agrawal To: Date: Mon, 16 Jul 2018 15:02:40 +0800 Message-Id: <1531724566-4019-1-git-send-email-akshu.agrawal@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR0101CA0066.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::28) To SN1PR12MB2365.namprd12.prod.outlook.com (2603:10b6:802:25::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 68fe4949-396c-409b-323e-08d5eaea37bc X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(48565401081)(2017052603328)(7153060)(7193020); SRVR:SN1PR12MB2365; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2365; 3:1kpkKVUNUPvHQMHFCS0yB6ru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Csj1EZSefx3fQG3O/tZ6G/W+hBB+qnHxviCAhOazGeQnyoO05hKb5XyMGOmOSTkP7HYmbtE65MRtbiouN0lI5fOTMF8PJXuBge3I6Imi52Z6hduVnrIeGbZ8LsS1r9bDqzCrWpSgU0bFgk+KiJ7qdS5HW5AmD1K9AqbmcYJPNLcsaKMBzgB2hHf2SR0a8Zy5gAu3fcdRYD63nJ0fC9Tj2IOHHdS6VDfVRW7DtRYZ8uS5nzflKmRuuEPnlZY5Pm7BFay4QWrzK4cO8KpGvgkW8QO7hlf+5XORS0PYRdeEdazh7kxkjXmYtzz3gz0a5OzDXmuesz; 4:dN9pg9FTahSXhDEdqi1jVJrgvP2N1FJzbkByXhsvaC3B2zRx2nyrhKh7IGPCY1dWy8jiH4dvyWeaGJvJDmrr7OhcXBidv8kvvwQhgHnnyHQoHJnJQEBGNC2IoCx7vAlliaPKfG3YUk3REJQLCNkpWF/rSOwYFtUHmo7eX/2VzxgXx0H04acgvx7aDFEFSLtUwiBe50/weYGc3kPTYhJ8wyrfpKPUQixor/ctR51fc1BjbwBH0o18lEIi6cvetDeX2Bc93fKpY6CuKYJ7Q2Sz5TC5ODANzWkQUVrdl3Hm5yozWb3GfCAMb8/E8fJmz0gN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:SN1PR12MB2365; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB2365; X-Forefront-PRVS: 073515755F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(346002)(376002)(366004)(18054003)(199004)(189003)(51416003)(6116002)(16526019)(6486002)(1671002)(386003)(7696005)(186003)(48376002)(36756003)(26005)(72206003)(52116002)(50466002)(478600001)(97736004)(3846002)(106356001)(105586002)(53416004)(316002)(8936002)(50226002)(5660300001)(2906002)(16586007)(25786009)(44832011)(14444005)(54906003)(86362001)(53936002)(81166006)(81156014)(4326008)(305945005)(6666003)(8676002)(7736002)(109986005)(66066001)(2616005)(476003)(956004)(47776003)(486006)(68736007)(39060400002)(266003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB2365; H:akshu-HP-EliteBook-745-G2.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB2365; 23:oErFMN6zNjpqmkU+RxygE8BTw9bIMIqWf9LLQx6RM?= =?us-ascii?Q?olD3M9AIIlYje1PWPWzxDLnNaUlOIMRlu2/MuDEpz9CJTDEgAWZmq5+/hRbO?= =?us-ascii?Q?eIzdjSm7ZV3+PrFqva5a7UFVoy+fAb0xWXcCE97sKP3sbErNm+Se1RPwTrHG?= =?us-ascii?Q?yzEoyWDpKROnvPIhzB0IkPu3mMivJX7qJW6yicHYQcExQy4rs938S+4Frjru?= =?us-ascii?Q?tlvBp/+vke3aJT+xIZR5nNtu4iihRZKS7L5k7b894NvdiGX2GBYepc5Y1gcS?= =?us-ascii?Q?dTbtjk3QDXV1SwpfzJSY5XQrnGTAa2ZwvPkuvwFi66PDkKrIXX3GrjedKGOT?= =?us-ascii?Q?ilPOkN/TeQhLv8TgRr8D9MMKx+YjFgx9PkavCvrCIEXWEQPjuEBV6aQchNv3?= =?us-ascii?Q?e2gzz8ZOOgxOvLgMnwV76GOLlT7eFDMKDrwkEpz9HM3kn/ogT99D+h/WHVXS?= =?us-ascii?Q?xyZB8aFg5Rm4VE7FTE4CIhjdArZuaP5w7P/vo83x3/+wpnahcqPrQhBhPoIS?= =?us-ascii?Q?mWFhYqaYzzTO9EaA+T3ZLCKdwazM3JaN84+jEqtktj63ju/gdGeX1MtuiUrw?= =?us-ascii?Q?hSczyVhoOGIZ267ROgUADUm78Cwzi7IKEfBDKjZhr3YcUezAGGNXqIxBNPZR?= =?us-ascii?Q?bZInMhgLZ89aPmqZZZxWbqACeaY8dcKW0dHgyK6stHo3SCXMJHNs/rNoeEcd?= =?us-ascii?Q?kRHY+Ijo2Q44poc3M08eQ67wDPBeX/HROIz+9UdqmMYVCw2v0rDUCRITXbuU?= =?us-ascii?Q?iJhpmRzIxOktfUq2XUtiVqgy6tCRvY737k5/Vqf8zvPLOeghndSIHyiUuzfB?= =?us-ascii?Q?TpgDyKnrBPucstj8Ma2NKs07WCtALzMm0C2ofLK48sz7vmRzVg7fl1D1Spdv?= =?us-ascii?Q?aHKAi6Tr9t+JTC88V52CjkCG8SelEJo7xlJDqqRMpC2nhPSu12PY/RdS3mNM?= =?us-ascii?Q?z3z/Sbed7xF1chOBE7VArVbKSZc6RVQWHGych8siC4MhKu7kTSVi7GGHep2G?= =?us-ascii?Q?R16YDkICRXg7yOw8449Vb6v3wtzo02iSU/96JFkOMPl7Y6VfFiA8HwnvzpYE?= =?us-ascii?Q?mpUBblBwGd4qnQpII1sw98ghgataqoWwN6lCxojhPJ3H3cpG61whAV0Q7LPl?= =?us-ascii?Q?mGtzU1A8d3ycpIXsoWV59KY+bc+ItFBVPD7AVPlkkWx31RFnL/3SEcnCKTmV?= =?us-ascii?Q?pOOL85z8BlGveaNBYUm+5Hi9kiTU5yVYwokwMHQI2SLx2ILY8c/F4F5Vzmdw?= =?us-ascii?Q?TOdMO9NJPnTQw63Gw1iGg2Lq2X9MX2JZs0q6gyTVnsInmMu3/2LFr7MDW/A9?= =?us-ascii?B?QT09?= X-Microsoft-Antispam-Message-Info: aPKqquEY7uskZOXLTcGrzSovs6c4gEdNqt0jbE/EC78ABy8LxLIH13M2QBl+/HChVL0uiUpw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hN9qnCLFEfewilw2kVlI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2365; 7:EUaEQ1p0BRxNQlDp3Er3G0eopYUplVw3CbJwsTbTPzwFuLLkOnLIaOVGG+FyF3oU8uEy3qgy2RujFP88n9+eSdhyIzk7Geo4l1UOi/a3PdfEl71Z5ITnEYHubnWWn1wGLeQ50AAi9gQh44QM6JuA6JY2veOzga+vc4OyaDAVQJ7/iPYOFp8UzFNmLNhbD9yx9mZpBoYxRAW3ehQGS8mTWWwoVd6wuayevdJMkm5Pv47L/181cq98wQzAV96qH9xn; 20:+GjpLq23+Uds2TwBm8LoiaGvUTTeYBe0opDQ62MyVV6jMFR0qycJcaBXndxZ/Z3/uu+5n/LC+ZpjiuaB+B6fI3m+3H68DG/IzGcBLY2d2z+g3xF+1bVugL91XWeFYKYhfH3eGWLBGc3vetLhxnHBfxOr4rmnZbIBLDjohhCkLhGbiTb4c56ZV0gvfN+5GfgZrIJltHiExVq3KYpFrrIuCRrWOQJ4Yo2n78zmfyMjDffyGvlzAVORcHEWnl4Y+PdS X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2018 07:03:13.8591 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68fe4949-396c-409b-323e-08d5eaea37bc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2365 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list , Takashi Iwai , Liam Girdwood , djkurtz@chromium.org, Mark Brown , "Mukunda, Vijendar" , Alex Deucher , akshu.agrawal@amd.com, Guenter Roeck Subject: [alsa-devel] [PATCH 1/2] ASoC: AMD: Send correct channel for configuring DMA descriptors 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Earlier, ch1 was used to define ACP-SYSMEM transfer and ch2 for ACP-I2S transfer. With recent patches ch1 is used to define channel order number 1 and ch2 as channel order number 2. Thus, Playback: ch1:SYSMEM->ACP ch2:ACP->I2S Capture: ch1:I2S->ACP ch1:ACP->SYSMEM Signed-off-by: Akshu Agrawal --- sound/soc/amd/acp-pcm-dma.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 65c1033..eeb8677 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -322,17 +322,27 @@ static void config_acp_dma(void __iomem *acp_mmio, struct audio_substream_data *rtd, u32 asic_type) { + u16 ch_acp_sysmem, ch_acp_i2s; + acp_pte_config(acp_mmio, rtd->pg, rtd->num_of_pages, rtd->pte_offset); + + if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) { + ch_acp_sysmem = rtd->ch1; + ch_acp_i2s = rtd->ch2; + } else { + ch_acp_i2s = rtd->ch1; + ch_acp_sysmem = rtd->ch2; + } /* Configure System memory <-> ACP SRAM DMA descriptors */ set_acp_sysmem_dma_descriptors(acp_mmio, rtd->size, rtd->direction, rtd->pte_offset, - rtd->ch1, rtd->sram_bank, + ch_acp_sysmem, rtd->sram_bank, rtd->dma_dscr_idx_1, asic_type); /* Configure ACP SRAM <-> I2S DMA descriptors */ set_acp_to_i2s_dma_descriptors(acp_mmio, rtd->size, rtd->direction, rtd->sram_bank, - rtd->destination, rtd->ch2, + rtd->destination, ch_acp_i2s, rtd->dma_dscr_idx_2, asic_type); } @@ -995,16 +1005,24 @@ static int acp_dma_prepare(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; struct audio_substream_data *rtd = runtime->private_data; + u16 ch_acp_sysmem, ch_acp_i2s; if (!rtd) return -EINVAL; + if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) { + ch_acp_sysmem = rtd->ch1; + ch_acp_i2s = rtd->ch2; + } else { + ch_acp_i2s = rtd->ch1; + ch_acp_sysmem = rtd->ch2; + } config_acp_dma_channel(rtd->acp_mmio, - rtd->ch1, + ch_acp_sysmem, rtd->dma_dscr_idx_1, NUM_DSCRS_PER_CHANNEL, 0); config_acp_dma_channel(rtd->acp_mmio, - rtd->ch2, + ch_acp_i2s, rtd->dma_dscr_idx_2, NUM_DSCRS_PER_CHANNEL, 0); return 0;