From patchwork Mon Nov 12 05:34:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10678115 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 25DF714E2 for ; Mon, 12 Nov 2018 05:31:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09BA329E14 for ; Mon, 12 Nov 2018 05:31:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1D2B29E28; Mon, 12 Nov 2018 05:31:17 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 BE2DC29E14 for ; Mon, 12 Nov 2018 05:31:14 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 92E35267877; Mon, 12 Nov 2018 06:31:12 +0100 (CET) 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 D59B826792F; Mon, 12 Nov 2018 06:31:09 +0100 (CET) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0072.outbound.protection.outlook.com [104.47.41.72]) by alsa0.perex.cz (Postfix) with ESMTP id 69FBB2677E4 for ; Mon, 12 Nov 2018 06:31:04 +0100 (CET) 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=X7KvAlBVpgIEx/QJtm+M/ohbqNvDgMbKSFOm0la4+UQ=; b=SdVZ9YIi6qjdS2i6xVAlA69H3qRO4QzIjy2J2VnDkH4nN9sdRLn5Kk5MvBkF+LMhanFVjWbj9k8TMJURrkGv9DzxSdU8GLNSx8hbcwgUHMZLOARUXCZK8tkr0QNoFFThCsPZOtV8jXg+BR09iTV39prflYjuMa7LAdFnVLnNdys= Received: from BN4PR12CA0024.namprd12.prod.outlook.com (2603:10b6:403:2::34) by SN1PR12MB0621.namprd12.prod.outlook.com (2a01:111:e400:c429::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Mon, 12 Nov 2018 05:31:01 +0000 Received: from CO1NAM03FT015.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::201) by BN4PR12CA0024.outlook.office365.com (2603:10b6:403:2::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.20 via Frontend Transport; Mon, 12 Nov 2018 05:31:00 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT015.mail.protection.outlook.com (10.152.80.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:30:59 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:30:58 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:04:52 +0530 Message-ID: <1542000903-19020-2-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(136003)(346002)(376002)(39860400002)(396003)(2980300002)(428003)(199004)(189003)(478600001)(105586002)(16586007)(8936002)(4326008)(50226002)(53416004)(7696005)(77096007)(39060400002)(51416003)(305945005)(109986005)(186003)(2906002)(6666004)(4744004)(76176011)(97736004)(356004)(106466001)(53946003)(486006)(47776003)(14444005)(81166006)(50466002)(81156014)(426003)(1671002)(48376002)(336012)(8676002)(104016004)(446003)(68736007)(11346002)(36756003)(476003)(2616005)(53936002)(19627235002)(72206003)(5660300001)(316002)(54906003)(26005)(575784001)(86362001)(126002)(266003)(579004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0621; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT015; 1:KR2TiOPSVUS3hvbMqhA9YuvK+81DniLVAb0CnmkAsJOxcLgWdMp6rXyQxHlgjYm62kueQqWSHzFEp1Ovxdjyiw286kY9BujKOo+3MoQbwVcCxy/2CuCFB5JWZkN808FT X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5d3bed47-5fcb-42ff-2303-08d6486007bf X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:SN1PR12MB0621; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0621; 3:Fjt5WwncTL52wjLB977f+sVOke8It6TJjN2Ir8NU4eYlb5naqlZ+nmiBWjhMmtZndcWBie9y3wuQOc74B4t6GRth+ALT9Oz5bYeNU5gdHSsOkHFLITspZnCHycQlg1Ax49uxMOnTLop2DJ5NHj4fCAHdj29XS7TwXmEkIYC57xx/5/mecMS1eN+pWbL1nVhI8JZrWkLzoyDbMxlf97RDEZ79xRkYeP/yvqg8W4Mu1SsC8BaJ/+15DUL7tqKupboR/SRKE0ux243eJ9cCcUy8CTh1UpolxKSKb3/NRMYZ0S/HrOT0TnvB+pnuYr+nSVWNt8xLxTqsdtHLymY69rj66V8pSiGjeEzyZHOW9wDHeyE=; 25:inBvQ+FEM5rFrZA7K2BXkNRTJJzd6flqjFemevekqnnER3CxM5JzitqMTVuCkN6EvNvYWd8kaH4aLLbnv/eAOANWh0JQZ19ZTczuivwD0a3rf1a8ZnevMMmywxRNN/kF6xG7y+7+qCb8iYB7oOTmAAMMcjspXSc14DK36diKIDxGotcJIIztN3Y+0hYimUZw24ECHNh2Xp0mM5Zjvxob5bmPcFjyKSZGNyN83u0LLnQKots2P1T9lIFXwVb4dltoCWHyiDQMCCNfPVHcVF+QSXtyGBn3tvaJkurqO0Jjt+0JxLaUKmG9opyYI03aWHN3FQmTo0Ywri89KHWOFNnQDQ== X-MS-TrafficTypeDiagnostic: SN1PR12MB0621: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0621; 31:BnmAEGrEtGxbLFMy5kX/TfNqwLdXdzDNPHvH/uybtHAnf+scReuD+gHDwx+/ZoVITDpSlHU6z9HrzautpRS246oSvOkqYftYjsLJJG5M3lb1j3FM3kdo9m2UeYbHxOtIP5O5RFAjVmiGeb2xtgdCfxMaMFEfj+nzkusGcuab8puWNNVz+kzh1M06dz4Q00pirqOnQDmV9AZxu7J17/edAdXDghFK3FlxR+fu6QVtBI8=; 20:H6MtUrxsTRUr2fu7mj/iba4Dg6JMPxvjow2PHh5lM/p2P/iIFvXKZ2LczBCIVV0qgMli/XeCAlyAox6C/wo+tgSs2gpujeqK1X+LLRa0i4T91aLrHjDp/gvJQm06h1RY5cH/ELmqz/IAqmw1HwSqbT7kcmb6pzk/kQcM3hbZNg9inQJ28aNX+Wko+rqDH7DTXvF4wjUwEBMNYlQER1LZHd0+oicNmK5dzfwpc06D7nxeOloZkRS2wijSLwSMn7/TkvsKYvsrzsPpyn+Ge4j6J491RFgPohiKvfW1QNlx0rlKQIQhobQyU/7EXbhNgtAjPVG5ZBsxVF+ryCj7yt6HECNhCaw2BiX1BDNWiVM5ivd0BpjrfltugJIJn/fQ2BKWtn/j9Y6hNuVLRFFyhCFQayta+D5yQxRTwdgOl57Js5j6mpxd+OYhOBKAmD61GzAYQHSHTkRE0ax8U48aTfHXOTyGS1F4J2bvoBPikSZN4SCkB0f3sNaPje3paiic6IDq 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)(3231382)(944501410)(52105112)(93006095)(93003095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:SN1PR12MB0621; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0621; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0621; 4:P4q9otnjc6BL0RZbhA59XaSEA2yz01brW19uIPZSFY45pIiPGS6tiyhX1kd5D7qikn0V+FrvPi8DcOEG6VRERKisp4bmQeTzGJRuY8XV/xEZQqvBo9hWSV+kpjs17NxZKzsPX+JKd0ZCHsnlzhBiGStu7Asyd7Q1p7h7n1lTtjZzZ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huR2uC25f8odyGXQaLCeLALmNSzgAj5pCyi4q6CxBBechaX2hv5tvTmp7mvqkO1PVhBU5qYhr4PC5W9flsQYp0EWqvon3ZavkPkoWHHlVVwsPYA0c2q3ksDbktGPTtTXY+glbMN+5dN2PnBit8eGrD58Fj8GYC+hxAYo6pLmIe2OzfIpXOGgiwpjBo6JQUkMxbdXQYcS4G1G6ddHV8iPO6SpQwh6rG+vAtYHEUWd/OVmIOJk7SLuTAV79ZwMygEX18A7Bv61S8BFXF7LMDXeXd1eoJ0ONrJT0Ppq7Sw7Q==; 5:SukFrWpqyMjC/tOWd/JgINtOX9365UN7bs5LbL4BQ9L3DWHAms4KRkaG06Zm7iyg62j9PiM6ERCTst3HAW606pgVTJFg8I0O5759c8M+Z7/xAkDxyAUpf9u4+Z6tap/kSfOV49U2xexXNpaDlSGxDJNKlMXpgrtNK4SG0xe+3cU=; 7:A2cJpO3JfnCOAnwkoAxsGzIw33boqVg3uLiwH7AfzcWvUCYgF82ZGn0T5ZHYJAr9p7E0G12LoZMcu09Uj80q69oUSiARL4ELwTNPboU8IcAJv+/6aH7reI9j3gTm44Ez9Z0RDR+jxrgcm6BhcYQEeA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0621; 20:mX5iP082KBH3iQSn5xhLPbqDUCqNprtoR6RWLqPrXD0/JMPOX5a5CUtKCUOIWAP3+yIbWFJvHfL7nKVhf6fqz8pvV0sZeeIzF9jbd5bqfeh+f0s+ZeT6ldURDNhzhoXWy2RdGCVVhjkeywlooy3TrdTj3wGc7cOe4gwPjICGtls44wzjZsRaI2mnH9gdG8O4GYxC6d/mjlhlvjcm8gRr9+ycAqGuNgTD/EWpvvQtpGuTCVGbtoqseORlxVz9qBx7 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:30:59.9937 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d3bed47-5fcb-42ff-2303-08d6486007bf 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0621 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , vijendar.mukunda@amd.com, Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 01/11] ASoC: AMD: add ACP 3.x IP register header 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 From: Maruthi Srinivas Bayyavarapu ACP 3.x is a new audio block in raven. Added register header of the same. Signed-off-by: Maruthi Bayyavarapu Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/chip_offset_byte.h | 655 +++++++++++++++++++++++++++++++++ 1 file changed, 655 insertions(+) create mode 100644 sound/soc/amd/raven/chip_offset_byte.h diff --git a/sound/soc/amd/raven/chip_offset_byte.h b/sound/soc/amd/raven/chip_offset_byte.h new file mode 100644 index 0000000..fceb7bb --- /dev/null +++ b/sound/soc/amd/raven/chip_offset_byte.h @@ -0,0 +1,655 @@ +/* + * ACP 3.0 Register documentation + * + * Copyright (C) 2016 Advanced Micro Devices, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _acp_ip_OFFSET_HEADER +#define _acp_ip_OFFSET_HEADER +// Registers from ACP_DMA block + +#define mmACP_DMA_CNTL_0 0x1240000 +#define mmACP_DMA_CNTL_1 0x1240004 +#define mmACP_DMA_CNTL_2 0x1240008 +#define mmACP_DMA_CNTL_3 0x124000C +#define mmACP_DMA_CNTL_4 0x1240010 +#define mmACP_DMA_CNTL_5 0x1240014 +#define mmACP_DMA_CNTL_6 0x1240018 +#define mmACP_DMA_CNTL_7 0x124001C +#define mmACP_DMA_DSCR_STRT_IDX_0 0x1240020 +#define mmACP_DMA_DSCR_STRT_IDX_1 0x1240024 +#define mmACP_DMA_DSCR_STRT_IDX_2 0x1240028 +#define mmACP_DMA_DSCR_STRT_IDX_3 0x124002C +#define mmACP_DMA_DSCR_STRT_IDX_4 0x1240030 +#define mmACP_DMA_DSCR_STRT_IDX_5 0x1240034 +#define mmACP_DMA_DSCR_STRT_IDX_6 0x1240038 +#define mmACP_DMA_DSCR_STRT_IDX_7 0x124003C +#define mmACP_DMA_DSCR_CNT_0 0x1240040 +#define mmACP_DMA_DSCR_CNT_1 0x1240044 +#define mmACP_DMA_DSCR_CNT_2 0x1240048 +#define mmACP_DMA_DSCR_CNT_3 0x124004C +#define mmACP_DMA_DSCR_CNT_4 0x1240050 +#define mmACP_DMA_DSCR_CNT_5 0x1240054 +#define mmACP_DMA_DSCR_CNT_6 0x1240058 +#define mmACP_DMA_DSCR_CNT_7 0x124005C +#define mmACP_DMA_PRIO_0 0x1240060 +#define mmACP_DMA_PRIO_1 0x1240064 +#define mmACP_DMA_PRIO_2 0x1240068 +#define mmACP_DMA_PRIO_3 0x124006C +#define mmACP_DMA_PRIO_4 0x1240070 +#define mmACP_DMA_PRIO_5 0x1240074 +#define mmACP_DMA_PRIO_6 0x1240078 +#define mmACP_DMA_PRIO_7 0x124007C +#define mmACP_DMA_CUR_DSCR_0 0x1240080 +#define mmACP_DMA_CUR_DSCR_1 0x1240084 +#define mmACP_DMA_CUR_DSCR_2 0x1240088 +#define mmACP_DMA_CUR_DSCR_3 0x124008C +#define mmACP_DMA_CUR_DSCR_4 0x1240090 +#define mmACP_DMA_CUR_DSCR_5 0x1240094 +#define mmACP_DMA_CUR_DSCR_6 0x1240098 +#define mmACP_DMA_CUR_DSCR_7 0x124009C +#define mmACP_DMA_CUR_TRANS_CNT_0 0x12400A0 +#define mmACP_DMA_CUR_TRANS_CNT_1 0x12400A4 +#define mmACP_DMA_CUR_TRANS_CNT_2 0x12400A8 +#define mmACP_DMA_CUR_TRANS_CNT_3 0x12400AC +#define mmACP_DMA_CUR_TRANS_CNT_4 0x12400B0 +#define mmACP_DMA_CUR_TRANS_CNT_5 0x12400B4 +#define mmACP_DMA_CUR_TRANS_CNT_6 0x12400B8 +#define mmACP_DMA_CUR_TRANS_CNT_7 0x12400BC +#define mmACP_DMA_ERR_STS_0 0x12400C0 +#define mmACP_DMA_ERR_STS_1 0x12400C4 +#define mmACP_DMA_ERR_STS_2 0x12400C8 +#define mmACP_DMA_ERR_STS_3 0x12400CC +#define mmACP_DMA_ERR_STS_4 0x12400D0 +#define mmACP_DMA_ERR_STS_5 0x12400D4 +#define mmACP_DMA_ERR_STS_6 0x12400D8 +#define mmACP_DMA_ERR_STS_7 0x12400DC +#define mmACP_DMA_DESC_BASE_ADDR 0x12400E0 +#define mmACP_DMA_DESC_MAX_NUM_DSCR 0x12400E4 +#define mmACP_DMA_CH_STS 0x12400E8 +#define mmACP_DMA_CH_GROUP 0x12400EC +#define mmACP_DMA_CH_RST_STS 0x12400F0 + + +// Registers from ACP_AXI2AXIATU block + +#define mmACPAXI2AXI_ATU_PAGE_SIZE_GRP_1 0x1240C00 +#define mmACPAXI2AXI_ATU_BASE_ADDR_GRP_1 0x1240C04 +#define mmACPAXI2AXI_ATU_PAGE_SIZE_GRP_2 0x1240C08 +#define mmACPAXI2AXI_ATU_BASE_ADDR_GRP_2 0x1240C0C +#define mmACPAXI2AXI_ATU_PAGE_SIZE_GRP_3 0x1240C10 +#define mmACPAXI2AXI_ATU_BASE_ADDR_GRP_3 0x1240C14 +#define mmACPAXI2AXI_ATU_PAGE_SIZE_GRP_4 0x1240C18 +#define mmACPAXI2AXI_ATU_BASE_ADDR_GRP_4 0x1240C1C +#define mmACPAXI2AXI_ATU_PAGE_SIZE_GRP_5 0x1240C20 +#define mmACPAXI2AXI_ATU_BASE_ADDR_GRP_5 0x1240C24 +#define mmACPAXI2AXI_ATU_PAGE_SIZE_GRP_6 0x1240C28 +#define mmACPAXI2AXI_ATU_BASE_ADDR_GRP_6 0x1240C2C +#define mmACPAXI2AXI_ATU_PAGE_SIZE_GRP_7 0x1240C30 +#define mmACPAXI2AXI_ATU_BASE_ADDR_GRP_7 0x1240C34 +#define mmACPAXI2AXI_ATU_PAGE_SIZE_GRP_8 0x1240C38 +#define mmACPAXI2AXI_ATU_BASE_ADDR_GRP_8 0x1240C3C +#define mmACPAXI2AXI_ATU_CTRL 0x1240C40 + + +// Registers from ACP_CLKRST block + +#define mmACP_SOFT_RESET 0x1241000 +#define mmACP_CONTROL 0x1241004 +#define mmACP_STATUS 0x1241008 +#define mmACP_DSP0_OCD_HALT_ON_RST 0x124100C +#define mmACP_DYNAMIC_CG_MASTER_CONTROL 0x1241010 + + +// Registers from ACP_MISC block + +#define mmACP_EXTERNAL_INTR_ENB 0x1241800 +#define mmACP_EXTERNAL_INTR_CNTL 0x1241804 +#define mmACP_EXTERNAL_INTR_STAT 0x1241808 +#define mmACP_DSP0_INTR_CNTL 0x124180C +#define mmACP_DSP0_INTR_STAT 0x1241810 +#define mmACP_DSP_SW_INTR_CNTL 0x1241814 +#define mmACP_DSP_SW_INTR_STAT 0x1241818 +#define mmACP_SW_INTR_TRIG 0x124181C +#define mmACP_SMU_MAILBOX 0x1241820 +#define mmDSP_INTERRUPT_ROUTING_CTRL 0x1241824 +#define mmACP_DSP0_WATCHDOG_TIMER_CNTL 0x1241828 +#define mmACP_DSP0_EXT_TIMER1_CNTL 0x124182C +#define mmACP_DSP0_EXT_TIMER2_CNTL 0x1241830 +#define mmACP_DSP0_EXT_TIMER3_CNTL 0x1241834 +#define mmACP_DSP0_EXT_TIMER4_CNTL 0x1241838 +#define mmACP_DSP0_EXT_TIMER5_CNTL 0x124183C +#define mmACP_DSP0_EXT_TIMER6_CNTL 0x1241840 +#define mmACP_DSP0_EXT_TIMER1_CURR_VALUE 0x1241844 +#define mmACP_DSP0_EXT_TIMER2_CURR_VALUE 0x1241848 +#define mmACP_DSP0_EXT_TIMER3_CURR_VALUE 0x124184C +#define mmACP_DSP0_EXT_TIMER4_CURR_VALUE 0x1241850 +#define mmACP_DSP0_EXT_TIMER5_CURR_VALUE 0x1241854 +#define mmACP_DSP0_EXT_TIMER6_CURR_VALUE 0x1241858 +#define mmACP_FW_STATUS 0x124185C +#define mmACP_TIMER 0x1241874 +#define mmACP_TIMER_CNTL 0x1241878 +#define mmACP_PGMEM_CTRL 0x12418C0 +#define mmACP_ERROR_STATUS 0x12418C4 +#define mmACP_SW_I2S_ERROR_REASON 0x12418C8 +#define mmACP_MEM_PG_STS 0x12418CC + + +// Registers from ACP_PGFSM block + +#define mmACP_I2S_PIN_CONFIG 0x1241400 +#define mmACP_PAD_PULLUP_PULLDOWN_CTRL 0x1241404 +#define mmACP_PAD_DRIVE_STRENGTH_CTRL 0x1241408 +#define mmACP_SW_PAD_KEEPER_EN 0x124140C +#define mmACP_SW_WAKE_EN 0x1241410 +#define mmACP_I2S_WAKE_EN 0x1241414 +#define mmACP_PME_EN 0x1241418 +#define mmACP_PGFSM_CONTROL 0x124141C +#define mmACP_PGFSM_STATUS 0x1241420 + + +// Registers from ACP_SCRATCH block + +#define mmACP_SCRATCH_REG_0 0x1250000 +#define mmACP_SCRATCH_REG_1 0x1250004 +#define mmACP_SCRATCH_REG_2 0x1250008 +#define mmACP_SCRATCH_REG_3 0x125000C +#define mmACP_SCRATCH_REG_4 0x1250010 +#define mmACP_SCRATCH_REG_5 0x1250014 +#define mmACP_SCRATCH_REG_6 0x1250018 +#define mmACP_SCRATCH_REG_7 0x125001C +#define mmACP_SCRATCH_REG_8 0x1250020 +#define mmACP_SCRATCH_REG_9 0x1250024 +#define mmACP_SCRATCH_REG_10 0x1250028 +#define mmACP_SCRATCH_REG_11 0x125002C +#define mmACP_SCRATCH_REG_12 0x1250030 +#define mmACP_SCRATCH_REG_13 0x1250034 +#define mmACP_SCRATCH_REG_14 0x1250038 +#define mmACP_SCRATCH_REG_15 0x125003C +#define mmACP_SCRATCH_REG_16 0x1250040 +#define mmACP_SCRATCH_REG_17 0x1250044 +#define mmACP_SCRATCH_REG_18 0x1250048 +#define mmACP_SCRATCH_REG_19 0x125004C +#define mmACP_SCRATCH_REG_20 0x1250050 +#define mmACP_SCRATCH_REG_21 0x1250054 +#define mmACP_SCRATCH_REG_22 0x1250058 +#define mmACP_SCRATCH_REG_23 0x125005C +#define mmACP_SCRATCH_REG_24 0x1250060 +#define mmACP_SCRATCH_REG_25 0x1250064 +#define mmACP_SCRATCH_REG_26 0x1250068 +#define mmACP_SCRATCH_REG_27 0x125006C +#define mmACP_SCRATCH_REG_28 0x1250070 +#define mmACP_SCRATCH_REG_29 0x1250074 +#define mmACP_SCRATCH_REG_30 0x1250078 +#define mmACP_SCRATCH_REG_31 0x125007C +#define mmACP_SCRATCH_REG_32 0x1250080 +#define mmACP_SCRATCH_REG_33 0x1250084 +#define mmACP_SCRATCH_REG_34 0x1250088 +#define mmACP_SCRATCH_REG_35 0x125008C +#define mmACP_SCRATCH_REG_36 0x1250090 +#define mmACP_SCRATCH_REG_37 0x1250094 +#define mmACP_SCRATCH_REG_38 0x1250098 +#define mmACP_SCRATCH_REG_39 0x125009C +#define mmACP_SCRATCH_REG_40 0x12500A0 +#define mmACP_SCRATCH_REG_41 0x12500A4 +#define mmACP_SCRATCH_REG_42 0x12500A8 +#define mmACP_SCRATCH_REG_43 0x12500AC +#define mmACP_SCRATCH_REG_44 0x12500B0 +#define mmACP_SCRATCH_REG_45 0x12500B4 +#define mmACP_SCRATCH_REG_46 0x12500B8 +#define mmACP_SCRATCH_REG_47 0x12500BC +#define mmACP_SCRATCH_REG_48 0x12500C0 +#define mmACP_SCRATCH_REG_49 0x12500C4 +#define mmACP_SCRATCH_REG_50 0x12500C8 +#define mmACP_SCRATCH_REG_51 0x12500CC +#define mmACP_SCRATCH_REG_52 0x12500D0 +#define mmACP_SCRATCH_REG_53 0x12500D4 +#define mmACP_SCRATCH_REG_54 0x12500D8 +#define mmACP_SCRATCH_REG_55 0x12500DC +#define mmACP_SCRATCH_REG_56 0x12500E0 +#define mmACP_SCRATCH_REG_57 0x12500E4 +#define mmACP_SCRATCH_REG_58 0x12500E8 +#define mmACP_SCRATCH_REG_59 0x12500EC +#define mmACP_SCRATCH_REG_60 0x12500F0 +#define mmACP_SCRATCH_REG_61 0x12500F4 +#define mmACP_SCRATCH_REG_62 0x12500F8 +#define mmACP_SCRATCH_REG_63 0x12500FC +#define mmACP_SCRATCH_REG_64 0x1250100 +#define mmACP_SCRATCH_REG_65 0x1250104 +#define mmACP_SCRATCH_REG_66 0x1250108 +#define mmACP_SCRATCH_REG_67 0x125010C +#define mmACP_SCRATCH_REG_68 0x1250110 +#define mmACP_SCRATCH_REG_69 0x1250114 +#define mmACP_SCRATCH_REG_70 0x1250118 +#define mmACP_SCRATCH_REG_71 0x125011C +#define mmACP_SCRATCH_REG_72 0x1250120 +#define mmACP_SCRATCH_REG_73 0x1250124 +#define mmACP_SCRATCH_REG_74 0x1250128 +#define mmACP_SCRATCH_REG_75 0x125012C +#define mmACP_SCRATCH_REG_76 0x1250130 +#define mmACP_SCRATCH_REG_77 0x1250134 +#define mmACP_SCRATCH_REG_78 0x1250138 +#define mmACP_SCRATCH_REG_79 0x125013C +#define mmACP_SCRATCH_REG_80 0x1250140 +#define mmACP_SCRATCH_REG_81 0x1250144 +#define mmACP_SCRATCH_REG_82 0x1250148 +#define mmACP_SCRATCH_REG_83 0x125014C +#define mmACP_SCRATCH_REG_84 0x1250150 +#define mmACP_SCRATCH_REG_85 0x1250154 +#define mmACP_SCRATCH_REG_86 0x1250158 +#define mmACP_SCRATCH_REG_87 0x125015C +#define mmACP_SCRATCH_REG_88 0x1250160 +#define mmACP_SCRATCH_REG_89 0x1250164 +#define mmACP_SCRATCH_REG_90 0x1250168 +#define mmACP_SCRATCH_REG_91 0x125016C +#define mmACP_SCRATCH_REG_92 0x1250170 +#define mmACP_SCRATCH_REG_93 0x1250174 +#define mmACP_SCRATCH_REG_94 0x1250178 +#define mmACP_SCRATCH_REG_95 0x125017C +#define mmACP_SCRATCH_REG_96 0x1250180 +#define mmACP_SCRATCH_REG_97 0x1250184 +#define mmACP_SCRATCH_REG_98 0x1250188 +#define mmACP_SCRATCH_REG_99 0x125018C +#define mmACP_SCRATCH_REG_100 0x1250190 +#define mmACP_SCRATCH_REG_101 0x1250194 +#define mmACP_SCRATCH_REG_102 0x1250198 +#define mmACP_SCRATCH_REG_103 0x125019C +#define mmACP_SCRATCH_REG_104 0x12501A0 +#define mmACP_SCRATCH_REG_105 0x12501A4 +#define mmACP_SCRATCH_REG_106 0x12501A8 +#define mmACP_SCRATCH_REG_107 0x12501AC +#define mmACP_SCRATCH_REG_108 0x12501B0 +#define mmACP_SCRATCH_REG_109 0x12501B4 +#define mmACP_SCRATCH_REG_110 0x12501B8 +#define mmACP_SCRATCH_REG_111 0x12501BC +#define mmACP_SCRATCH_REG_112 0x12501C0 +#define mmACP_SCRATCH_REG_113 0x12501C4 +#define mmACP_SCRATCH_REG_114 0x12501C8 +#define mmACP_SCRATCH_REG_115 0x12501CC +#define mmACP_SCRATCH_REG_116 0x12501D0 +#define mmACP_SCRATCH_REG_117 0x12501D4 +#define mmACP_SCRATCH_REG_118 0x12501D8 +#define mmACP_SCRATCH_REG_119 0x12501DC +#define mmACP_SCRATCH_REG_120 0x12501E0 +#define mmACP_SCRATCH_REG_121 0x12501E4 +#define mmACP_SCRATCH_REG_122 0x12501E8 +#define mmACP_SCRATCH_REG_123 0x12501EC +#define mmACP_SCRATCH_REG_124 0x12501F0 +#define mmACP_SCRATCH_REG_125 0x12501F4 +#define mmACP_SCRATCH_REG_126 0x12501F8 +#define mmACP_SCRATCH_REG_127 0x12501FC +#define mmACP_SCRATCH_REG_128 0x1250200 + + +// Registers from ACP_SW_ACLK block + +#define mmSW_CORB_Base_Address 0x1243200 +#define mmSW_CORB_Write_Pointer 0x1243204 +#define mmSW_CORB_Read_Pointer 0x1243208 +#define mmSW_CORB_Control 0x124320C +#define mmSW_CORB_Size 0x1243214 +#define mmSW_RIRB_Base_Address 0x1243218 +#define mmSW_RIRB_Write_Pointer 0x124321C +#define mmSW_RIRB_Response_Interrupt_Count 0x1243220 +#define mmSW_RIRB_Control 0x1243224 +#define mmSW_RIRB_Size 0x1243228 +#define mmSW_RIRB_FIFO_MIN_THDL 0x124322C +#define mmSW_imm_cmd_UPPER_WORD 0x1243230 +#define mmSW_imm_cmd_LOWER_QWORD 0x1243234 +#define mmSW_imm_resp_UPPER_WORD 0x1243238 +#define mmSW_imm_resp_LOWER_QWORD 0x124323C +#define mmSW_imm_cmd_sts 0x1243240 +#define mmSW_BRA_BASE_ADDRESS 0x1243244 +#define mmSW_BRA_TRANSFER_SIZE 0x1243248 +#define mmSW_BRA_DMA_BUSY 0x124324C +#define mmSW_BRA_RESP 0x1243250 +#define mmSW_BRA_RESP_FRAME_ADDR 0x1243254 +#define mmSW_BRA_CURRENT_TRANSFER_SIZE 0x1243258 +#define mmSW_STATE_CHANGE_STATUS_0TO7 0x124325C +#define mmSW_STATE_CHANGE_STATUS_8TO11 0x1243260 +#define mmSW_STATE_CHANGE_STATUS_MASK_0to7 0x1243264 +#define mmSW_STATE_CHANGE_STATUS_MASK_8to11 0x1243268 +#define mmSW_CLK_FREQUENCY_CTRL 0x124326C +#define mmSW_ERROR_INTR_MASK 0x1243270 +#define mmSW_PHY_TEST_MODE_DATA_OFF 0x1243274 + + +// Registers from ACP_SW_SWCLK block + +#define mmACP_SW_EN 0x1243000 +#define mmACP_SW_EN_STATUS 0x1243004 +#define mmACP_SW_FRAMESIZE 0x1243008 +#define mmACP_SW_SSP_Counter 0x124300C +#define mmACP_SW_Audio_TX_EN 0x1243010 +#define mmACP_SW_Audio_TX_EN_STATUS 0x1243014 +#define mmACP_SW_Audio_TX_Frame_Format 0x1243018 +#define mmACP_SW_Audio_TX_SampleInterval 0x124301C +#define mmACP_SW_Audio_TX_Hctrl_DP0 0x1243020 +#define mmACP_SW_Audio_TX_Hctrl_DP1 0x1243024 +#define mmACP_SW_Audio_TX_Hctrl_DP2 0x1243028 +#define mmACP_SW_Audio_TX_Hctrl_DP3 0x124302C +#define mmACP_SW_Audio_TX_offset_DP0 0x1243030 +#define mmACP_SW_Audio_TX_offset_DP1 0x1243034 +#define mmACP_SW_Audio_TX_offset_DP2 0x1243038 +#define mmACP_SW_Audio_TX_offset_DP3 0x124303C +#define mmACP_SW_Audio_TX_Channel_Enable_DP0 0x1243040 +#define mmACP_SW_Audio_TX_Channel_Enable_DP1 0x1243044 +#define mmACP_SW_Audio_TX_Channel_Enable_DP2 0x1243048 +#define mmACP_SW_Audio_TX_Channel_Enable_DP3 0x124304C +#define mmACP_SW_BT_TX_EN 0x1243050 +#define mmACP_SW_BT_TX_EN_STATUS 0x1243054 +#define mmACP_SW_BT_TX_Frame_Format 0x1243058 +#define mmACP_SW_BT_TX_SampleInterval 0x124305C +#define mmACP_SW_BT_TX_Hctrl 0x1243060 +#define mmACP_SW_BT_TX_offset 0x1243064 +#define mmACP_SW_BT_TX_Channel_Enable_DP0 0x1243068 +#define mmACP_SW_Headset_TX_EN 0x124306C +#define mmACP_SW_Headset_TX_EN_STATUS 0x1243070 +#define mmACP_SW_Headset_TX_Frame_Format 0x1243074 +#define mmACP_SW_Headset_TX_SampleInterval 0x1243078 +#define mmACP_SW_Headset_TX_Hctrl 0x124307C +#define mmACP_SW_Headset_TX_offset 0x1243080 +#define mmACP_SW_Headset_TX_Channel_Enable_DP0 0x1243084 +#define mmACP_SW_Audio_RX_EN 0x1243088 +#define mmACP_SW_Audio_RX_EN_STATUS 0x124308C +#define mmACP_SW_Audio_RX_Frame_Format 0x1243090 +#define mmACP_SW_Audio_RX_SampleInterval 0x1243094 +#define mmACP_SW_Audio_RX_Hctrl_DP0 0x1243098 +#define mmACP_SW_Audio_RX_Hctrl_DP1 0x124309C +#define mmACP_SW_Audio_RX_Hctrl_DP2 0x1243100 +#define mmACP_SW_Audio_RX_Hctrl_DP3 0x1243104 +#define mmACP_SW_Audio_RX_offset_DP0 0x1243108 +#define mmACP_SW_Audio_RX_offset_DP1 0x124310C +#define mmACP_SW_Audio_RX_offset_DP2 0x1243110 +#define mmACP_SW_Audio_RX_offset_DP3 0x1243114 +#define mmACP_SW_Audio_RX_Channel_Enable_DP0 0x1243118 +#define mmACP_SW_Audio_RX_Channel_Enable_DP1 0x124311C +#define mmACP_SW_Audio_RX_Channel_Enable_DP2 0x1243120 +#define mmACP_SW_Audio_RX_Channel_Enable_DP3 0x1243124 +#define mmACP_SW_BT_RX_EN 0x1243128 +#define mmACP_SW_BT_RX_EN_STATUS 0x124312C +#define mmACP_SW_BT_RX_Frame_Format 0x1243130 +#define mmACP_SW_BT_RX_SampleInterval 0x1243134 +#define mmACP_SW_BT_RX_Hctrl 0x1243138 +#define mmACP_SW_BT_RX_offset 0x124313C +#define mmACP_SW_BT_RX_Channel_Enable_DP0 0x1243140 +#define mmACP_SW_Headset_RX_EN 0x1243144 +#define mmACP_SW_Headset_RX_EN_STATUS 0x1243148 +#define mmACP_SW_Headset_RX_Frame_Format 0x124314C +#define mmACP_SW_Headset_RX_SampleInterval 0x1243150 +#define mmACP_SW_Headset_RX_Hctrl 0x1243154 +#define mmACP_SW_Headset_RX_offset 0x1243158 +#define mmACP_SW_Headset_RX_Channel_Enable_DP0 0x124315C +#define mmACP_SW_BPT_PORT_EN 0x1243160 +#define mmACP_SW_BPT_PORT_EN_STATUS 0x1243164 +#define mmACP_SW_BPT_PORT_Frame_Format 0x1243168 +#define mmACP_SW_BPT_PORT_SampleInterval 0x124316C +#define mmACP_SW_BPT_PORT_Hctrl 0x1243170 +#define mmACP_SW_BPT_PORT_offset 0x1243174 +#define mmACP_SW_BPT_PORT_Channel_Enable 0x1243178 +#define mmACP_SW_BPT_PORT_First_byte_addr 0x124317C +#define mmACP_SW_CLK_RESUME_CTRL 0x1243180 +#define mmACP_SW_CLK_RESUME_Delay_Cntr 0x1243184 +#define mmACP_SW_BUS_RESET_CTRL 0x1243188 +#define mmACP_SW_PRBS_ERR_STATUS 0x124318C + + +// Registers from ACP_AUDIO_BUFFERS block + +#define mmACP_I2S_RX_RINGBUFADDR 0x1242000 +#define mmACP_I2S_RX_RINGBUFSIZE 0x1242004 +#define mmACP_I2S_RX_LINKPOSITIONCNTR 0x1242008 +#define mmACP_I2S_RX_FIFOADDR 0x124200C +#define mmACP_I2S_RX_FIFOSIZE 0x1242010 +#define mmACP_I2S_RX_DMA_SIZE 0x1242014 +#define mmACP_I2S_RX_LINEARPOSITIONCNTR_HIGH 0x1242018 +#define mmACP_I2S_RX_LINEARPOSITIONCNTR_LOW 0x124201C +#define mmACP_I2S_RX_INTR_WATERMARK_SIZE 0x1242020 +#define mmACP_I2S_TX_RINGBUFADDR 0x1242024 +#define mmACP_I2S_TX_RINGBUFSIZE 0x1242028 +#define mmACP_I2S_TX_LINKPOSITIONCNTR 0x124202C +#define mmACP_I2S_TX_FIFOADDR 0x1242030 +#define mmACP_I2S_TX_FIFOSIZE 0x1242034 +#define mmACP_I2S_TX_DMA_SIZE 0x1242038 +#define mmACP_I2S_TX_LINEARPOSITIONCNTR_HIGH 0x124203C +#define mmACP_I2S_TX_LINEARPOSITIONCNTR_LOW 0x1242040 +#define mmACP_I2S_TX_INTR_WATERMARK_SIZE 0x1242044 +#define mmACP_BT_RX_RINGBUFADDR 0x1242048 +#define mmACP_BT_RX_RINGBUFSIZE 0x124204C +#define mmACP_BT_RX_LINKPOSITIONCNTR 0x1242050 +#define mmACP_BT_RX_FIFOADDR 0x1242054 +#define mmACP_BT_RX_FIFOSIZE 0x1242058 +#define mmACP_BT_RX_DMA_SIZE 0x124205C +#define mmACP_BT_RX_LINEARPOSITIONCNTR_HIGH 0x1242060 +#define mmACP_BT_RX_LINEARPOSITIONCNTR_LOW 0x1242064 +#define mmACP_BT_RX_INTR_WATERMARK_SIZE 0x1242068 +#define mmACP_BT_TX_RINGBUFADDR 0x124206C +#define mmACP_BT_TX_RINGBUFSIZE 0x1242070 +#define mmACP_BT_TX_LINKPOSITIONCNTR 0x1242074 +#define mmACP_BT_TX_FIFOADDR 0x1242078 +#define mmACP_BT_TX_FIFOSIZE 0x124207C +#define mmACP_BT_TX_DMA_SIZE 0x1242080 +#define mmACP_BT_TX_LINEARPOSITIONCNTR_HIGH 0x1242084 +#define mmACP_BT_TX_LINEARPOSITIONCNTR_LOW 0x1242088 +#define mmACP_BT_TX_INTR_WATERMARK_SIZE 0x124208C +#define mmACP_HS_RX_RINGBUFADDR 0x1242090 +#define mmACP_HS_RX_RINGBUFSIZE 0x1242094 +#define mmACP_HS_RX_LINKPOSITIONCNTR 0x1242098 +#define mmACP_HS_RX_FIFOADDR 0x124209C +#define mmACP_HS_RX_FIFOSIZE 0x12420A0 +#define mmACP_HS_RX_DMA_SIZE 0x12420A4 +#define mmACP_HS_RX_LINEARPOSITIONCNTR_HIGH 0x12420A8 +#define mmACP_HS_RX_LINEARPOSITIONCNTR_LOW 0x12420AC +#define mmACP_HS_RX_INTR_WATERMARK_SIZE 0x12420B0 +#define mmACP_HS_TX_RINGBUFADDR 0x12420B4 +#define mmACP_HS_TX_RINGBUFSIZE 0x12420B8 +#define mmACP_HS_TX_LINKPOSITIONCNTR 0x12420BC +#define mmACP_HS_TX_FIFOADDR 0x12420C0 +#define mmACP_HS_TX_FIFOSIZE 0x12420C4 +#define mmACP_HS_TX_DMA_SIZE 0x12420C8 +#define mmACP_HS_TX_LINEARPOSITIONCNTR_HIGH 0x12420CC +#define mmACP_HS_TX_LINEARPOSITIONCNTR_LOW 0x12420D0 +#define mmACP_HS_TX_INTR_WATERMARK_SIZE 0x12420D4 + + +// Registers from ACP_I2S_TDM block + +#define mmACP_I2STDM_IER 0x1242400 +#define mmACP_I2STDM_IRER 0x1242404 +#define mmACP_I2STDM_RXFRMT 0x1242408 +#define mmACP_I2STDM_ITER 0x124240C +#define mmACP_I2STDM_TXFRMT 0x1242410 + + +// Registers from ACP_BT_TDM block + +#define mmACP_BTTDM_IER 0x1242800 +#define mmACP_BTTDM_IRER 0x1242804 +#define mmACP_BTTDM_RXFRMT 0x1242808 +#define mmACP_BTTDM_ITER 0x124280C +#define mmACP_BTTDM_TXFRMT 0x1242810 + + +// Registers from AZALIA_IP block + +#define mmAudio_Az_Global_Capabilities 0x1200000 +#define mmAudio_Az_Minor_Version 0x1200002 +#define mmAudio_Az_Major_Version 0x1200003 +#define mmAudio_Az_Output_Payload_Capability 0x1200004 +#define mmAudio_Az_Input_Payload_Capability 0x1200006 +#define mmAudio_Az_Global_Control 0x1200008 +#define mmAudio_Az_Wake_Enable 0x120000C +#define mmAudio_Az_State_Change_Status 0x120000E +#define mmAudio_Az_Global_Status 0x1200010 +#define mmAudio_Az_Linked_List_Capability_Header 0x1200014 +#define mmAudio_Az_Output_Stream_Payload_Capability 0x1200018 +#define mmAudio_Az_Input_Stream_Payload_Capability 0x120001A +#define mmAudio_Az_Interrupt_Control 0x1200020 +#define mmAudio_Az_Interrupt_Status 0x1200024 +#define mmAudio_Az_Wall_Clock_Counter 0x1200030 +#define mmAudio_Az_Stream_Synchronization 0x1200038 +#define mmAudio_Az_CORB_Lower_Base_Address 0x1200040 +#define mmAudio_Az_CORB_Upper_Base_Address 0x1200044 +#define mmAudio_Az_CORB_Write_Pointer 0x1200048 +#define mmAudio_Az_CORB_Read_Pointer 0x120004A +#define mmAudio_Az_CORB_Control 0x120004C +#define mmAudio_Az_CORB_Status 0x120004D +#define mmAudio_Az_CORB_Size 0x120004E +#define mmAudio_Az_RIRB_Lower_Base_Address 0x1200050 +#define mmAudio_Az_RIRB_Upper_Base_Address 0x1200054 +#define mmAudio_Az_RIRB_Write_Pointer 0x1200058 +#define mmAudio_Az_RIRB_Response_Interrupt_Count 0x120005A +#define mmAudio_Az_RIRB_Control 0x120005C +#define mmAudio_Az_RIRB_Status 0x120005D +#define mmAudio_Az_RIRB_Size 0x120005E +#define mmAudio_Az_Immediate_Command_Output_Interface 0x1200060 +#define mmAudio_Az_Immediate_Response_Input_Interface 0x1200064 +#define mmAudio_Az_Immediate_Command_Status 0x1200068 +#define mmAudio_Az_DPLBASE 0x1200070 +#define mmAudio_Az_DPUBASE 0x1200074 +#define mmAudio_Az_Input_SD0CTL_and_STS 0x1200080 +#define mmAudio_Az_Input_SD0LPIB 0x1200084 +#define mmAudio_Az_Input_SD0CBL 0x1200088 +#define mmAudio_Az_Input_SD0LVI 0x120008C +#define mmAudio_Az_Input_SD0FIFOS 0x1200090 +#define mmAudio_Az_Input_SD0FMT 0x1200092 +#define mmAudio_Az_Input_SD0BDPL 0x1200098 +#define mmAudio_Az_Input_SD0BDPU 0x120009C +#define mmAudio_Az_Input_SD1CTL_and_STS 0x12000A0 +#define mmAudio_Az_Input_SD1LPIB 0x12000A4 +#define mmAudio_Az_Input_SD1CBL 0x12000A8 +#define mmAudio_Az_Input_SD1LVI 0x12000AC +#define mmAudio_Az_Input_SD1FIFOS 0x12000B0 +#define mmAudio_Az_Input_SD1FMT 0x12000B2 +#define mmAudio_Az_Input_SD1BDPL 0x12000B8 +#define mmAudio_Az_Input_SD1BDPU 0x12000BC +#define mmAudio_Az_Input_SD2CTL_and_STS 0x12000C0 +#define mmAudio_Az_Input_SD2LPIB 0x12000C4 +#define mmAudio_Az_Input_SD2CBL 0x12000C8 +#define mmAudio_Az_Input_SD2LVI 0x12000CC +#define mmAudio_Az_Input_SD2FIFOS 0x12000D0 +#define mmAudio_Az_Input_SD2FMT 0x12000D2 +#define mmAudio_Az_Input_SD2BDPL 0x12000D8 +#define mmAudio_Az_Input_SD2BDPU 0x12000DC +#define mmAudio_Az_Input_SD3CTL_and_STS 0x12000E0 +#define mmAudio_Az_Input_SD3LPIB 0x12000E4 +#define mmAudio_Az_Input_SD3CBL 0x12000E8 +#define mmAudio_Az_Input_SD3LVI 0x12000EC +#define mmAudio_Az_Input_SD3FIFOS 0x12000F0 +#define mmAudio_Az_Input_SD3FMT 0x12000F2 +#define mmAudio_Az_Input_SD3BDPL 0x12000F8 +#define mmAudio_Az_Input_SD3BDPU 0x12000FC +#define mmAudio_Az_Output_SD0CTL_and_STS 0x1200100 +#define mmAudio_Az_Output_SD0LPIB 0x1200104 +#define mmAudio_Az_Output_SD0CBL 0x1200108 +#define mmAudio_Az_Output_SD0LVI 0x120010C +#define mmAudio_Az_Output_SD0FIFOS 0x1200110 +#define mmAudio_Az_Output_SD0FMT 0x1200112 +#define mmAudio_Az_Output_SD0BDPL 0x1200118 +#define mmAudio_Az_Output_SD0BDPU 0x120011C +#define mmAudio_Az_Output_SD1CTL_and_STS 0x1200120 +#define mmAudio_Az_Output_SD1LPIB 0x1200124 +#define mmAudio_Az_Output_SD1CBL 0x1200128 +#define mmAudio_Az_Output_SD1LVI 0x120012C +#define mmAudio_Az_Output_SD1FIFOS 0x1200130 +#define mmAudio_Az_Output_SD1FMT 0x1200132 +#define mmAudio_Az_Output_SD1BDPL 0x1200138 +#define mmAudio_Az_Output_SD1BDPU 0x120013C +#define mmAudio_Az_Output_SD2CTL_and_STS 0x1200140 +#define mmAudio_Az_Output_SD2LPIB 0x1200144 +#define mmAudio_Az_Output_SD2CBL 0x1200148 +#define mmAudio_Az_Output_SD2LVI 0x120014C +#define mmAudio_Az_Output_SD2FIFOS 0x1200150 +#define mmAudio_Az_Output_SD2FMT 0x1200152 +#define mmAudio_Az_Output_SD2BDPL 0x1200158 +#define mmAudio_Az_Output_SD2BDPU 0x120015C +#define mmAudio_Az_Output_SD3CTL_and_STS 0x1200160 +#define mmAudio_Az_Output_SD3LPIB 0x1200164 +#define mmAudio_Az_Output_SD3CBL 0x1200168 +#define mmAudio_Az_Output_SD3LVI 0x120016C +#define mmAudio_Az_Output_SD3FIFOS 0x1200170 +#define mmAudio_Az_Output_SD3FMT 0x1200172 +#define mmAudio_Az_Output_SD3BDPL 0x1200178 +#define mmAudio_Az_Output_SD3BDPU 0x120017C +#define mmAudioAZ_Misc_Control_Register_1 0x1200180 +#define mmAudioAZ_Misc_Control_Register_2 0x1200182 +#define mmAudioAZ_Misc_Control_Register_3 0x1200183 +#define mmAudio_AZ_Multiple_Links_Capability_Header 0x1200200 +#define mmAudio_AZ_Multiple_Links_Capability_Declaration 0x1200204 +#define mmAudio_AZ_Link0_Capabilities 0x1200240 +#define mmAudio_AZ_Link0_Control 0x1200244 +#define mmAudio_AZ_Link0_Output_Stream_ID 0x1200248 +#define mmAudio_AZ_Link0_SDI_Identifier 0x120024C +#define mmAudio_AZ_Link0_Per_Stream_Overhead 0x1200250 +#define mmAudio_AZ_Link0_Wall_Frame_Counter 0x1200258 +#define mmAudio_AZ_Link0_Output_Payload_Capability_L 0x1200260 +#define mmAudio_AZ_Link0_Output_Payload_Capability_U 0x1200264 +#define mmAudio_AZ_Link0_Input_Payload_Capability_L 0x1200270 +#define mmAudio_AZ_Link0_Input_Payload_Capability_U 0x1200274 +#define mmAudio_Az_Input_SD0LICBA 0x1202084 +#define mmAudio_Az_Input_SD1LICBA 0x12020A4 +#define mmAudio_Az_Input_SD2LICBA 0x12020C4 +#define mmAudio_Az_Input_SD3LICBA 0x12020E4 +#define mmAudio_Az_Output_SD0LICBA 0x1202104 +#define mmAudio_Az_Output_SD1LICBA 0x1202124 +#define mmAudio_Az_Output_SD2LICBA 0x1202144 +#define mmAudio_Az_Output_SD3LICBA 0x1202164 +#define mmAUDIO_AZ_POWER_MANAGEMENT_CONTROL 0x1204000 +#define mmAUDIO_AZ_IOC_SOFTRST_CONTROL 0x1204004 +#define mmAUDIO_AZ_IOC_CLKGATE_CONTROL 0x1204008 + + +// Registers from ACP_AZALIA block + +#define mmACP_AZ_PAGE0_LBASE_ADDR 0x1243800 +#define mmACP_AZ_PAGE0_UBASE_ADDR 0x1243804 +#define mmACP_AZ_PAGE0_PGEN_SIZE 0x1243808 +#define mmACP_AZ_PAGE0_OFFSET 0x124380C +#define mmACP_AZ_PAGE1_LBASE_ADDR 0x1243810 +#define mmACP_AZ_PAGE1_UBASE_ADDR 0x1243814 +#define mmACP_AZ_PAGE1_PGEN_SIZE 0x1243818 +#define mmACP_AZ_PAGE1_OFFSET 0x124381C +#define mmACP_AZ_PAGE2_LBASE_ADDR 0x1243820 +#define mmACP_AZ_PAGE2_UBASE_ADDR 0x1243824 +#define mmACP_AZ_PAGE2_PGEN_SIZE 0x1243828 +#define mmACP_AZ_PAGE2_OFFSET 0x124382C +#define mmACP_AZ_PAGE3_LBASE_ADDR 0x1243830 +#define mmACP_AZ_PAGE3_UBASE_ADDR 0x1243834 +#define mmACP_AZ_PAGE3_PGEN_SIZE 0x1243838 +#define mmACP_AZ_PAGE3_OFFSET 0x124383C +#define mmACP_AZ_PAGE4_LBASE_ADDR 0x1243840 +#define mmACP_AZ_PAGE4_UBASE_ADDR 0x1243844 +#define mmACP_AZ_PAGE4_PGEN_SIZE 0x1243848 +#define mmACP_AZ_PAGE4_OFFSET 0x124384C +#define mmACP_AZ_PAGE5_LBASE_ADDR 0x1243850 +#define mmACP_AZ_PAGE5_UBASE_ADDR 0x1243854 +#define mmACP_AZ_PAGE5_PGEN_SIZE 0x1243858 +#define mmACP_AZ_PAGE5_OFFSET 0x124385C +#define mmACP_AZ_PAGE6_LBASE_ADDR 0x1243860 +#define mmACP_AZ_PAGE6_UBASE_ADDR 0x1243864 +#define mmACP_AZ_PAGE6_PGEN_SIZE 0x1243868 +#define mmACP_AZ_PAGE6_OFFSET 0x124386C +#define mmACP_AZ_PAGE7_LBASE_ADDR 0x1243870 +#define mmACP_AZ_PAGE7_UBASE_ADDR 0x1243874 +#define mmACP_AZ_PAGE7_PGEN_SIZE 0x1243878 +#define mmACP_AZ_PAGE7_OFFSET 0x124387C + + +#endif From patchwork Mon Nov 12 05:34:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10678117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B247014E2 for ; Mon, 12 Nov 2018 05:31:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F34529E28 for ; Mon, 12 Nov 2018 05:31:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 914FB29E3A; Mon, 12 Nov 2018 05:31:38 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 8891D29E28 for ; Mon, 12 Nov 2018 05:31:37 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3BE912679BF; Mon, 12 Nov 2018 06:31:36 +0100 (CET) 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 81C692679BF; Mon, 12 Nov 2018 06:31:34 +0100 (CET) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-eopbgr760042.outbound.protection.outlook.com [40.107.76.42]) by alsa0.perex.cz (Postfix) with ESMTP id 564B6267A5C for ; Mon, 12 Nov 2018 06:31:29 +0100 (CET) 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=ve7ha8JTvwRfncF26SouVXgKXq3YhF3UBZR9W3pt2hg=; b=ucXvMgVFN2TVAZtVjiKyNe5ujSz9f4Kavj+IIFfROCpecroqpeJeNy35WyrzfR4aLuecEK6J88IEXBrnbg6QY9upLcH1nIk/FemqRdSOl5BYgly+DvfHQ2/HLtb338Sz9aZYG2Ezctz4Co+MGxfISlePWt8qLMD2WjNOjgA0Faw= Received: from SN1PR12CA0093.namprd12.prod.outlook.com (2603:10b6:802:21::28) by SN1PR12MB0622.namprd12.prod.outlook.com (2a01:111:e400:c428::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.27; Mon, 12 Nov 2018 05:31:26 +0000 Received: from CO1NAM03FT008.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::203) by SN1PR12CA0093.outlook.office365.com (2603:10b6:802:21::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.21 via Frontend Transport; Mon, 12 Nov 2018 05:31:26 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT008.mail.protection.outlook.com (10.152.80.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:31:25 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:31:24 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:04:53 +0530 Message-ID: <1542000903-19020-3-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39850400004)(396003)(376002)(346002)(136003)(2980300002)(428003)(199004)(189003)(356004)(6666004)(106466001)(105586002)(2906002)(53416004)(104016004)(305945005)(14444005)(50466002)(478600001)(97736004)(81156014)(81166006)(48376002)(1671002)(47776003)(8676002)(39060400002)(186003)(2616005)(54906003)(126002)(8936002)(476003)(109986005)(26005)(11346002)(446003)(76176011)(16586007)(426003)(7696005)(72206003)(51416003)(77096007)(86362001)(53936002)(4326008)(316002)(5660300001)(68736007)(50226002)(336012)(36756003)(486006)(266003)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0622; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT008; 1:ypfJPxKdblJn1Q1phJxNLhPeLOMKfvplB7JQZCLA/8d2S2Ay1pmKUlLiSOVGEWZjuDBwTZxUATErDELLIYJfaW0tCd7soOjflwXSviu8KxOCf+Z54I7AtNzt5k2CNLaQ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38c3169a-8aa6-4594-2431-08d648601720 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:SN1PR12MB0622; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0622; 3:oLj5kI8lqGE44lTFeAOtOzve9qaJUHBDysJjfepJgw9Nw6hBPsvdn+jog1ENUTSd1V+12ue5cRxjOwKR5wod22UMuri6Cln6uunlw5qY7TCPgLGP/JzSYdT0jalcodojRSRMWBvQZF02vmNeajDBQULAnf0zNhRzkIrEOPNvuzfzRSBsfelfoROuf6yCuFlpMvgWuygd29yAETtMCzfRv0wIYnU1zH2LFIdPpDZSkU5wEB4n+U4wFUtpYSVCj6Xg5R4MSevPcS24S71LOv/Rxq/+yraeU7XloNOAi7+bfhGxH3llzFFqvan2uTlT72uqU8yfGPZKMdhBF0cwrRw9z+nKuenn1zsG8qz63FNzFd0=; 25:pJkXCoi6YANrhIxrQLSjcnnMwKh5Uzcoxy1De0h1YXq59K/gpXcD2/D9q9DiMWn+Yge1idX7xR5hb+fwjZs5r4T256dG+duwrxGs1Kh1vS6MLQ7DMGw/BzvG+G0/HhxO9vb/+HXB3cBLiflFO30QDFyvH5KB7ppYuno2CubWRf80RQ7x9kvIQsd1BxrHXvmRnedorIm0+y3jJAqO/pPWE0krD9e8967WSMHnIIJ6v3G/Bm/3WmgJ0Y2BNIoYLp7MX3L+XowZcFBkCA3ytqxu6om7OovJO+3Zzu3IfcqQ7LVfHZzr8x5sLN+nAoMUkKd0/Dr4FBE50zlIItHQv6fkoI9BelOywV2tyQ60lRbYDwk= X-MS-TrafficTypeDiagnostic: SN1PR12MB0622: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0622; 31:HfDBiqvNhCsUounMhRWH5RuJfTR9IARp4tWgRmJrLlUhz945qpAeagMafBb/S4gz8nmmHLp4y7fuCKQbmHjluiUTFdroxSAuvXtvPgj0uZzfY22asWByk8tvLztqB04U1Vvq9kFpMhXa53M3ePZXZL23TdY4QwcUcHe+gO7YzX7PyWMaWeWx2kuKVXMHLayhpuZz+GY1nJP9zRoJNqDxz1EwOhYHjDg9qSAjGr53zdc=; 20:gYd0vWL0bxReBtR2zXPCfC+WN8jQ4engLs/ntm2Ed7syEAqttHfDAw61hXa8+6GClBF6Y6lFvHCSoAERa9f6HhFWdCh26TQY2TLx46YoPHeY+phN3pUv+enSRrLdS/QVkENOFAatAl+9SvQ4RNQPmXr0GN2vGukAk5fcgp1c9K/5SzYfz7t0QhbzMz3fGfAstxdYTOdnW0BvlD3aFAJYowJo3UICFzMR6KiiLWapiVrkUZlyJxLhUPbxnk+UCBQ/7s5gnW4wjpIHDp8DZ6K03mB72aKONHYQiurl0Uu89frSHy8xiKMhd8pdRnp7eRgyGq8tHncEYRAdldIV+n7LE86uF6xNudSslqEj/XX5IWip0UGhNmEzh07p2yxbgiVSA5gkb3orRzcn0voli4OsaGZokqQuQdEofiJJAqsL9fGI0t+Jfbgi8a/HQQaA9acYuvZF+S3HMoPWZjNlCaPl3i4oktKfawqN075KwfGHOH2mPdm5wVHtY1zFlQwpXZBI 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)(8121501046)(5005006)(3231382)(944501410)(52105112)(10201501046)(3002001)(93006095)(93003095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:SN1PR12MB0622; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0622; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0622; 4:pP4ejntTqRBr36GbZ1p3zSur5GLmdNydHAkxy9C2b4E5QPQ9ZmAsb/iZe989ApDRzR3xPK7fLG8whBnCL5wAPjeU8o4FqfsW/QBqVH/qxgmZaOySfu4QUDHlEG0BZqrtrg0LIYjg7nSvetof6dGJx/KY+FSVhwhgcRu2aZ+kWodszhewXXLCQpynJZNUvRFV9P0wXlVFOsMsB142RHJ3vSmz81FC2XQt2YGKj/DnxKSYYy/aBp1YHiFdD5Fgp5vuocJVmBI2vAOKzki0LfJsF6OnH5lTD4FLclUNZVtQ1LNX+Hks6HMlHXqR4tnhyE8U X-Forefront-PRVS: 0854128AF0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0622; 23:UgQYLol3JRc5/N/bACve/WYVU2gDIUKa6AGu2YMbm?= TUjIHiYaXBZfW3sHN/wT4rM2u67LtAmWPw/vO4VRK4F06EnSiqWFDL92kQqf+9ZDJp8fma5V8QDlS0vXIH5fUaSVjRKv27x6zoGAFe7y0+P7t1WNACjbfcKvHa9juUvmuP0KWJy54MskWlR8HOxNKnPTRL+3I7OIzwpLtQ6a4APHlHSiYtUQI7VnpfPn9k2LzfoXYWs7Sk35MeVWmxQjMOcWT/6XKybcRSJk/bwo0Rk2pzrU/5I0EdzisCtVAYnT3ESSGDg6hg5Mi+dZ67m+H4R984Bj235+mq/mUGxDilgJy4P26RvlNcJyPTF9vGc142dMvmgWY/F5gXoYb+XOlgq/R7pvCw0EF0KHB1U3uTTDa40M8mMAWXa0bY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bnXE1RgZDjkAvu3ghAKo/aMznuBJJqnD/EL1UY1ImP7+uPTBasKyTNYlGsxYzd4yzrFKOLnzXQhkGYrW0k7ENhhc9Nru3WnB3tBd6GKEhyaQeeloqGzkA5SwnOiU7rNOaO3HdgDBRB5w/wDmdL74o5x+Xq2VbWwKDE31owjhokV5/+m1LwwUUeZUJr68+fJEhM2p8mkbrcOi0yZHpFrInlCYp+0tWDewi4XYLR4T4fFE7yFJhS9hoH/6qKtOgw X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:31:25.8109 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38c3169a-8aa6-4594-2431-08d648601720 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0622 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Sanju R Mehta , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 02/11] ASoC: AMD: add ACP3.0 PCI driver 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 From: Maruthi Srinivas Bayyavarapu ACP 3.0 is a PCI audio device. This patch adds PCI driver to bind to this device and get PCI resources. Signed-off-by: Maruthi Bayyavarapu Signed-off-by: Sanju R Mehta Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/acp3x.h | 13 ++++++ sound/soc/amd/raven/pci-acp3x.c | 97 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 sound/soc/amd/raven/acp3x.h create mode 100644 sound/soc/amd/raven/pci-acp3x.c diff --git a/sound/soc/amd/raven/acp3x.h b/sound/soc/amd/raven/acp3x.h new file mode 100644 index 0000000..e9b4df0 --- /dev/null +++ b/sound/soc/amd/raven/acp3x.h @@ -0,0 +1,13 @@ +#include "chip_offset_byte.h" + +#define ACP3x_PHY_BASE_ADDRESS 0x1240000 + +static inline u32 rv_readl(void __iomem *base_addr) +{ + return readl(base_addr - ACP3x_PHY_BASE_ADDRESS); +} + +static inline void rv_writel(u32 val, void __iomem *base_addr) +{ + writel(val, base_addr - ACP3x_PHY_BASE_ADDRESS); +} diff --git a/sound/soc/amd/raven/pci-acp3x.c b/sound/soc/amd/raven/pci-acp3x.c new file mode 100644 index 0000000..27588ed --- /dev/null +++ b/sound/soc/amd/raven/pci-acp3x.c @@ -0,0 +1,97 @@ +/* + * AMD ALSA SoC PCM Driver + * + * Copyright 2016 Advanced Micro Devices, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include +#include +#include + +#include "acp3x.h" + +struct acp3x_dev_data { + void __iomem *acp3x_base; +}; + +static int snd_acp3x_probe(struct pci_dev *pci, + const struct pci_device_id *pci_id) +{ + int ret; + u32 addr; + struct acp3x_dev_data *adata; + + if (pci_enable_device(pci)) { + dev_err(&pci->dev, "pci_enable_device failed\n"); + return -ENODEV; + } + + ret = pci_request_regions(pci, "AMD ACP3x audio"); + if (ret < 0) { + dev_err(&pci->dev, "pci_request_regions failed\n"); + goto disable_pci; + } + + adata = devm_kzalloc(&pci->dev, sizeof(struct acp3x_dev_data), + GFP_KERNEL); + if (!adata) { + ret = -ENOMEM; + goto release_regions; + } + + addr = pci_resource_start(pci, 0); + adata->acp3x_base = ioremap(addr, pci_resource_len(pci, 0)); + if (!adata->acp3x_base) { + ret = -ENOMEM; + goto release_regions; + } + pci_set_master(pci); + pci_set_drvdata(pci, adata); + return 0; + +release_regions: + pci_release_regions(pci); +disable_pci: + pci_disable_device(pci); + + return ret; +} + +static void snd_acp3x_remove(struct pci_dev *pci) +{ + struct acp3x_dev_data *adata = pci_get_drvdata(pci); + + iounmap(adata->acp3x_base); + pci_release_regions(pci); + pci_disable_device(pci); +} + +static const struct pci_device_id snd_acp3x_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x15e2), + .class = PCI_CLASS_MULTIMEDIA_OTHER << 8, + .class_mask = 0xffffff }, + { 0, }, +}; +MODULE_DEVICE_TABLE(pci, snd_acp3x_ids); + +static struct pci_driver acp3x_driver = { + .name = KBUILD_MODNAME, + .id_table = snd_acp3x_ids, + .probe = snd_acp3x_probe, + .remove = snd_acp3x_remove, +}; + +module_pci_driver(acp3x_driver); + +MODULE_AUTHOR("Maruthi.Bayyavarapu@amd.com"); +MODULE_DESCRIPTION("AMD ACP3x PCI driver"); +MODULE_LICENSE("GPL v2"); From patchwork Mon Nov 12 05:34:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10678119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F3A514BA for ; Mon, 12 Nov 2018 05:32:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED91929E28 for ; Mon, 12 Nov 2018 05:31:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE19D29E3A; Mon, 12 Nov 2018 05:31:59 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 D151729E28 for ; Mon, 12 Nov 2018 05:31:58 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A3DB726792F; Mon, 12 Nov 2018 06:31:57 +0100 (CET) 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 3F84F2679FA; Mon, 12 Nov 2018 06:31:55 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0042.outbound.protection.outlook.com [104.47.36.42]) by alsa0.perex.cz (Postfix) with ESMTP id 6010326792F for ; Mon, 12 Nov 2018 06:31:52 +0100 (CET) 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=bBffJfsJJaiX0Y086HQJvkxFmnKgPuRio0+lZc5Hrg4=; b=p4Mg2odV60SDtx/SIx0ejgxZQi9rmDyu+idArdLZs1wKlixGFYf2Dq40aEGYBopOwPVGpuek55x51CBnHQwGWIve9idgCM487OmFauoYRnembET5zw3DQKpNbJ66LbS5avlYgZVeYxAZ6eJ9Bf+7zKRnz3oyuNYGhlsPHNS5lKY= Received: from BN4PR12CA0002.namprd12.prod.outlook.com (2603:10b6:403:2::12) by BLUPR12MB0419.namprd12.prod.outlook.com (2a01:111:e400:516c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Mon, 12 Nov 2018 05:31:48 +0000 Received: from CO1NAM03FT060.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::202) by BN4PR12CA0002.outlook.office365.com (2603:10b6:403:2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.21 via Frontend Transport; Mon, 12 Nov 2018 05:31:48 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT060.mail.protection.outlook.com (10.152.81.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:31:47 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:31:45 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:04:54 +0530 Message-ID: <1542000903-19020-4-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(39860400002)(136003)(376002)(346002)(2980300002)(428003)(189003)(199004)(106466001)(39060400002)(426003)(81166006)(81156014)(16586007)(77096007)(8676002)(48376002)(126002)(476003)(14444005)(47776003)(26005)(72206003)(53416004)(54906003)(36756003)(50466002)(336012)(50226002)(2616005)(105586002)(11346002)(486006)(1671002)(8936002)(478600001)(2906002)(316002)(68736007)(446003)(53936002)(109986005)(97736004)(86362001)(4326008)(7696005)(5660300001)(305945005)(186003)(76176011)(6666004)(356004)(104016004)(51416003)(266003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0419; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT060; 1:WcfurlPpz73Wt1QL9GwKcnwu41FnqWqJ0rbnx8yaTjvzPhtro01luZrY3A7mxDjfwDsA4UdBlXalSn9oPHR4A8bPvi8M+X2oBLacvB188iPNEo1qoPApItDS47MEV6Nd X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e3de877c-9629-4a33-3c4a-08d6486023ff X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:BLUPR12MB0419; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0419; 3:P+v2xRltKnTX9uS1jMA3kFVbat0t91Uq37JZRgn/JxFfb9Tka9JBpxQRhQpNXKu/IT0PFGfsqNJi90y9aUIDeE2yYy11fnu7xGL/mOuq79nRJrEmwrh2INMYpZUp0vdaIErJwzk4I1gvB/audzeICJJNGieR/rB7IbYPwlxRNx13WrLlV+4iBmBQGXhk+eNm1pVS8C3dyUCSVWZ2Mr+Afr7GorT79aMFVZJG+T5oQ49kEFLhh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82IWrFnAoHohJTPA+BUtcYqaaEbkd1/tqn2YFoSFrT9OdQafcjNYI6FHhRStJWIwFVbotZ5RjO1AG3C74YLKq+Xgul2JeSPVy2OQu6qvEU4paLRKWKxvpGelbCOxv/CBl8R3w7bBm7d76/YagPNgsUiD3A1hFU+pYU2MPe39CLTqe6wclxWuql1SRTQrPjIrxhqPGLCP27gJ1DfsExxHpYyut8t1qbdDQSkv5rctU5gfjU2N 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)(8121501046)(5005006)(10201501046)(3231382)(944501410)(52105112)(3002001)(93006095)(93003095)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:BLUPR12MB0419; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0419; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0419; 4:CPNRbmtBziqH1KVMc6v7jCr2siKBgyvfcHX9lNdvuiv7dCuLlDMBw2FLjLbvUXNmIp1o4VTfSYSmnXCznBkM4xyXKo83oV3YE4p5k/9E4PRRsbRAYjXvwawyYnnckQ3a7EwSmlXT+k7R5WaF86nL7OzWw8+w4N+CZHe3YlegWZ2Yu1ZL1namE8n7wISgauiRQYbhwOaj1Szj36+EJE0+BO3RE7VRFhtCaKPhGxlPnHuq6woqJ0PE9UT/opg2XRFyr21U0py5ntAjNtEq9zfZ0CKbnea78+CEI5QtCR5tVnEQbplUbmSxRL1ID0g0IitG X-Forefront-PRVS: 0854128AF0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR12MB0419; 23:v+F00SgcDTD0T+Mg8DFYlkFPMya0v55qgIKpuvmeB?= D9XNwFrWya4065nV55FTbKyN/Orc0/v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OSMGVXrOEtNN9dC+IYvp02htjt55UEjwIC30ebzXmHRumiZUPbab0qs4O04x0IIzFQ+A6Jd2yv5cgAfui+PLZ5AzXOpZV8b/j//wc=; 7:s6Ug/n0rXwelu5RAZ+9wC0EGmw7WAoenQthQRAHrwHunz7VA5hB7+8o2KsxuwpKicjxrtfwEumqoBnKPEbbZzzG9cJjT0C31SCMP0xifMoMa4gOCxokXPw83Fa83VVRWJpZpZI+kUhG69VD63MHUvQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0419; 20:bk3iCCFp1iCPT6pCuSfrLmt3OVz5rBK9a/8shKP4FukBXsPltugPm6sswp054yR8fh9GZ75LtLGqRyFqRN+rdUIgVvfUWGqttkvktyL2XkMlMCHGlC6DEI5Wvie4I1BgwveSN6Jvnb5dfiPm/UZEepMorpuSG+qeVgpARcGy756R/7xWcQsdjCzs4YouMt2f1qk8iYs5dOGNAxU+wzJ8gfqchejJ4efsG4ym+3ikV539F2mOAx2nLDMmncIeEbyR X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:31:47.4056 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3de877c-9629-4a33-3c4a-08d6486023ff 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0419 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Srinivas Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Sanju R Mehta , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 03/11] ASoC: amd: create ACP3x PCM platform device 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 ACP 3x IP has I2S controller device as one of IP blocks. Create a platform device for it, so that the PCM platform driver can be bound to this device. Pass PCI resources like MMIO, irq to the platform device. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/acp3x.h | 4 +++ sound/soc/amd/raven/pci-acp3x.c | 70 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/raven/acp3x.h b/sound/soc/amd/raven/acp3x.h index e9b4df0..83b1ed8 100644 --- a/sound/soc/amd/raven/acp3x.h +++ b/sound/soc/amd/raven/acp3x.h @@ -1,6 +1,10 @@ #include "chip_offset_byte.h" #define ACP3x_PHY_BASE_ADDRESS 0x1240000 +#define ACP3x_I2S_MODE 0 +#define ACP3x_REG_START 0x1240000 +#define ACP3x_REG_END 0x1250200 +#define I2S_MODE 0x04 static inline u32 rv_readl(void __iomem *base_addr) { diff --git a/sound/soc/amd/raven/pci-acp3x.c b/sound/soc/amd/raven/pci-acp3x.c index 27588ed..0700162 100644 --- a/sound/soc/amd/raven/pci-acp3x.c +++ b/sound/soc/amd/raven/pci-acp3x.c @@ -16,19 +16,26 @@ #include #include #include +#include +#include #include "acp3x.h" struct acp3x_dev_data { void __iomem *acp3x_base; + bool acp3x_audio_mode; + struct resource *res; + struct platform_device *pdev; }; static int snd_acp3x_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { int ret; - u32 addr; + u32 addr, val; struct acp3x_dev_data *adata; + struct platform_device_info pdevinfo; + unsigned int irqflags; if (pci_enable_device(pci)) { dev_err(&pci->dev, "pci_enable_device failed\n"); @@ -48,6 +55,15 @@ static int snd_acp3x_probe(struct pci_dev *pci, goto release_regions; } + /* check for msi interrupt support */ + ret = pci_enable_msi(pci); + if (ret) + /* msi is not enabled */ + irqflags = IRQF_SHARED; + else + /* msi is enabled */ + irqflags = 0; + addr = pci_resource_start(pci, 0); adata->acp3x_base = ioremap(addr, pci_resource_len(pci, 0)); if (!adata->acp3x_base) { @@ -56,8 +72,57 @@ static int snd_acp3x_probe(struct pci_dev *pci, } pci_set_master(pci); pci_set_drvdata(pci, adata); + + val = rv_readl(adata->acp3x_base + mmACP_I2S_PIN_CONFIG); + switch (val) { + case I2S_MODE: + adata->res = devm_kzalloc(&pci->dev, + sizeof(struct resource) * 2, + GFP_KERNEL); + if (!adata->res) { + ret = -ENOMEM; + goto unmap_mmio; + } + + adata->res[0].name = "acp3x_i2s_iomem"; + adata->res[0].flags = IORESOURCE_MEM; + adata->res[0].start = addr; + adata->res[0].end = addr + (ACP3x_REG_END - ACP3x_REG_START); + + adata->res[1].name = "acp3x_i2s_irq"; + adata->res[1].flags = IORESOURCE_IRQ; + adata->res[1].start = pci->irq; + adata->res[1].end = pci->irq; + + adata->acp3x_audio_mode = ACP3x_I2S_MODE; + + memset(&pdevinfo, 0, sizeof(pdevinfo)); + pdevinfo.name = "acp3x_rv_i2s"; + pdevinfo.id = 0; + pdevinfo.parent = &pci->dev; + pdevinfo.num_res = 2; + pdevinfo.res = adata->res; + pdevinfo.data = &irqflags; + pdevinfo.size_data = sizeof(irqflags); + + adata->pdev = platform_device_register_full(&pdevinfo); + if (!adata->pdev) { + dev_err(&pci->dev, "cannot register %s device\n", + pdevinfo.name); + ret = -ENODEV; + goto unmap_mmio; + } + break; + default: + dev_err(&pci->dev, "Inavlid ACP audio mode : %d\n", val); + ret = -ENODEV; + goto unmap_mmio; + } return 0; +unmap_mmio: + pci_disable_msi(pci); + iounmap(adata->acp3x_base); release_regions: pci_release_regions(pci); disable_pci: @@ -70,7 +135,10 @@ static void snd_acp3x_remove(struct pci_dev *pci) { struct acp3x_dev_data *adata = pci_get_drvdata(pci); + platform_device_unregister(adata->pdev); iounmap(adata->acp3x_base); + + pci_disable_msi(pci); pci_release_regions(pci); pci_disable_device(pci); } From patchwork Mon Nov 12 05:34:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10678121 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B10614E2 for ; Mon, 12 Nov 2018 05:32:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1775429E28 for ; Mon, 12 Nov 2018 05:32:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AF4A29E3A; Mon, 12 Nov 2018 05:32:18 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 D4C7729E28 for ; Mon, 12 Nov 2018 05:32:16 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9D8FE267A67; Mon, 12 Nov 2018 06:32:15 +0100 (CET) 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 B0D31267A70; Mon, 12 Nov 2018 06:32:13 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-eopbgr740049.outbound.protection.outlook.com [40.107.74.49]) by alsa0.perex.cz (Postfix) with ESMTP id 5D5C12677E4 for ; Mon, 12 Nov 2018 06:32:11 +0100 (CET) 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=si7r9IPs+b9ppnK7NZiu2sONYcqcnOQKd5E4+ZSb7M4=; b=JuYCHrlFNhPa5fyUYJYzkSD3fJZ0RVy1xAVlcfq1OwXwtTj2/allEqkgkfwItW1Aom6T9dcMCEve1g1BXBr9uXc+DlgiNFK4uspbau5a2mgyaHNQx93KSTRAB/vTRY1CeLCunAMaYnPErCoXe+tqqMAXhAIQvwscYgdCNsp8zrY= Received: from SN1PR12CA0093.namprd12.prod.outlook.com (2603:10b6:802:21::28) by CY1PR12MB0425.namprd12.prod.outlook.com (2a01:111:e400:5192::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Mon, 12 Nov 2018 05:32:08 +0000 Received: from CO1NAM03FT041.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::208) by SN1PR12CA0093.outlook.office365.com (2603:10b6:802:21::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.21 via Frontend Transport; Mon, 12 Nov 2018 05:32:07 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT041.mail.protection.outlook.com (10.152.81.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:32:07 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:32:05 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:04:55 +0530 Message-ID: <1542000903-19020-5-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(136003)(396003)(39860400002)(346002)(376002)(2980300002)(428003)(199004)(189003)(105586002)(54906003)(39060400002)(109986005)(77096007)(426003)(316002)(4326008)(16586007)(53936002)(86362001)(50226002)(336012)(81166006)(81156014)(8936002)(106466001)(104016004)(51416003)(26005)(7696005)(8676002)(186003)(76176011)(53416004)(36756003)(97736004)(47776003)(5660300001)(478600001)(72206003)(2906002)(19627235002)(356004)(68736007)(6666004)(14444005)(48376002)(476003)(126002)(2616005)(50466002)(1671002)(305945005)(486006)(446003)(11346002)(266003)(2004002)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0425; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT041; 1:FOh76GAVZfIMforRPBjvDmPMW1T3TsXnuz3ZxAygNvvgzc87Lnj9oRwA6v+CDfQoLyc2FfXdi+gJP0cDEbqThOpBEMD9vyJI8EtRUrMSspz6vQMXzy0znYsgf6/Hyuor X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 752e2bb5-d49f-4648-3fd9-08d648602fbd X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:CY1PR12MB0425; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0425; 3:Xnkq123lYHhTC3cLdHBFdv+GHuX4IvD69tR6PHnWnmZLw3HB35RwO5MFl1eY/8Nr99I9v5bs4OJZKJuE9x+jjRcBg5PISe5/b4k1NJVk2tKvYph0Slpw+/+xSvRD3lcqjws9558z9ZlNuv8Z71gRHbX4fsmQIRXDcfjTS9y74gGo+xi6iV/ljIr/TkNXQmjL2lH/FPDVVn4kt2L2wFv79B68o1bjNxpEyViiFswtpeBVr30Kwu83GXCjIwVN9uXBzbCubTOhSLnPRcixAfRzyF9sSxhSZ68sZ/BQty9VSz1nKQlRGhQgbLy99SLXMSO9B8iMlr0F/4sS0IF4p6LNlMnE6nH7S4QBKcajA567ArI=; 25:S510Mtrf6v3MhMJgPvH/B9L5ePJaZA7DE2QjHVhNPXB1ip9hy8uaTIg38uZQ4PjIWBH23Q8wKPtbJUFnUo2Pu6hlLAJBNjAtuF8c4xZLFWh0fyGCbhc6brxpEQBoRi45eb1l+PXa9ZUNBImHRNpfcLQ04cl2M3Z8tLUKT6WoHpXEYwK4vdDnd0SH73DdLruG6FeXHuSHPwiWTT4ddnkag6MFW+tdEDDq9LJ29WJR8R3fjAO5OJfE13Y9YcRGLEyLfoX06JFhXBkFFb5WUFEXeChb8kzRGOcs+UMCdlVY1R+ScK31ykk6dbMVsYkqngWwGTTQ8TUXxNXIkEXx8yVLfm6wb6EzrfEBN6U311R5aUA= X-MS-TrafficTypeDiagnostic: CY1PR12MB0425: X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0425; 31:13NfIh3crMrtFt2Qs5cnChzwhc3IAvWKs9ndf2jdcnSZbzbeA3UZsVgF+hW0QcNQBvr2GPM0wtX6jv7ZgSFmasWJkJXWMO3Z0kb5f+umPptpdgVEr4am3DdbAFQ8u7TuTi0uPyS8v3wYV7lDEXgQrvyE/F2ShCJrHGM++nlZyIUuWnLb//Joc+JoiOFZqMIQqSK+NtKyKQNiaCHRf1dmmvfq/KpbVBA7lyu0xa0rofI=; 20:TIF2jip28ni1JQpHMTyuKacnKA6Hibn29g+aY5UyNh2vfYMnGLl/EqR/bI/UsgrMkSTDvFWAnFHcIJEcqumIs6wC0YslVgvYqSZeHmudKodMealAgMrWLnlrRLKFYsXx91kU6Q+R8L4Mfxx6c6xjVhrIDXokdb+N7INs9L/C8VK2mbrA5saAaAmaOyefcbmpzeO96XwakIyin9BKTW3GXEWd7hZRJKt/cdy9Tj6C3Z34SMR+yUm53fuOVNbsqxulKkF2cS8j54Sj+NUMGZ/L567YraMvF4/d4i0IgeafJuU5vnedSqEmB8VgsVKAcz75qlySPZ6uCKSEIlOb0QOK+2sA2mjeHPjEl1/gcglGoF16bpJDl+XEvr2Q1KXNnjt8Vpgv8oGnmMcdUeRBjHZWUdtHFiqdyIMarqfll94jgEAES+A29PLEJwNEjKosf7Pbry3U47W/NYgpLuPilU2SNB5J5Zr7ESkJ1PaNSSLRSv6lq684xabu92X3W0dxoSaS 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)(93003095)(3231382)(944501410)(52105112)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:CY1PR12MB0425; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0425; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0425; 4:Sr+s9+yxEM5/v6CDUcMC0N9kHAyDWdp3WtdVmCiG+ZYugzYWI+BGtSSGSRMUDvcV/Oy9Ymf4QRAFFjTQt+vVUe/rj06CS2/jsqIwwJvHIo9NApNYFhZXsWY8HXpNVvAYpyEFPUenSqOwQIQlX6i2PIMb4babxU2JmDfa/7qku9y6sMCZCYqjC/PFGdCuAD1zIciOc3BO7v4EjoUi6zU/S9JqGdhZWcEXG9ZD59drHSPJOTyR7fQS4C6QOaYdCGJ20aklU0mZAOybSpn9tySsOvfvAT7cztSfPJO3kEDAA2f+RHscZ7pzsbd5Xk3CQNSV X-Forefront-PRVS: 0854128AF0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR12MB0425; 23:5lzcserCdiP5yts6UmcoyLraXbFHG0wkxD9V4dqdH?= txikfxBACyxBtzRyW6776sHw4g2ZC8YqKjtXHsUd2SvsYox/x9aT7NprhcocgQATOisMuuPAo/bWxMmrA5kE9D1gng1y6UUee0wwBBGzQeH+Z/4/PBR9BCEQo6iUFYXVEx0ufr9X9eIvGYLcwggbjs6EVPcNwkQIrCI928ospcynunTYuzqGlVxziclckQMn4lTETihAgz8R4e1IzV7seGTXg31+q83+DMLznqzALv8gaKAni3SCiYSHEAe/SRHG2A3OfhT4sDtOUWTL18YJfXGCB0d/5biXikmInSOQCz7p48czVpQiTSCiv44+YGMtWcaGJJBBaVZHP/EozyssVC5gdriaujF4ajQkbTIaq5tCc4FwfnjmOGybq+0Bw8qWeobj39GgtmjghPzRP99yii3nUSnMoAmHoRFM5iH8XlMkeW86nIwpisUi6+SB/Y0TZDVUJHiv6U9fz7ok+CxWDkTwltlqx049hW/LOsQez35uCa6OQEhPYUK18HDYj84PBI95h+hAsS6gimnHbFKuvrqx8PuswEO8oJhyeLur0WMxgyfHp7f1WnNyVjvQiVwFi7jrfmrOACU4fiXeoNQCViaFl4nkTbNUdJ8T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yELqn+k7AGigEEiKYwnBTXP1mrf+V1qH2u9UyCrXnhmdtZqfFf+vEujDVQqSvV9juSujechK X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:32:07.1214 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 752e2bb5-d49f-4648-3fd9-08d648602fbd 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0425 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Sanju R Mehta , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 04/11] ASoC: amd: add ACP3x PCM platform driver 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 PCM platform driver binds to the platform device created by ACP3x PCI device. PCM driver registers ALSA DMA and CPU DAI components with ASoC framework. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/acp3x-pcm-dma.c | 263 ++++++++++++++++++++++++++++++++++++ sound/soc/amd/raven/acp3x.h | 7 + 2 files changed, 270 insertions(+) create mode 100644 sound/soc/amd/raven/acp3x-pcm-dma.c diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c new file mode 100644 index 0000000..3e806f7 --- /dev/null +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -0,0 +1,263 @@ +/* + * AMD ALSA SoC PCM Driver + * + * Copyright 2016 Advanced Micro Devices, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "acp3x.h" + +#define DRV_NAME "acp3x-i2s-audio" + +struct i2s_dev_data { + void __iomem *acp3x_base; + struct snd_pcm_substream *play_stream; + struct snd_pcm_substream *capture_stream; +}; + +static int acp3x_power_on(void __iomem *acp3x_base, bool on) +{ + u16 val, mask; + u32 timeout; + + if (on == true) { + val = 1; + mask = ACP3x_POWER_ON; + } else { + val = 0; + mask = ACP3x_POWER_OFF; + } + + rv_writel(val, acp3x_base + mmACP_PGFSM_CONTROL); + timeout = 0; + while (true) { + val = rv_readl(acp3x_base + mmACP_PGFSM_STATUS); + if ((val & ACP3x_POWER_OFF_IN_PROGRESS) == mask) + break; + if (timeout > 100) { + pr_err("ACP3x power state change failure\n"); + return -ENODEV; + } + timeout++; + cpu_relax(); + } + return 0; +} + +static int acp3x_reset(void __iomem *acp3x_base) +{ + u32 val, timeout; + + rv_writel(1, acp3x_base + mmACP_SOFT_RESET); + timeout = 0; + while (true) { + val = rv_readl(acp3x_base + mmACP_SOFT_RESET); + if ((val & ACP3x_SOFT_RESET__SoftResetAudDone_MASK) || + timeout > 100) { + if (val & ACP3x_SOFT_RESET__SoftResetAudDone_MASK) + break; + return -ENODEV; + } + timeout++; + cpu_relax(); + } + + rv_writel(0, acp3x_base + mmACP_SOFT_RESET); + timeout = 0; + while (true) { + val = rv_readl(acp3x_base + mmACP_SOFT_RESET); + if (!val || timeout > 100) { + if (!val) + break; + return -ENODEV; + } + timeout++; + cpu_relax(); + } + return 0; +} + +static int acp3x_init(void __iomem *acp3x_base) +{ + int ret; + + /* power on */ + ret = acp3x_power_on(acp3x_base, true); + if (ret) { + pr_err("ACP3x power on failed\n"); + return ret; + } + /* Reset */ + ret = acp3x_reset(acp3x_base); + if (ret) { + pr_err("ACP3x reset failed\n"); + return ret; + } + return 0; +} + +static int acp3x_deinit(void __iomem *acp3x_base) +{ + int ret; + + /* Reset */ + ret = acp3x_reset(acp3x_base); + if (ret) { + pr_err("ACP3x reset failed\n"); + return ret; + } + /* power off */ + ret = acp3x_power_on(acp3x_base, false); + if (ret) { + pr_err("ACP3x power off failed\n"); + return ret; + } + return 0; +} + +static struct snd_pcm_ops acp3x_dma_ops = { + .open = NULL, + .close = NULL, + .ioctl = NULL, + .hw_params = NULL, + .hw_free = NULL, + .pointer = NULL, + .mmap = NULL, +}; + +struct snd_soc_dai_ops acp3x_dai_i2s_ops = { + .hw_params = NULL, + .trigger = NULL, + .set_fmt = NULL, +}; + +static struct snd_soc_dai_driver acp3x_i2s_dai_driver = { + .playback = { + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | + SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + + .rate_min = 8000, + .rate_max = 96000, + }, + .capture = { + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | + SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &acp3x_dai_i2s_ops, +}; + +static const struct snd_soc_component_driver acp3x_i2s_component = { + .name = DRV_NAME, + .ops = &acp3x_dma_ops, + .pcm_new = acp3x_dma_new, +}; + +static int acp3x_audio_probe(struct platform_device *pdev) +{ + int status; + struct resource *res; + struct i2s_dev_data *adata; + unsigned int irqflags; + + if (!pdev->dev.platform_data) { + dev_err(&pdev->dev, "platform_data not retrieved\n"); + return -ENODEV; + } + irqflags = *((unsigned int *)(pdev->dev.platform_data)); + + adata = devm_kzalloc(&pdev->dev, sizeof(struct i2s_dev_data), + GFP_KERNEL); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n"); + return -ENODEV; + } + + adata->acp3x_base = devm_ioremap(&pdev->dev, res->start, + resource_size(res)); + + adata->play_stream = NULL; + adata->capture_stream = NULL; + + dev_set_drvdata(&pdev->dev, adata); + /* Initialize ACP */ + status = acp3x_init(adata->acp3x_base); + if (status) + return -ENODEV; + status = devm_snd_soc_register_component(&pdev->dev, + &acp3x_i2s_component, + &acp3x_i2s_dai_driver, 1); + if (status) { + dev_err(&pdev->dev, "Fail to register acp i2s dai\n"); + goto dev_err; + } + + return 0; +dev_err: + status = acp3x_deinit(adata->acp3x_base); + if (status) + dev_err(&pdev->dev, "ACP de-init failed\n"); + else + dev_info(&pdev->dev, "ACP de-initialized\n"); + /*ignore device status and return driver probe error*/ + return -ENODEV; +} + +static int acp3x_audio_remove(struct platform_device *pdev) +{ + int ret; + struct i2s_dev_data *adata = dev_get_drvdata(&pdev->dev); + + ret = acp3x_deinit(adata->acp3x_base); + if (ret) + dev_err(&pdev->dev, "ACP de-init failed\n"); + else + dev_info(&pdev->dev, "ACP de-initialized\n"); + + return 0; +} + +static struct platform_driver acp3x_dma_driver = { + .probe = acp3x_audio_probe, + .remove = acp3x_audio_remove, + .driver = { + .name = "acp3x_rv_i2s", + }, +}; + +module_platform_driver(acp3x_dma_driver); + +MODULE_AUTHOR("Maruthi.Bayyavarapu@amd.com"); +MODULE_AUTHOR("Vijendar.Mukunda@amd.com"); +MODULE_DESCRIPTION("AMD ACP 3.x PCM Driver"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); diff --git a/sound/soc/amd/raven/acp3x.h b/sound/soc/amd/raven/acp3x.h index 83b1ed8..f3d3e51 100644 --- a/sound/soc/amd/raven/acp3x.h +++ b/sound/soc/amd/raven/acp3x.h @@ -5,6 +5,13 @@ #define ACP3x_REG_START 0x1240000 #define ACP3x_REG_END 0x1250200 #define I2S_MODE 0x04 +#define BT_TX_THRESHOLD 26 +#define BT_RX_THRESHOLD 25 +#define ACP3x_POWER_ON 0x00 +#define ACP3x_POWER_ON_IN_PROGRESS 0x01 +#define ACP3x_POWER_OFF 0x02 +#define ACP3x_POWER_OFF_IN_PROGRESS 0x03 +#define ACP3x_SOFT_RESET__SoftResetAudDone_MASK 0x00010001 static inline u32 rv_readl(void __iomem *base_addr) { From patchwork Mon Nov 12 05:34:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10678123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22B9114E2 for ; Mon, 12 Nov 2018 05:32:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DF1829E28 for ; Mon, 12 Nov 2018 05:32:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01AF629E3A; Mon, 12 Nov 2018 05:32:32 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 2AAB829E28 for ; Mon, 12 Nov 2018 05:32:32 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id ECFD1267877; Mon, 12 Nov 2018 06:32:30 +0100 (CET) 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 6AAF12679BF; Mon, 12 Nov 2018 06:32:28 +0100 (CET) Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720045.outbound.protection.outlook.com [40.107.72.45]) by alsa0.perex.cz (Postfix) with ESMTP id 2B94C2677E4 for ; Mon, 12 Nov 2018 06:32:25 +0100 (CET) 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=PdQuaZEB8cz0gE4Syuq6MW7Gc1ACRDPOLc7fCkdv048=; b=ui44BHM7TT5WcJJlnSrh1JvkkLvOzDG1GdS6x96d2b5iF4RUytjYRoQpzxUvDheTglm9fkUsW8a9M7qC+pHggQSW0uVpy5lh7LHGhkKrAVN1T/HAY425+XdwAcvU/R/CgQ6g4OjYhS+6MHCrhMT5nhfHWxU/OOre1x3XQRBNEUM= Received: from MWHPR12CA0071.namprd12.prod.outlook.com (2603:10b6:300:103::33) by DM3PR12MB0746.namprd12.prod.outlook.com (2a01:111:e400:5984::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.23; Mon, 12 Nov 2018 05:32:23 +0000 Received: from CO1NAM03FT056.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::209) by MWHPR12CA0071.outlook.office365.com (2603:10b6:300:103::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.21 via Frontend Transport; Mon, 12 Nov 2018 05:32:23 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT056.mail.protection.outlook.com (10.152.81.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:32:22 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:32:20 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:04:56 +0530 Message-ID: <1542000903-19020-6-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39860400002)(136003)(2980300002)(428003)(189003)(199004)(48376002)(4326008)(426003)(50466002)(14444005)(1671002)(77096007)(54906003)(50226002)(53416004)(104016004)(2616005)(186003)(68736007)(11346002)(26005)(336012)(47776003)(126002)(476003)(486006)(39060400002)(446003)(36756003)(305945005)(8936002)(53936002)(478600001)(16586007)(5660300001)(72206003)(106466001)(7696005)(8676002)(2906002)(6666004)(76176011)(109986005)(316002)(81166006)(51416003)(356004)(105586002)(81156014)(86362001)(97736004)(266003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0746; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT056; 1:6DVMPJwdWrSaBKi1bXiKnVTfaQLKeYz48lSsOZR6x9hGDbwiQc/L1OBGq5tg7QGncW5PoShV99/jixQFXzyh0hgwHJoBCrOJJfoyNWdV561WpcvhHBuUlsgqxuthQ25P X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 78cdf4cc-db45-4d01-512d-08d648603923 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:DM3PR12MB0746; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0746; 3:uX4cM8OOmBnByCOspNHMM3SLEVwk/+LZ3naPXFXup9+4GK7oRE50d9/voOtASXax6dpxTuXMCFHUHWBgYG3erxAJu0AO/186HZRXF6gpJEvg/V9001BnjUcU4LStk5EqLAV+zYQqsY9J1p0EuNBPD+k8+ynbrIt1gV9NfdgCaASqAkmJhiL5tFibBmc6iMMRfSKtqU717ORtPYpzo9ChKNgkdwzyxHjOqp9NvWNhW9t3LhQUUtON8+Y4fG3gDXxGYZMNgzYFTBtvnqbHKAeET4wqmhTdXHu2MnFx7OXf/2cAblmd/Ae0mYsJeuJdyR6OI7pl/mlN4L61pfsU3ReuPyxRiaY/13ib3KVMGCiZ1ss=; 25:JEL3zKjjrFunU3vctxLqy21iWjr1AqyGoMFw4P71/+VCI8WDCpI2AnXAB0ObhZlGuoyDrXHCv+SZwpgLjTiA9s3sr1bYWrmxYt5UELZ2CrFklMgCPp0n/d6Tz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RVS: 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)(10201501046)(3231402)(944501410)(52105112)(93006095)(93003095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:DM3PR12MB0746; BCL:0; PCL:0; RULEID:; SRVR:DM3PR12MB0746; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0746; 4:YB/PcrSxmsNf1/oe+Xv7I/mRfQLbSp2XPb0wSYBMy167AGP9weN6vSAdVy7EQP32ez+wUFJGft8PUTlsADVRrkB0cps+usc4Jhi1N7b/26HvfNHN3wK1OcEWyV4Uz/3oydnA0PRbGqpnnFB0vPkwH3R/Qv3tqi3RiDTyJjdG2lfqUtlngeG12xAyDGWOw4zuRuCt+e9a4yQvBVLuP8NJ55osx2DJYgYehNt5/tHdLYHln3ivcjL2HRBVkX8x9LIK2M3z56OqPZhc1yESnCI9AEPmRubbHY3Bf47yimymOdQr42/whysmQjkn2ulItUqp X-Forefront-PRVS: 0854128AF0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR12MB0746; 23:nlaabZV9rOQ3Syb4+g0MmUSJDyd4Wio31N2wIbM27?= RQt2niMr3m5k4oCvI6+nG35KpJ4kqjjFkaoYK7nrMB3BRd7DR7TveRfzqFM5WLet36SJVZoZH2OXb4rZKGg6TzlbfnrEVeH9GeNP5Pj9r+wozY5X8+5jeBLR51fiBIYZ/5NBpM59zR5PgzjxFcubTKoz3RcA9xhEsNG5xctAsFOx7lnFxARAdcB30Zg2Kt6omK71ict8VkKu3yu5Tm/APRqhFZpulSFOMScPlvdu2MI2j8QM1Gja3Jf8vjPrxZ8vMmMCziL3H9CnGG3edtg4CXozR6iW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A== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0746; 20:TSsvFfuUj0iock4RmiVM70DH26NPDX0xoUGDbFetah0yUvSARz2zsw7lZTFGhOPHttn/kC5TVJJELyocDaOJGdY13C519YPSAIkI5LFIhW7EJ2i4t13IOrsdLEm51Xi3wgQfy579pU+9jR0nWW88CwehaoKrul2350W1PT7QF5lMlaL8914xCNNhB9Njj+NIn3AyaXbbz0V933LVEQeoD1i/mKm3xr0mIDWt51er8R+D4E4jF2dTrZcxS4YL5nXG X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:32:22.8429 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78cdf4cc-db45-4d01-512d-08d648603923 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB0746 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 05/11] ASoC: amd: Interrupt handler changes for ACP3x DMA driver 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 Whenever audio data equal to the I2S FIFO watermark level are produced/consumed, interrupt is generated. Acknowledge the interrupt. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/acp3x-pcm-dma.c | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index 3e806f7..94f915a 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -27,6 +27,7 @@ #define DRV_NAME "acp3x-i2s-audio" struct i2s_dev_data { + unsigned int i2s_irq; void __iomem *acp3x_base; struct snd_pcm_substream *play_stream; struct snd_pcm_substream *capture_stream; @@ -132,6 +133,38 @@ static int acp3x_deinit(void __iomem *acp3x_base) return 0; } +static irqreturn_t i2s_irq_handler(int irq, void *dev_id) +{ + u16 play_flag, cap_flag; + u32 val; + struct i2s_dev_data *rv_i2s_data = dev_id; + + if (!rv_i2s_data) + return IRQ_NONE; + + play_flag = 0; + cap_flag = 0; + val = rv_readl(rv_i2s_data->acp3x_base + mmACP_EXTERNAL_INTR_STAT); + if ((val & BIT(BT_TX_THRESHOLD)) && rv_i2s_data->play_stream) { + rv_writel(BIT(BT_TX_THRESHOLD), rv_i2s_data->acp3x_base + + mmACP_EXTERNAL_INTR_STAT); + snd_pcm_period_elapsed(rv_i2s_data->play_stream); + play_flag = 1; + } + + if ((val & BIT(BT_RX_THRESHOLD)) && rv_i2s_data->capture_stream) { + rv_writel(BIT(BT_RX_THRESHOLD), rv_i2s_data->acp3x_base + + mmACP_EXTERNAL_INTR_STAT); + snd_pcm_period_elapsed(rv_i2s_data->capture_stream); + cap_flag = 1; + } + + if (play_flag | cap_flag) + return IRQ_HANDLED; + else + return IRQ_NONE; +} + static struct snd_pcm_ops acp3x_dma_ops = { .open = NULL, .close = NULL, @@ -205,6 +238,13 @@ static int acp3x_audio_probe(struct platform_device *pdev) adata->acp3x_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n"); + return -ENODEV; + } + + adata->i2s_irq = res->start; adata->play_stream = NULL; adata->capture_stream = NULL; @@ -220,6 +260,12 @@ static int acp3x_audio_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Fail to register acp i2s dai\n"); goto dev_err; } + status = devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler, + irqflags, "ACP3x_I2S_IRQ", adata); + if (status) { + dev_err(&pdev->dev, "ACP3x I2S IRQ request failed\n"); + goto dev_err; + } return 0; dev_err: From patchwork Mon Nov 12 05:34:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10678125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 993FE14BA for ; Mon, 12 Nov 2018 05:32:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83C4529E28 for ; Mon, 12 Nov 2018 05:32:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7526A29E3A; Mon, 12 Nov 2018 05:32:51 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 2D80429E28 for ; Mon, 12 Nov 2018 05:32:50 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 04EA926792F; Mon, 12 Nov 2018 06:32:49 +0100 (CET) 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 8DA0C267A7E; Mon, 12 Nov 2018 06:32:46 +0100 (CET) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-eopbgr810058.outbound.protection.outlook.com [40.107.81.58]) by alsa0.perex.cz (Postfix) with ESMTP id 0FC7F2677E4 for ; Mon, 12 Nov 2018 06:32:43 +0100 (CET) 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=Tp7HEclraTkGRT3T+PPVhue20IIJzbgWXrHx5uEldTs=; b=cz3HfFrz2O2gEa/cDfOc5L6DsmSphpVaVA84VKyXgJdeWc/Z/iIMQeaCTHWZ4XVtxS/Oi/2An6NZ6TFmdW7LNMdoEC+fMMT1jOZYak3Vr6Yvsg0m6SgOEBXfjSj6XY6Yaxx15zZ9nb1NmVbyvFz2Sb3Y3UucXdyPuTEP+58B+n8= Received: from BN6PR1201CA0010.namprd12.prod.outlook.com (2603:10b6:405:4c::20) by CY1PR12MB0618.namprd12.prod.outlook.com (2a01:111:e400:c43c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.20; Mon, 12 Nov 2018 05:32:41 +0000 Received: from CO1NAM03FT026.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::201) by BN6PR1201CA0010.outlook.office365.com (2603:10b6:405:4c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.21 via Frontend Transport; Mon, 12 Nov 2018 05:32:40 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT026.mail.protection.outlook.com (10.152.80.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:32:39 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:32:37 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:04:57 +0530 Message-ID: <1542000903-19020-7-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(428003)(199004)(189003)(81166006)(8676002)(81156014)(8936002)(68736007)(47776003)(50226002)(106466001)(72206003)(39060400002)(305945005)(2906002)(6666004)(104016004)(356004)(36756003)(76176011)(11346002)(5660300001)(478600001)(426003)(1671002)(336012)(186003)(26005)(126002)(53416004)(50466002)(77096007)(14444005)(48376002)(7696005)(51416003)(86362001)(19627235002)(476003)(2616005)(53936002)(105586002)(16586007)(316002)(54906003)(446003)(4326008)(97736004)(109986005)(486006)(42413003)(266003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0618; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT026; 1:uNnbUqtQaYBzPoIEW6J3bmxflO823VTG5WIRdeVCRyL2jTLg5CUnQ09VHk0XtfQ9Bcoui4d5IxkTSGGkQMS8SsTxYve8JqVObnzNZXdyJDCiKfiSPQ+7glyneSu+KaEa X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0efa729d-1f70-46b3-6b80-08d648604317 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:CY1PR12MB0618; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0618; 3:lr2h+4rVFHdQBUkX6NxA2XSGjnQ/ktHkCZRjLhctoiAmVaZDHZNGD8TmFGUX876IcrjAPr3ffQbkTw8XDmwLL4RLFwcH3mcoNgjTyNCLLlDzEj/eO+nyGLhqqCm2HrQL0L4XiPTxzmMMf1FeHPZNUv/rHTpEo/+SWkov3GaNe86bgHKHy7AJTo33eWbSiA5k+PvCWx1lvVPoE5J8k24G0N8pSvwt1FlEojF8zFJ8vC2bw0J7z92DmIKB5oKv7ycLWwWpg+yimfNDXu38U95JUJzpZrHCSz/AioWHzVxJPCGnnRVngPcde9uvvvSpX6MUiS066AoF9kTOegLJLi9Y5F+M8kjGg62LFtXlqTZXFhc=; 25:Syg7H4QyZR8CxVzh7jv27XvvHwYhUEzwTVM1Kn2w7rHNWN82jyHFfRuHkEZxd+jbD6TtAtoHfYqYZ6wIup4C0PNFAVoVzNUbEH3jdXR7bWFGQRWQgxd8ubC1RvLaUny9yd4hHXKAubkcmWZZvM0jVFx3u48u+nscFVDApm64oQFJOpoQtiFxWUAdN2zg9/jutwkKKuZijl+N8Zh+qLpozT9W6ZVuVI6x6H8LfCAF/o0GcrOZ6VFSW+VAU0c5D/DCkrBfFd2vJPHpZy/vgZevvUyRg51Hl2W0TRH9gyGHewm61ZZQ60LDv3YZN8xMKPLnjTvkRg1nolsdviKrJDuRK15wOkUpdCbQk7GwDOk3Lq8= X-MS-TrafficTypeDiagnostic: CY1PR12MB0618: X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0618; 31:GAwdYL6eh/zOR1ZewkJadyTK0mnhHKIgI+lLk838NP2h+Z2i3wuvlTkKQOEvOBkPnO6kxs1jMbvSVlz0eqo/cD1QlqIrR+BfbsISpLDQR4jJ1a1vEsU9gYK3wjAiby1/YbeaaYJw2r4FdV0I0TwH7Ph4xK0rZYGFlCjaTeJkfXR4wyaN1qF3gIzodq2iAd4XsigPMcvD3HAhIg1q7Tx04YwpcYzAsM0yXbpHQUV5eeA=; 20:OjTme/FI9Bi6SqCoPUOqxTLBqgNBRhOI+xRoYT72qecPdugzOO7sxGUYX22H5AIJ8x0HYXJNeC9Y02KBVUY2YDj69c6/rc8mYkJpHz9+RdTdcraTZ4MJPF/xBvya2cHhTaCBFDwjusAXT2iA3UhfJO/u9HpLQg8Ln2eNpTJF24uEVq1G5H1A74ect2bcf0W1zUsxd0Zy/ak9NR4NiLVvk9K2dkJSYkVZ46p+DrtnhDQrc6in7dzH5EYJmPv1LDTZeQu136JMq7D24haFwHWem2ryoHB2F/MGQU0zww8wcsP1zwngTHh/Fkhg9cEWjXv+oHUIwtRhvB/SPmPQVY2D/p0JAD5Y7Yl6FDAXwrV0+/TnaxgvVajUU9ZiQWgUmGYWsLcQdvihJ3rQIv+f5ieNYKd7/VS1mocf0XVtaS9OE+drUjAf37ON0quouemxjrrO9ongrGcrRZu2LenXCJMkW59UG93hx3/DEqo5H/Lnz1Rwz9X94yeeJaB+8LSwWiVo 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)(3231402)(944501410)(52105112)(93006095)(93003095)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:CY1PR12MB0618; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0618; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0618; 4:a6VmfmOb9/BmntC0c+d+apAwbOxcFJiDAL81H7r0SxLPH0pkkXEGCtK+vDb4BkgIcMNslEQINXHrExsINO/Go0yWTJTNoY69KrOBJ8hXxaZqRutb00zq+c118lM/SCAIp3S6ekwiFFJ2Elf96zu6z0on/6hV+e4sbBj7b5NASTXYj6TqNiK4Oi0ca9oHoS0AXUSIxhqLR4rXjzoCQgiP6G/yZS2QYP377WXqlLAyBzMXN6syM7I7WPPImCI8loHUwqljbuyDJwjXSSDYwcZKwe31FdJeTq0ky3nfKxY5ryawxe0ZRodSc7X2rM+TqBai X-Forefront-PRVS: 0854128AF0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR12MB0618; 23:807sKDs6OjQVdpfq5UVp9KZCgKMj8e4WhGBPiCkF2?= kQTo8wmfv2kb3I3w+1scsu4l4Yfb+2V50EpqV748fJIaxyLXlNbY9ZXK9QiiY8N8jQ29+rRX7HpB5xBE6HR0+cAAmi4eBMQB+YJNduE8ZhTjH8Yi7e4+OocFhF38P6LfBoXOPwUOLbfczA36y3aGFmy8gXSVU1IWLXedVvwwHeSD2ocLKnMiVukW5hqQ7R4gJsn3fcLa3RrCatNEYqM0gGzn23gxRQhvVpwYEOkChn0p5voH+NOFqJ9ZVWHl0ULa/pwfQayQm4WjuVr0MLWECoJo5oziC24dj6yB4nrLQ7g8Wp9SCZvM5seuEwlmfheP8DK2s8I9DKdjruTIGjsW0KNouJOsPRGc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6Kdb5ew== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0618; 20:ZsY784dDjUmb+nH1olUiveNy7mMdrQU6jTCj+aR/jMxWptAGWFNLcxi7xCjtmOdJphF9MixYF/30/zdn8eBJd7WRGiyT/UWn7tAV4AQNboW77C8nqqwLMwtsA6B3FH9euvklA6qngbIJRrigh1P2j5ak/76DWPISbXZxCUVjg7Wlr8DPzoXXCRF+y8dwtZwl/lEg5P4IZrfko8Kr/fi1Wmsx5mdh95W19DQKgntU2hX4VmIGzTEPRZOtluf5l2Kh X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:32:39.4797 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0efa729d-1f70-46b3-6b80-08d648604317 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0618 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Sanju R Mehta , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 06/11] ASoC: amd: add acp3x pcm driver dma ops 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 ACP3x has a DMA controller to access system memory. This controller transfers data from/to system memory to/from the ACP internal FIFO. The patch adds PCM driver DMA operations. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/acp3x-pcm-dma.c | 262 +++++++++++++++++++++++++++++++++++- sound/soc/amd/raven/acp3x.h | 20 +++ 2 files changed, 275 insertions(+), 7 deletions(-) diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index 94f915a..06c1985 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -33,6 +33,54 @@ struct i2s_dev_data { struct snd_pcm_substream *capture_stream; }; +struct i2s_stream_instance { + u16 num_pages; + u16 channels; + u32 xfer_resolution; + struct page *pg; + void __iomem *acp3x_base; +}; + +static const struct snd_pcm_hardware acp3x_pcm_hardware_playback = { + .info = SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_BATCH | + SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rates = SNDRV_PCM_RATE_8000_96000, + .rate_min = 8000, + .rate_max = 96000, + .buffer_bytes_max = PLAYBACK_MAX_NUM_PERIODS * PLAYBACK_MAX_PERIOD_SIZE, + .period_bytes_min = PLAYBACK_MIN_PERIOD_SIZE, + .period_bytes_max = PLAYBACK_MAX_PERIOD_SIZE, + .periods_min = PLAYBACK_MIN_NUM_PERIODS, + .periods_max = PLAYBACK_MAX_NUM_PERIODS, +}; + +static const struct snd_pcm_hardware acp3x_pcm_hardware_capture = { + .info = SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_BATCH | + SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_8000_48000, + .rate_min = 8000, + .rate_max = 48000, + .buffer_bytes_max = CAPTURE_MAX_NUM_PERIODS * CAPTURE_MAX_PERIOD_SIZE, + .period_bytes_min = CAPTURE_MIN_PERIOD_SIZE, + .period_bytes_max = CAPTURE_MAX_PERIOD_SIZE, + .periods_min = CAPTURE_MIN_NUM_PERIODS, + .periods_max = CAPTURE_MAX_NUM_PERIODS, +}; + static int acp3x_power_on(void __iomem *acp3x_base, bool on) { u16 val, mask; @@ -165,14 +213,214 @@ static irqreturn_t i2s_irq_handler(int irq, void *dev_id) return IRQ_NONE; } +static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction) +{ + u16 page_idx; + u64 addr; + u32 low, high, val, acp_fifo_addr; + struct page *pg = rtd->pg; + + /* 8 scratch registers used to map one 64 bit address */ + if (direction == SNDRV_PCM_STREAM_PLAYBACK) + val = 0; + else + val = rtd->num_pages * 8; + + /* Group Enable */ + rv_writel(ACP_SRAM_PTE_OFFSET | BIT(31), rtd->acp3x_base + + mmACPAXI2AXI_ATU_BASE_ADDR_GRP_1); + rv_writel(PAGE_SIZE_4K_ENABLE, rtd->acp3x_base + + mmACPAXI2AXI_ATU_PAGE_SIZE_GRP_1); + + for (page_idx = 0; page_idx < rtd->num_pages; page_idx++) { + /* Load the low address of page int ACP SRAM through SRBM */ + addr = page_to_phys(pg); + low = lower_32_bits(addr); + high = upper_32_bits(addr); + + rv_writel(low, rtd->acp3x_base + mmACP_SCRATCH_REG_0 + val); + high |= BIT(31); + rv_writel(high, rtd->acp3x_base + mmACP_SCRATCH_REG_0 + val + + 4); + /* Move to next physically contiguos page */ + val += 8; + pg++; + } + + if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + /* Config ringbuffer */ + rv_writel(MEM_WINDOW_START, rtd->acp3x_base + + mmACP_BT_TX_RINGBUFADDR); + rv_writel(MAX_BUFFER, rtd->acp3x_base + + mmACP_BT_TX_RINGBUFSIZE); + rv_writel(DMA_SIZE, rtd->acp3x_base + mmACP_BT_TX_DMA_SIZE); + + /* Config audio fifo */ + acp_fifo_addr = ACP_SRAM_PTE_OFFSET + (rtd->num_pages * 8) + + PLAYBACK_FIFO_ADDR_OFFSET; + rv_writel(acp_fifo_addr, rtd->acp3x_base + + mmACP_BT_TX_FIFOADDR); + rv_writel(FIFO_SIZE, rtd->acp3x_base + mmACP_BT_TX_FIFOSIZE); + } else { + /* Config ringbuffer */ + rv_writel(MEM_WINDOW_START + MAX_BUFFER, rtd->acp3x_base + + mmACP_BT_RX_RINGBUFADDR); + rv_writel(MAX_BUFFER, rtd->acp3x_base + + mmACP_BT_RX_RINGBUFSIZE); + rv_writel(DMA_SIZE, rtd->acp3x_base + mmACP_BT_RX_DMA_SIZE); + + /* Config audio fifo */ + acp_fifo_addr = ACP_SRAM_PTE_OFFSET + + (rtd->num_pages * 8) + CAPTURE_FIFO_ADDR_OFFSET; + rv_writel(acp_fifo_addr, rtd->acp3x_base + + mmACP_BT_RX_FIFOADDR); + rv_writel(FIFO_SIZE, rtd->acp3x_base + mmACP_BT_RX_FIFOSIZE); + } + + /* Enable watermark/period interrupt to host */ + rv_writel(BIT(BT_TX_THRESHOLD) | BIT(BT_RX_THRESHOLD), + rtd->acp3x_base + mmACP_EXTERNAL_INTR_CNTL); +} + +static int acp3x_dma_open(struct snd_pcm_substream *substream) +{ + int ret = 0; + + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_soc_pcm_runtime *prtd = substream->private_data; + struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, + DRV_NAME); + struct i2s_dev_data *adata = dev_get_drvdata(component->dev); + + struct i2s_stream_instance *i2s_data = kzalloc(sizeof(struct i2s_stream_instance), + GFP_KERNEL); + if (!i2s_data) + return -EINVAL; + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + runtime->hw = acp3x_pcm_hardware_playback; + else + runtime->hw = acp3x_pcm_hardware_capture; + + ret = snd_pcm_hw_constraint_integer(runtime, + SNDRV_PCM_HW_PARAM_PERIODS); + if (ret < 0) { + dev_err(component->dev, "set integer constraint failed\n"); + return ret; + } + + if (!adata->play_stream && !adata->capture_stream) + rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + adata->play_stream = substream; + else + adata->capture_stream = substream; + + i2s_data->acp3x_base = adata->acp3x_base; + runtime->private_data = i2s_data; + return 0; +} + +static int acp3x_dma_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + int status; + u64 size; + struct snd_dma_buffer *dma_buffer; + struct page *pg; + struct snd_pcm_runtime *runtime = substream->runtime; + struct i2s_stream_instance *rtd = runtime->private_data; + + if (!rtd) + return -EINVAL; + + dma_buffer = &substream->dma_buffer; + size = params_buffer_bytes(params); + status = snd_pcm_lib_malloc_pages(substream, size); + if (status < 0) + return status; + + memset(substream->runtime->dma_area, 0, params_buffer_bytes(params)); + pg = virt_to_page(substream->dma_buffer.area); + if (pg) { + rtd->pg = pg; + rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); + config_acp3x_dma(rtd, substream->stream); + status = 0; + } else { + status = -ENOMEM; + } + return status; +} + +static snd_pcm_uframes_t acp3x_dma_pointer(struct snd_pcm_substream *substream) +{ + u32 pos = 0; + struct i2s_stream_instance *rtd = substream->runtime->private_data; + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + pos = rv_readl(rtd->acp3x_base + + mmACP_BT_TX_LINKPOSITIONCNTR); + else + pos = rv_readl(rtd->acp3x_base + + mmACP_BT_RX_LINKPOSITIONCNTR); + + if (pos >= MAX_BUFFER) + pos = 0; + + return bytes_to_frames(substream->runtime, pos); +} + +static int acp3x_dma_new(struct snd_soc_pcm_runtime *rtd) +{ + return snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, + SNDRV_DMA_TYPE_DEV, + NULL, MIN_BUFFER, + MAX_BUFFER); +} + +static int acp3x_dma_hw_free(struct snd_pcm_substream *substream) +{ + return snd_pcm_lib_free_pages(substream); +} + +static int acp3x_dma_mmap(struct snd_pcm_substream *substream, + struct vm_area_struct *vma) +{ + return snd_pcm_lib_default_mmap(substream, vma); +} + +static int acp3x_dma_close(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *prtd = substream->private_data; + struct i2s_stream_instance *rtd = substream->runtime->private_data; + struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, + DRV_NAME); + struct i2s_dev_data *adata = dev_get_drvdata(component->dev); + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + adata->play_stream = NULL; + else + adata->capture_stream = NULL; + + /* Disable ACP irq, when the current stream is being closed and + * another stream is also not active. + */ + if (!adata->play_stream && !adata->capture_stream) + rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); + kfree(rtd); + return 0; +} + static struct snd_pcm_ops acp3x_dma_ops = { - .open = NULL, - .close = NULL, - .ioctl = NULL, - .hw_params = NULL, - .hw_free = NULL, - .pointer = NULL, - .mmap = NULL, + .open = acp3x_dma_open, + .close = acp3x_dma_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = acp3x_dma_hw_params, + .hw_free = acp3x_dma_hw_free, + .pointer = acp3x_dma_pointer, + .mmap = acp3x_dma_mmap, }; struct snd_soc_dai_ops acp3x_dai_i2s_ops = { diff --git a/sound/soc/amd/raven/acp3x.h b/sound/soc/amd/raven/acp3x.h index f3d3e51..9f33e34 100644 --- a/sound/soc/amd/raven/acp3x.h +++ b/sound/soc/amd/raven/acp3x.h @@ -13,6 +13,26 @@ #define ACP3x_POWER_OFF_IN_PROGRESS 0x03 #define ACP3x_SOFT_RESET__SoftResetAudDone_MASK 0x00010001 +#define ACP_SRAM_PTE_OFFSET 0x02050000 +#define PAGE_SIZE_4K_ENABLE 0x2 +#define MEM_WINDOW_START 0x4000000 +#define PLAYBACK_FIFO_ADDR_OFFSET 0x400 +#define CAPTURE_FIFO_ADDR_OFFSET 0x500 + +#define PLAYBACK_MIN_NUM_PERIODS 2 +#define PLAYBACK_MAX_NUM_PERIODS 8 +#define PLAYBACK_MAX_PERIOD_SIZE 16384 +#define PLAYBACK_MIN_PERIOD_SIZE 4096 +#define CAPTURE_MIN_NUM_PERIODS 2 +#define CAPTURE_MAX_NUM_PERIODS 8 +#define CAPTURE_MAX_PERIOD_SIZE 16384 +#define CAPTURE_MIN_PERIOD_SIZE 4096 + +#define MAX_BUFFER (PLAYBACK_MAX_PERIOD_SIZE * PLAYBACK_MAX_NUM_PERIODS) +#define MIN_BUFFER MAX_BUFFER +#define FIFO_SIZE 0x100 +#define DMA_SIZE 0x40 + static inline u32 rv_readl(void __iomem *base_addr) { return readl(base_addr - ACP3x_PHY_BASE_ADDRESS); From patchwork Mon Nov 12 05:34:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10678127 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99F3A14BA for ; Mon, 12 Nov 2018 05:33:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8786429E28 for ; Mon, 12 Nov 2018 05:33:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79C7D29E3A; Mon, 12 Nov 2018 05:33:04 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 7A38D29E28 for ; Mon, 12 Nov 2018 05:33:03 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5046D2679BF; Mon, 12 Nov 2018 06:33:02 +0100 (CET) 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 C465A267A67; Mon, 12 Nov 2018 06:33:00 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0044.outbound.protection.outlook.com [104.47.36.44]) by alsa0.perex.cz (Postfix) with ESMTP id C07B92677E4 for ; Mon, 12 Nov 2018 06:32:58 +0100 (CET) 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=Zr/J4DlQESVu3gvUVbV04lhjVZtlgjS2VLwWFICoKFo=; b=Semk9Wi8axzUVoDIsy5gPIwj4MS8g4xte1XbIhgmXDmg3y3dM+SrIVbwTgEnVsOEF9ZRgnehzkWV9nZXVZM6ZQrLUgBoZDnsc55jR1XMm4a4/ecPCCmvfr5A0mylq5NwbXTwKg9tlOMRzyIHI3/THcts7J5CrEB1xHXJZaGuwCk= Received: from BN6PR12CA0026.namprd12.prod.outlook.com (2603:10b6:405:70::12) by DM3PR12MB0747.namprd12.prod.outlook.com (2a01:111:e400:5984::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Mon, 12 Nov 2018 05:32:56 +0000 Received: from CO1NAM03FT004.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::207) by BN6PR12CA0026.outlook.office365.com (2603:10b6:405:70::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.26 via Frontend Transport; Mon, 12 Nov 2018 05:32:55 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT004.mail.protection.outlook.com (10.152.80.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:32:54 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:32:52 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:04:58 +0530 Message-ID: <1542000903-19020-8-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(428003)(199004)(189003)(446003)(53416004)(305945005)(109986005)(50466002)(105586002)(106466001)(1671002)(36756003)(48376002)(54906003)(8676002)(14444005)(50226002)(8936002)(81156014)(81166006)(11346002)(16586007)(336012)(26005)(356004)(77096007)(53936002)(316002)(5660300001)(68736007)(4326008)(51416003)(426003)(39060400002)(7696005)(47776003)(104016004)(186003)(76176011)(86362001)(126002)(486006)(2906002)(2616005)(478600001)(476003)(72206003)(97736004)(42413003)(266003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0747; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT004; 1:3h/ULVYuUXzWWkBMfCmHsPnRDMAahabhzTfH99fSWdLr6ql9KWJPFgVBCyTYf1EDaZTrXPmv/4hf0qbuqoP+MzkdOwd16oYrXEs4OMv4s8JaCrVhF5KofWBiLi7xwoZH X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 498ca6b4-a9ad-4e41-f547-08d648604be2 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:DM3PR12MB0747; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0747; 3:1hGJroeFUpunIG+PAkNQuRfm9/xujjmW1Mg8M4DR08kTSyXtJp4yhbbg4a6wDI7q4EXpXL6hf+aqmrDXaIw+Xxpc12vDwggSfF/7cDlOC6BNJkuFTPCgYmUUlcyFwlFqZzKMg2c8Zjfobv2UghAUx/5UuxoYRi/Rp8Fmh7YTmWol8S5pOAtdn3RH0VravH+Eo5oFPsNMUoP2Jhpz4ihoLL1MNHfnUEVwYJqBtru/Z2wsYknvVhXh0mA+L5YXTTh8ybSx3ih6iFKBulzayU3vbTo+bo2plyrwKlpdlHZUTXhmUbnrFhpmKu6B/Fw0W0LIT8kVPMZImv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ZPLvyYJr5ZpIQF51xg6Flgz4sR5nuYrVX8zATCTbhWPQAZMoKIrek4mowzycGFzuVmAHhOCg4LizLnniJVB28WimJH4ZT/ZTKDV1TgwXF4tFr/UGBWfsJjCFkRtx3P8+2L/16FiGDfmGgP 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)(3231382)(944501410)(52105112)(93006095)(93003095)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:DM3PR12MB0747; BCL:0; PCL:0; RULEID:; SRVR:DM3PR12MB0747; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0747; 4:d5WGLjk/kQFVK6YfEsaxIygHIZagBokOZmQ9KKPKAEjOv5J8WBPwPRHW9vXelSAwqKSd1mVqI3OACVitYNWEOlkWyXJxYRn7/iRhuu6yM0VEzWqsjJ3+Jt4o3jSMWUCA90jw2AxVjiHfFgBWjloQrxIzIkzVeWR7xoyhtw9PrRx+V9JLBhh3RXBzn3s/6iTHr9/tEMJwwNqOnRzM8S2YXgfb3nbrnR+uSY8S/uRqQin7oESkXLKk6TBsBG+7g3uxjV5Qo96fpvyYxreYNjdojNlRy5CZAEH5YY4ZhLg+HNXH8KTeE9RImgG+RPH6e7vy X-Forefront-PRVS: 0854128AF0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR12MB0747; 23:Ti9W78MCadekB5Lk9K57MISOlI4I3IG8WosHfI6L7?= w0ARLUmMAMaU7mMkZaRw+PUXntGyVpbVZNvnf1QShv+udvJHB/k1BmskrZUAG2OllzYMxyQBo7gUy2EYwFTvzxQdfstE5PrRKMLuVwHiPq+0Ri8uxAL32CO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s2KA8hvT0IYPxpZtV2WMAQ/Cj1bvaJlBvqQ/8Gr3y5HxGdipIaV38=; 7:+ZfU7rNzVO1yEn1nv3xQEiN+ZZrDapyaMmrsYTegmPTfL7efq5iJ1ELEEM0JpddxyuzsCA8QSBDrfyzdbotScrT4BHLeofxahBojvfONnJDma4Uum0UY8nop0276dumlqIXWKzenfo7YquGrDPnt/Q== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0747; 20:8PEcQkY3d4FoV5NEUZVyZSUSBsixdEKWwgqUCThl5HkvM514s0ej5U110PtAaz3NNdXN233KJjC3bqyRZGvtZtC1zMw1ZAdmv8MeRhIf5ipfFl1Sbb+06cs40Tm1g9+KDO0CUCYAKvVmBQaN5282OYEP4ue/2yFWwYSB3nW/NUQy9t38iWFmR/UpMuztgtNZS6nAIBpADHxqqjF7MMThjnQrgrze48Bz0Z8ywxNymFj3iXZsUg3TavPUaUEhH+9N X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:32:54.3447 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 498ca6b4-a9ad-4e41-f547-08d648604be2 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB0747 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 07/11] ASoC: amd: add acp3x i2s ops 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 ACP3x has a i2s controller block for playback and capture. This patch adds ACP3x i2s DAI operations. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/acp3x-pcm-dma.c | 89 +++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index 06c1985..ed2c163 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -423,10 +423,93 @@ static struct snd_pcm_ops acp3x_dma_ops = { .mmap = acp3x_dma_mmap, }; +static int acp3x_dai_i2s_hwparams(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params, + struct snd_soc_dai *dai) +{ + u32 val = 0; + struct i2s_stream_instance *rtd = substream->runtime->private_data; + + switch (params_format(params)) { + case SNDRV_PCM_FORMAT_U8: + case SNDRV_PCM_FORMAT_S8: + rtd->xfer_resolution = 0x0; + break; + case SNDRV_PCM_FORMAT_S16_LE: + rtd->xfer_resolution = 0x02; + break; + case SNDRV_PCM_FORMAT_S24_LE: + rtd->xfer_resolution = 0x04; + break; + case SNDRV_PCM_FORMAT_S32_LE: + rtd->xfer_resolution = 0x05; + break; + default: + return -EINVAL; + } + val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_ITER); + val = val | (rtd->xfer_resolution << 3); + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_ITER); + else + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_IRER); + + return 0; +} + +static int acp3x_dai_i2s_trigger(struct snd_pcm_substream *substream, + int cmd, struct snd_soc_dai *dai) +{ + int ret = 0; + struct i2s_stream_instance *rtd = substream->runtime->private_data; + u32 val, period_bytes; + + period_bytes = frames_to_bytes(substream->runtime, + substream->runtime->period_size); + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + rv_writel(period_bytes, rtd->acp3x_base + + mmACP_BT_TX_INTR_WATERMARK_SIZE); + val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_ITER); + val = val | BIT(0); + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_ITER); + } else { + rv_writel(period_bytes, rtd->acp3x_base + + mmACP_BT_RX_INTR_WATERMARK_SIZE); + val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_IRER); + val = val | BIT(0); + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_IRER); + } + rv_writel(1, rtd->acp3x_base + mmACP_BTTDM_IER); + break; + case SNDRV_PCM_TRIGGER_STOP: + case SNDRV_PCM_TRIGGER_SUSPEND: + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_ITER); + val = val & ~BIT(0); + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_ITER); + } else { + val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_IRER); + val = val & ~BIT(0); + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_IRER); + } + rv_writel(0, rtd->acp3x_base + mmACP_BTTDM_IER); + break; + default: + ret = -EINVAL; + break; + } + + return ret; +} + struct snd_soc_dai_ops acp3x_dai_i2s_ops = { - .hw_params = NULL, - .trigger = NULL, - .set_fmt = NULL, + .hw_params = acp3x_dai_i2s_hwparams, + .trigger = acp3x_dai_i2s_trigger, }; static struct snd_soc_dai_driver acp3x_i2s_dai_driver = { From patchwork Mon Nov 12 05:34:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10678129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 642771709 for ; Mon, 12 Nov 2018 05:33:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5080929E28 for ; Mon, 12 Nov 2018 05:33:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FE5129E3A; Mon, 12 Nov 2018 05:33:21 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 6F5D029E28 for ; Mon, 12 Nov 2018 05:33:20 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 49A1A267A81; Mon, 12 Nov 2018 06:33:19 +0100 (CET) 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 F02B2267A81; Mon, 12 Nov 2018 06:33:17 +0100 (CET) Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710076.outbound.protection.outlook.com [40.107.71.76]) by alsa0.perex.cz (Postfix) with ESMTP id 028FF2677E4 for ; Mon, 12 Nov 2018 06:33:15 +0100 (CET) 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=cyttfU8y5bIYk4OKaX7A/lC1Oi9coxj8GT1DdtxTUAA=; b=KINVMD7Z6lsFA3icwJq/5pvrWBM4d/pJ3NfPdXfb0R+LC83fGSJIm/1o55pJkUE/GDJcLJzmUwibqZLNg4819wGUfjKC3/8gOtcUIYyeT0muMdGr5B9XaAvb9s5ve1q9Cf+xBXykoH7SSzvs3wsAJ+jmhSs+wDu7VSln88TiL5U= Received: from DM3PR12CA0059.namprd12.prod.outlook.com (2603:10b6:0:56::27) by BY1PR12MB0423.namprd12.prod.outlook.com (2a01:111:e400:51b2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.25; Mon, 12 Nov 2018 05:33:13 +0000 Received: from CO1NAM03FT013.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::205) by DM3PR12CA0059.outlook.office365.com (2603:10b6:0:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.25 via Frontend Transport; Mon, 12 Nov 2018 05:33:12 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT013.mail.protection.outlook.com (10.152.80.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:33:11 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:33:10 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:04:59 +0530 Message-ID: <1542000903-19020-9-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(376002)(39860400002)(136003)(346002)(2980300002)(428003)(199004)(189003)(106466001)(105586002)(81166006)(2906002)(356004)(6666004)(53416004)(104016004)(81156014)(305945005)(48376002)(1671002)(478600001)(50466002)(97736004)(47776003)(8676002)(39060400002)(186003)(2616005)(476003)(16586007)(8936002)(126002)(109986005)(11346002)(26005)(446003)(426003)(76176011)(7696005)(72206003)(77096007)(51416003)(36756003)(86362001)(5660300001)(4326008)(68736007)(316002)(53936002)(50226002)(486006)(336012)(54906003)(42413003)(266003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR12MB0423; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT013; 1:QCTV3wJVNU6W/QXzYwiDSXYENeRQVYXlVOKxiT7ShonDocVnoDO33m16InlOhvi2d3PB1FQCwSyrK+y/lTBQ08NkuNi+rW6igJpWL4U1+Dn61Nta+Le/NuqS4xfSDF0U X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9901ff04-5ba4-4959-aca0-08d648605636 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:BY1PR12MB0423; X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 3:DcJ//PwUD/NrGIwKcw2BFZEAY5di+vnXYxjhPNsxAUgxTIGVnbhg1SWTR3KzAzHwOHO7Xa04Dcg32mcuOqD9TUVtWZDsH0RFYXNcb8/xl9NPP0IIoK4O9FDgHlUvqgioo3XfTzM0U1n+OTOO3WZg8Ty9LqZSqZCbfPLXbe0aTGSr9FY8h0/BAr8pUVZjJPg/uC4eK5/JGeIMynpUmBFl5TCShBIlCSW/xZA1jx5CkS1OXWeEADpCSuabh4j2jj6frCvj5XRPS1Mb3xgsSMV/VnqmyE3oGucyJJZr5kKQAT4R2dKiLM1EGnKooDbKlmyxDEWx5mP0zZ7bDcEpE9KRq5j//rmwrHFURRu6tqPk+vU=; 25:F+/+nfWXO+eZ94EG1N+alyYukL1IwmY/z8lq1WpAFKGxYGqiaEVqz/y6E1I9uiVna4coO/uNdBMygrCJqLyoBx68beA7pUj9Dxq4fTT0sGubKuVT6hysTryWbj/Wh2+3AOeUzPzeA3sggc9ioic1movzRc77vVu/IG/zBVlJw6HVKsMJ9HR9ArFUs7+4XlthRw6R4luZUXbRnSV4sOrNhOpZVHoqp03SS4lfe6CykMVxjOKEMbEVgg0jXEMdgYnPr/gxbbEUaPBhI21RyuNSr8swlvdlKfOg+ebhqj6LvDF4VlAG9uD6lKII3Z4ccEcR7CDZPnuMFCT6gtwXr/J70xPGtw4N4c4XqvJ3HSIOffw= X-MS-TrafficTypeDiagnostic: BY1PR12MB0423: X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 31:X9LTcMr8W6WTGRmVbh6uMp2TUpV7302yudjlXZpws/Hy0n+q6+dBgiIK//LW8pGlPLZVf/pMypNwuHFcM/aKSwYNkvuw5YRmXvIoIVdVna4atUsZhD7VtbSThqJUvAVbtF/+coBdQ1cfc+f5RSYotdaJkoGlSny32mB7p8zBbIzNS/spsipGnPGs6OfbpCA70EVkv8DQcCWU/4W4EMXvhyAAlVLSkbfXRaznYvdQ/1k=; 20:LWGmrldHzZbacRtinWv00uhNobF4gbByi2ztMMMx+vvA0or1Xk+SVc9mSnQM++j0yq66qiamfOek3hpaF10Wt0IYQkFnpgVbqWTr7iO7SICxDvlJxHLUeeJwqG1RlL1xBr8dVPh7L9qptvOsX8BD+4Een75CEWBeKNaX9PQzubUISZgmFMwd3sIGhjj/YxDH++RGgkNHeiypP2nrIjcnAUq7CeYxx9PhcgKgnfzOFdyEBi1r7ovb+l3JSvbTwRVyrqHHieYwGpiMNOrXmOm6TBj46SJMVYAzorSeNR2ZKuNsRPdUeX2O/VTo0/eFypCDjsh8sr+cfdM+5uctwha/6MZRHbUkzeO3g0aIlm6174XHRpjixM3unjnBVZ1Hwz9Ta6fplfgvyPp/kWB8NQAXINsoryABzTOuELz61razYHwxTLOctiK+cKzBeZLGq5PkRm1KXAiu7gvspu0gauQ8HOv7AkEKpiF4sJDTKPdJd5aoUWZAKluFmF7dssp8IxCo 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)(8121501046)(5005006)(93006095)(93003095)(3231382)(944501410)(52105112)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:BY1PR12MB0423; BCL:0; PCL:0; RULEID:; SRVR:BY1PR12MB0423; X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 4:Tod3c+fdYtDX1cODvySOD3w0tiOmKfIG5e2bIVZ7OI4hXsVXRR0BWOrj4qtZv/Pi0ALrOKG08+N/nYlVxM6tgVM+C2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BXlz02X5ACucemPOFEPogo/wwOIp7e7rdn9QVTVYKkA1PYmLqxFDe0RRz1/5ceiCUk7l2RKHbDNe5ZUb61djZny7f2e0oQCI1oBLDQuiJ1EUupesQ25qLCJAPO5Yy1CkuoERcXekJUgigUue4Crrlp6IAJ4okP9ZF8lOYfChV9MB7Rq+pqI7NyHZubC7ZaCWxw7zYLaOUuutPzRnKr2xjnKcxc6WY84kyMYQeQIzFNJMdg5dOF0FISOVQ1s634wWNWCp3i1xDLr9KQ0fNlYzfb49ovSsUv+2begPjCeWFtcuPzj209Xg==; 5:HMsI24dvaaaN7GmMRpfRl4sdX9CNOqKIj+7YzYCTGaAIP2ryZCHXoIYoVnoQTmU3OI6y0WrSl70RrIv9VLEZclQjmz13cvrDM/XIm1AHE3zGadc1B2viFeBAUoeb9PRZPXYby/P5Wv7WCCixngUbFiPsqip9al86u2M8g3hN7dU=; 7:aFVC2+E25wD+3KJlHf7GGEGt4JAZjc/1kN7D+nLFayqwNFEWdFZx7r9CbrVLpeZEzE6n4rZqgtflFavYEaUj3BR4dEtatL7SiNJdyPSG3tBumsiy5rLiq0N08D2gEdLy2F7BeZmYpHHXgNUskn5QjQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 20:ZuLvle8aSeNV26qffgnlXlSLFkoOcEAtTjlNEbc50Imzx7IdMEAgtgtq9LS62Qq5cTAnZqUSeVRuHJSE3fwsy+HQpp4//Tb5KH/mjstr0tnSbbe7roY7vrP1C3313aflTjS9gMeKXebQ4ZnqGvbyKakyXQUw1AWUKr6XOWN0rwqgm/BOBetnXcaMAXHOQS45xjQ8oE+eyh3D4RFo1m6TjoqFnybcCC4EGYJMB9hw16jXxlk/8B5blX+yp+8GX22/ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:33:11.6550 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9901ff04-5ba4-4959-aca0-08d648605636 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR12MB0423 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Sanju R Mehta , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 08/11] ASoC: amd: add acp3x tdm mode support 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 ACP3x I2S (CPU DAI) can act in normal I2S and TDM modes. Added support for TDM mode. Desired mode can be selected from ASoC machine driver. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/acp3x-pcm-dma.c | 62 +++++++++++++++++++++++++++++++++++++ sound/soc/amd/raven/acp3x.h | 7 +++++ 2 files changed, 69 insertions(+) diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index ed2c163..15a5f3b 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -27,7 +27,9 @@ #define DRV_NAME "acp3x-i2s-audio" struct i2s_dev_data { + bool tdm_mode; unsigned int i2s_irq; + u32 tdm_fmt; void __iomem *acp3x_base; struct snd_pcm_substream *play_stream; struct snd_pcm_substream *capture_stream; @@ -423,6 +425,64 @@ static struct snd_pcm_ops acp3x_dma_ops = { .mmap = acp3x_dma_mmap, }; + +static int acp3x_dai_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) +{ + + struct i2s_dev_data *adata = snd_soc_dai_get_drvdata(cpu_dai); + + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { + case SND_SOC_DAIFMT_I2S: + adata->tdm_mode = false; + break; + case SND_SOC_DAIFMT_DSP_A: + adata->tdm_mode = true; + break; + default: + return -EINVAL; + } + + return 0; +} + +static int acp3x_dai_set_tdm_slot(struct snd_soc_dai *cpu_dai, u32 tx_mask, + u32 rx_mask, int slots, int slot_width) +{ + u32 val = 0; + u16 slot_len; + + struct i2s_dev_data *adata = snd_soc_dai_get_drvdata(cpu_dai); + + switch (slot_width) { + case SLOT_WIDTH_8: + slot_len = 8; + break; + case SLOT_WIDTH_16: + slot_len = 16; + break; + case SLOT_WIDTH_24: + slot_len = 24; + break; + case SLOT_WIDTH_32: + slot_len = 0; + break; + default: + return -EINVAL; + } + + val = rv_readl(adata->acp3x_base + mmACP_BTTDM_ITER); + rv_writel((val | 0x2), adata->acp3x_base + mmACP_BTTDM_ITER); + val = rv_readl(adata->acp3x_base + mmACP_BTTDM_IRER); + rv_writel((val | 0x2), adata->acp3x_base + mmACP_BTTDM_IRER); + + val = (FRM_LEN | (slots << 15) | (slot_len << 18)); + rv_writel(val, adata->acp3x_base + mmACP_BTTDM_TXFRMT); + rv_writel(val, adata->acp3x_base + mmACP_BTTDM_RXFRMT); + + adata->tdm_fmt = val; + return 0; +} + static int acp3x_dai_i2s_hwparams(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) @@ -510,6 +570,8 @@ static int acp3x_dai_i2s_trigger(struct snd_pcm_substream *substream, struct snd_soc_dai_ops acp3x_dai_i2s_ops = { .hw_params = acp3x_dai_i2s_hwparams, .trigger = acp3x_dai_i2s_trigger, + .set_fmt = acp3x_dai_i2s_set_fmt, + .set_tdm_slot = acp3x_dai_set_tdm_slot, }; static struct snd_soc_dai_driver acp3x_i2s_dai_driver = { diff --git a/sound/soc/amd/raven/acp3x.h b/sound/soc/amd/raven/acp3x.h index 9f33e34..95fef85 100644 --- a/sound/soc/amd/raven/acp3x.h +++ b/sound/soc/amd/raven/acp3x.h @@ -32,6 +32,13 @@ #define MIN_BUFFER MAX_BUFFER #define FIFO_SIZE 0x100 #define DMA_SIZE 0x40 +#define FRM_LEN 0x100 + +#define SLOT_WIDTH_8 0x08 +#define SLOT_WIDTH_16 0x10 +#define SLOT_WIDTH_24 0x18 +#define SLOT_WIDTH_32 0x20 + static inline u32 rv_readl(void __iomem *base_addr) { From patchwork Mon Nov 12 05:35:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10678131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 834FC14E2 for ; Mon, 12 Nov 2018 05:33:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EECC27F60 for ; Mon, 12 Nov 2018 05:33:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6111527FA9; Mon, 12 Nov 2018 05:33:37 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 D2AF327F60 for ; Mon, 12 Nov 2018 05:33:35 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 92EBA267A89; Mon, 12 Nov 2018 06:33:34 +0100 (CET) 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 D3E81267A8C; Mon, 12 Nov 2018 06:33:32 +0100 (CET) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790055.outbound.protection.outlook.com [40.107.79.55]) by alsa0.perex.cz (Postfix) with ESMTP id 52D27267A67 for ; Mon, 12 Nov 2018 06:33:30 +0100 (CET) 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=2o3gh6c/gtUi6dtloy0BDJpUedMdwvUWYX2k/zUMJrk=; b=DZLwEeTJN3Yb/x/Nd8tygLA4p/OVSxKMqoOly5eVNU3ryk8xMshum0fP08UdGXBWC99MOjyLnngQvWwBNBL1ZamBPQQaY8EIwKrF47szoPyTZAV8IvV2F48/+iUqQJRro66G5v0lJNMg9ILF+b5l0Uj3EB8C5y3Q5sM3oJdBETo= Received: from MWHPR12CA0062.namprd12.prod.outlook.com (2603:10b6:300:103::24) by SN1PR12MB0623.namprd12.prod.outlook.com (2a01:111:e400:c428::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.27; Mon, 12 Nov 2018 05:33:27 +0000 Received: from CO1NAM03FT021.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::204) by MWHPR12CA0062.outlook.office365.com (2603:10b6:300:103::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.20 via Frontend Transport; Mon, 12 Nov 2018 05:33:27 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT021.mail.protection.outlook.com (10.152.80.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:33:26 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:33:24 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:05:00 +0530 Message-ID: <1542000903-19020-10-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(376002)(136003)(2980300002)(428003)(189003)(199004)(336012)(72206003)(2906002)(53416004)(305945005)(54906003)(316002)(77096007)(39060400002)(7696005)(26005)(51416003)(426003)(47776003)(4326008)(76176011)(14444005)(186003)(8676002)(53936002)(105586002)(16586007)(5660300001)(478600001)(97736004)(486006)(476003)(356004)(6666004)(11346002)(8936002)(50466002)(446003)(81156014)(86362001)(81166006)(48376002)(36756003)(106466001)(109986005)(68736007)(2616005)(50226002)(1671002)(104016004)(126002)(42413003)(266003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0623; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT021; 1:45Y4ClKIN2DTHWobpsggCkbVnAFYPfarZVMRxFSg1jfo3RxCtnmZXO4fub48Ei/KKj7UOqCARSi8ZYE9aZRHUsA6tBgJvHe0WYRMCubxKuFURR144FgxJAqwKC8hXNQT X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a3103d9-a0c2-480f-e527-08d648605f12 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:SN1PR12MB0623; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0623; 3:buFRXvl8Sv72XcwowT0w3XeSiAk9qvgVh+llYcF3OeaYhUumOadf2uIr5TVrv9mQzUwJQhkfKWmynJkcS6JXWZF3xqNXRhbP3/+OgpGXLghYy8cU6lkZy+PmJIiWiA8/g8B/JtehSPxlsw+/B9f7fphR7NI1GI/SXOJ93q3nvzVypm1AYlA26l6/Hz27wrC92EDGB25/AQJtZTSTlitPtKjKzmlLoW5lrnlGdIzL1zcQnQyALR+xBrBV0JxFE80qXSgELhSZbKPpgdhh86FLkstetUG14sKM3k6opnKpwct0+8giJs8LBf3SzX1ouu2JQ9LMx0o44dV9vfLTlfr3hKTs/alGtN7q1MzNorO/fp8=; 25:oTEcNplNLoaS7EvnbiomwJbEdgS9F1KUu4wlSUBT6qHL3fX6C1ykmdrA/O6V4PU9rn6AXBaM6cdPPwRXZR19rKYahMo9nOvfLzCczd37S4gdL/sW7wr5L2/Xl8iutQGflQ0FTV98mXXBkkmW9VZwllr761b9xenenLrLHUbmzoJJ3cx3ISvoUSG+TcBe9ekHNNM35ZthAeR4BOgdDSNKNpy2TA1Fzk2mtVGS04WYdgRgou1dSbRYSIQ+7qRQa1wgpwe2IzdfNMe2gYSGCejBPoQuocHvBRgkw0so/vtmZUErQcTTg/NhvXfGlo2AJbhdqwobH4bNYo8xjvFjgafi6fnZLMa+XhqONCLGs2YmIMs= X-MS-TrafficTypeDiagnostic: SN1PR12MB0623: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0623; 31:IQnYvT2qRg496agFxjqFrrKJZUT1DiFGH1owh1RUQffihiap7GL853MqCC4nAFWxWDIKe+KF6j6Mae4SNVaYbKPIiyPoAkhCzE1mjusshkRz2z5I1S/S3XHudem4E5T0jnugbEWmakqdujvhIB0mImcyAQvanFdH3f87jSatcTBdxRUV+AMXJ4Zz1AUhftfB5uaP/fHBzTQtT7hKuuSJw5yM2FA8/oyRT2anur1SbIs=; 20:+PXAqgzJwOiLF3Z1MNvmHpf+5sR7x1AF3GQNVrJENKUjVZZ3VQrjINy+SQgejox5EE9hw5Wmw1B3F/55wZKWjkaP7MNUsdalUt0yZ2Q8teKo4eEnm5isBC2dw/gzlGH2G40sCuYAsWZmZY25Tr42DTDWbpZcerVmo6VTC4cPX2E3lS+gMSbWZC6KW7RKusXewzeQYJk/kLwlaT2CupchytqfENnDzgLdyOZ90Ec5EI9zvkAApUjn1XS5M/ys1ptkNDB+Bqi4TUOBwOkbs02080Wm5g/ZbhSrUVq6xKUOq5p3BcGbbZoASc5SWx+AVCEL6QJ6ijrOmRj8shMjXiHmfDcQuZeWdH6uroDi5Ljgm4ieCt2bvDfV9topRWt5Cq2QjKmWLHNEPxZ2vKnufZWEShT0hWcz3Dn15jch4n8eqTqzFf5UhsTrDF7uJ9Zg7Dh5hQSCmP1sPcoHlT6V/9pgFKDOlFCmjFT478awwtk1FsxH8e5pR458xEaq4otMSiDE 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)(93003095)(3231402)(944501410)(52105112)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN1PR12MB0623; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0623; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0623; 4:OOAnt43sG2lEQVElt5QgafLFAu6i0WOVKjJDBkPGST0a3Yhh365cBUQeaag2TwTOshj3j8xoIMEBK0Eo618k+xE8qyY28UWgaXGVZp3NuhyEs2PddfA6QHp/JXYgJoU/llsrHQuXUxfdy8TVZEJqZqxwuU1ARqIS2MFi0wm2IlL8W3tq2RgyzbDQT6jyEtL7L9F+cl2khWDKLdOLdEqVVzEGMmaHOQloXORUL3NjCbA0Nj4XzHndVtKODBV9IqIxEmZcCs8NZ56uEzCeXrLhI9eEkcjMcDgSsK+LoB+rTHOtFl1uirt17aThor0n+SlP X-Forefront-PRVS: 0854128AF0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0623; 23:w2fFlqeJypt9jTcfAyJ9C0DxTzF4r4QJaqvl3fSLy?= 45zgdMQKubegpbk0OWCWt2OL9oUJjee2p9PXqJoVd/B+ZTj8B/E7u1cs/yXCOFKEe5rbs6PsKnmD9oMDg6hnnhYKquqRIdR0FAn7gOQtPNm+W98OZaDF/f0MbVL73ADhyEdSlfBNaD61SgJMrurf7QwHGkJQSBuu3sYejlFKUVGWmsAhfhKCMisCkAc+/7myDS7t/siPDTAqKNNT9bPH07K+ma0sHiCjkMRkO/rsOG/O0aQPiqSCvFjaCpaw/Scm74BLRcguyNsxbT+dDn5jNUplb3i6Vf0bTPR01CWydUqOlQf1ItiOnnpRqOZScrAQuiyZDIJF9nUCMwzO14pgYHv+YTRxbugXk++Y3idTFayQf+CEe83R9xo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2qhro8+yvL7/VCQu1R000WahT6d2tn+X8z0qVyRvZ72MNAGX5fiD/vKCkAgQYTc/GUiQfGsraRsp65NgOJ4BsoxlqKWEkCk22oHHt24kYSELNpV/ho01WR6KsPjgpvSPkkhvOYZpxWRMY6qk0rnYUfOHBQ6BKc+uVT/R0YGjM96y0QvhwY8xrTCp8= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0623; 6:Ly6aCLK7fnkM4x6w/zNFgjSReAA6IOIrVP8fEOVoaA5+nHHyFMCb4RM9rbymwm10onZId6KlNkXvTWriqgFRXZjru8AifBUeuuhRQxf3SEz8T7hjtaxHPasoeIFSa94u11H+DEjPlMG4ZTKgfZx/8teWIoGBPJA4gSP08lTnSKa5xArbUddvxbvnkuVi+ZZIrl9nIKRjACqBzz0HogsXsmw771289oEaa0//HWvOHmTAoF/LIMT0yg8rn/D2SjX90oWR4gBuOmYouiWJE8OwOC7ieL0pv+/E7MHg+CLRh38djnVtXNkpsrkxw7Ey3OT29Wfg1e5TuV35yZfkhIZP1slhcpioCURlHTv4sFLKmv3W+vOW42T3S/VhHwz5B9qCpPcJx2rO874evxZ1ZX0jC8vcKlWRMabqeLFA3fk6yWMBGsrfguJcDh585DR+Xqx/3pxYdXBjWAz4q4+C8z7nng==; 5:MRZw7Kkyl7tP3+Kdu/NW0JGpsM8KjZZvEAde6t3sGu4x9xOeOfVfchf20agqWyztF4EHwnS2z19U06/RkYbU6xAG5JsdJ7WrPppH8PGvEHkirbVWopn11KaFUxEnsb5N73XpduetYIiOe8dCTmg9QK2XLe47jHz4dq6RiQBI1EE=; 7:ly4vruXfVKojEISETbyATbl/c3LgR16RTv4QuBBaM2Tn2pc+PYHyqiu1BN0VQJ7cCfk0YWAof2x/qaRF9QLw0VlCBysvdQMkK1N5byXEAhQPRmwn5994Q6nKp1G4ssiOzRBwrIafmtk9oBQnJ/IlpQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0623; 20:k4nsJe1fLx5/cqkeN80ZonFq/jL/ZPZjihWw1xMX5qjujUEkPfr436oWXHuGkPdT8fQEGqKNrDGt4U86PUGUz6Q86JRcGeUi7N3fzav5MI1jO8teCdo2mFep55qUpAdv2WiET4LervUeCy0oM4Xg61j+0EDfKnrdxK/MUJUHKtjCXs5Qbdi81LkoBUx1PPD3+ewGorMrpbSAzq0gLhMq30k26cm34xgzMyQmxP6FR/IvmZ00DiE6PrYSYZvinqXs X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:33:26.5356 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a3103d9-a0c2-480f-e527-08d648605f12 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0623 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 09/11] ASoC: amd: add acp3x runtime pm ops 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 Added runtime PM operations for ACP3x PCM platform device. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/acp3x-pcm-dma.c | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index 15a5f3b..710c5c5 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -660,6 +661,9 @@ static int acp3x_audio_probe(struct platform_device *pdev) goto dev_err; } + pm_runtime_set_autosuspend_delay(&pdev->dev, 10000); + pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_enable(&pdev->dev); return 0; dev_err: status = acp3x_deinit(adata->acp3x_base); @@ -682,14 +686,49 @@ static int acp3x_audio_remove(struct platform_device *pdev) else dev_info(&pdev->dev, "ACP de-initialized\n"); + pm_runtime_disable(&pdev->dev); return 0; } +static int acp3x_pcm_runtime_suspend(struct device *dev) +{ + int status; + struct i2s_dev_data *adata = dev_get_drvdata(dev); + + status = acp3x_deinit(adata->acp3x_base); + if (status) + dev_err(dev, "ACP de-init failed\n"); + else + dev_info(dev, "ACP de-initialized\n"); + + rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); + + return 0; +} + +static int acp3x_pcm_runtime_resume(struct device *dev) +{ + int status; + struct i2s_dev_data *adata = dev_get_drvdata(dev); + + status = acp3x_init(adata->acp3x_base); + if (status) + return -ENODEV; + rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); + return 0; +} + +static const struct dev_pm_ops acp3x_pm_ops = { + .runtime_suspend = acp3x_pcm_runtime_suspend, + .runtime_resume = acp3x_pcm_runtime_resume, +}; + static struct platform_driver acp3x_dma_driver = { .probe = acp3x_audio_probe, .remove = acp3x_audio_remove, .driver = { .name = "acp3x_rv_i2s", + .pm = &acp3x_pm_ops, }, }; From patchwork Mon Nov 12 05:35:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10678133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F147514BA for ; Mon, 12 Nov 2018 05:33:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFA3827F60 for ; Mon, 12 Nov 2018 05:33:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D147827FA9; Mon, 12 Nov 2018 05:33:51 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 1442B27F60 for ; Mon, 12 Nov 2018 05:33:51 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DDF762679BF; Mon, 12 Nov 2018 06:33:49 +0100 (CET) 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 C85F52679BF; Mon, 12 Nov 2018 06:33:47 +0100 (CET) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790087.outbound.protection.outlook.com [40.107.79.87]) by alsa0.perex.cz (Postfix) with ESMTP id 9DF972677E4 for ; Mon, 12 Nov 2018 06:33:45 +0100 (CET) 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=CCAO4ZUf6UeO/NWbRWAidAwihnT8i1sbrPmRcJyIqbk=; b=MrTxHoXqQ2DwCru5esFif7QKnZAkM4krpyCySOSAyx1aWRrGJ8NQfyS26C+lea0jFkN1hX0Icn0PZ91YWWtCNRYoS16QX2rdCXDcZjVPWui2zyzHHfRhVOuq2EGI1ZuFksRhSh6hDjDV+Eth3UUQC4E8K2gJNfd099Hfm0xoqK4= Received: from BN6PR12CA0025.namprd12.prod.outlook.com (2603:10b6:405:70::11) by BLUPR12MB0417.namprd12.prod.outlook.com (2a01:111:e400:516a::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.29; Mon, 12 Nov 2018 05:33:42 +0000 Received: from CO1NAM03FT040.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::201) by BN6PR12CA0025.outlook.office365.com (2603:10b6:405:70::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.26 via Frontend Transport; Mon, 12 Nov 2018 05:33:41 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT040.mail.protection.outlook.com (10.152.81.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:33:41 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:33:39 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:05:01 +0530 Message-ID: <1542000903-19020-11-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(136003)(376002)(346002)(39860400002)(396003)(2980300002)(428003)(199004)(189003)(336012)(446003)(2616005)(8676002)(11346002)(126002)(476003)(8936002)(86362001)(1671002)(426003)(305945005)(81166006)(486006)(186003)(81156014)(50226002)(68736007)(106466001)(97736004)(53416004)(105586002)(36756003)(51416003)(109986005)(53936002)(5660300001)(76176011)(50466002)(77096007)(7696005)(48376002)(47776003)(54906003)(14444005)(16586007)(39060400002)(72206003)(2906002)(104016004)(316002)(356004)(6666004)(26005)(478600001)(4326008)(42413003)(266003)(32563001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0417; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT040; 1:6WbYB/cqCf7B1X0yO2UFUCNc/cNd7oiIIbOnPN3klRDgpoQ7OEJZ3sMhPmwCaNOzN0stOzw/0BGnsVScS5qaUx81s5kQ/79Zg6u6UaZIyWOc/833uCThBZU11nZC/YTS X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8f1c7e2e-2206-44ed-62b9-08d6486067c3 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:BLUPR12MB0417; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 3:WylATZjVpMd7pJPw2n3igrvHHgb4He3AB8F4ATFME6zmWG9MCd4kROzOrhpgVWBYfil0T2yZAxMROTTsln+pd5+qcbKzGmFVoC3DO6n8YX50+NWKdnRj5dbJa7WpYKzKddk6B+6s+ucF8eYduTbR2DpGcRJfM2DzpZfqRlDbUnvm1IRPpbasuOqgblaOMqjQXHmcBEqCgFnqrc4GhKQxSfnTd3CbAyHXos2wcQaIzAo6eKyMrYG9FXZ25R9FZABe0c1cr3aB19tjpyc5huZEGcWQXXc4caACTTV74FGRbBYChzsEnBoVqsaOCVbeKM6/DM1a6kDtBpcEpiyH+dDic0N3ya1/zIVDONnWgfvw/dE=; 25:lg17G+iGeJbpOeUSQ5kS9u6wRXrR2z8V3X8A+mviXe2Hl6yoCkSTEU3xKSrQDtfkJNlxrM0E99BIvYohGyhpLk8GAPcxnWWJaHeJB/Mzf0hcXjzlmrt3yeksDlHdudKF8ALDUU4hFU8iuB7pbSGptKNdoD+hb0H9sQo8WLUzT3LNjYmS79PFBbjtYGXMsbWX2aUZBEIYuscrusfHHn/zTF6SugooEk38mgjoK2Y6tZjA0c7lAD7hOQw8yINMEovM+kYchdymzf+XcTjtsKDPhGledKqFB3U36PwlhHIU10EadF1iYdEVQ+b2yniup1cGr3UUlQYWeoQh1xLk1J/WkcH22HI9BeDWs7+LARR8Agw= X-MS-TrafficTypeDiagnostic: BLUPR12MB0417: X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 31:UT0Y2WwXMvxvslzsbYi19dxv7Nd8l7aXShPaeKO8A6fPZoHgmX1Qccq6CZ12QLaskICQSke5lwt4zvgaWXz2Htb+k6jFycQa/15G7GrpG3OULr2t2HqsTmjaqQ39+unuVflVtP2Zg0zuPTC6eyUjv/w8m7lsc01o+wtGiOWj6MYTwpZgQG4pLLb4cE6NcXWucb6DKzF/bQdEZSAZyGw4zdXQtTQhxglYZ7PAu+OYubA=; 20:rcHQaHzswtBGy7eOPywbSMO9C0zU7rpHqDlUlvY8hFvd1QHrBgw36axYYZdaqZ6HYAA7vLxklrhewZmwUqlfrw1VEkcW7XHVuBV2HTYt6Na2D5eyn0NXvs/cigQG0sSYe1s1BF+U5iYuaQca/dcO4l3tJU/Ey3HPpyr+ZohGvOtrbgysyA3iqB5qf/vTy0sdpZKWG4IULilUaCHrTCoAE+3pPVTXF1cQEruQybFb6ajiHItLtYwcJ4WFm5vAuCXeijbisZPBb4cKtzTz/gWBLu0hwwVZwGDz2MKVTKOqe5VZhNmlv5z4Dx8mHoCTm8WYKTWKMd4QCjw7C6tBtsKLSGOz2ffPSEbZQmnm1a1rZNM+4b6mfd6nLNlPHTOGAxKucORSbKGxHhVJKP43QvVW7z16Y6DggRg42sWnlVR3J66/tcBRzCh8f9VWDqBwVuCJP3jDPW2VbVJYSd9H6tZ8STVapDXpIZ8OdeH0afil/q70ZcENukXRXYdDpqcyl220 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)(10201501046)(3231382)(944501410)(52105112)(3002001)(93006095)(93003095)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:BLUPR12MB0417; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0417; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 4:bqj4reqaw3DqXlWtETlIcF9r+rghh0Zu74PoUoCW4xf/Xd6t2Uh/dFXuVVGuhZoJyukU127/Ov1K78nfVDZ3V7cmNtR44dvrbQB/RO14G8FJrg9cP6Rgpgt4qlFAbk4DPJRxqYg/+43hF+jkxDSJTxb96DovVqvj19suwR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UsOCX4YatkHKitB7dmDexBeN08Oz3tZUFLE/FcVboeGaGmnvX5/iLDTuqdjwhQjrsUWutRFivV6BYp8bDtd4TxP13bOMskgbkBfPMLr9MGJSmeJU+jc/xzR80LRFHa5s29p5DqOGGTFolZ/wzhEqsDVzFLD007P6YuvlZxzfbfvyoKAJZ9TmYzl4CJ9l0zS+nMCFgrCHuecyYJCNju6aCuddxMdaPxE9hA7fJd5ygYXmS69HXFeEAr+qrhhkoe30lfrunIeP++fvmQ3MOCBV37jUCYl+yhOeniwP48j4P7fGGLQf818iALEc7aWCgt2vlUX1FmdfwFEgKHnmw==; 5:Avn4EVKMqY2H5y5MSQsnFcFnceGPV6sPkguBKDUyiuld4VP4VKV+dowmacKnY7473QwwCQjWf/srGs1UN+0desuk2DsVvdyixYeAW1lKBiH/Wvq/BP5XYlz8WkuPF7lYKZxO7GNmLsK1p0kjcM8EzXs1gXVGfE18cQvVbq8gNwM=; 7:dR4h5ivqp2h4yOi9O/PXb3cnD+Kq963NHNBpncqfTB1OlaL7/93sq9s1eZYYjkXpL2gpU7SqTOYztAhu8icNoAlX7nHKCWqDytA9o0xJLID2Q4PM0ow5FF8Feq6kmQt9+MmBOoDEB/IGQqYh/4q8Bg== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 20:D5a4FgpGZZhm6T/EoXnGK5+KJVOlweQcVEZlnev/TANKzzueNMyXBL5gU241YzYEg138jYAy0OG4Qdbkq/iqsoUjNH3WQONX6tWR3n5mkjNVbS4aYPeN5+JUMsZAVp9ULUzu/45GhYNTsqhdSBouWj3PZmoax2oRdNHUthQ1mhXikWovWPHOpo2PXYX1W/QB7tIQZ64FIkRysN7r+GEDrOgrcVet09yRhd1XL3/L0uLwtvodxjrsluGf7GB6orO1 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:33:41.0984 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f1c7e2e-2206-44ed-62b9-08d6486067c3 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0417 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 10/11] ASoC: amd: add acp3x system resume pm op 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 When system wide suspend happens, ACP will be powered off. When system resumes, all the runtime configuration data for ACP needs to be programmed again. Added 'resume'pm call back to ACP pm ops. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/acp3x-pcm-dma.c | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index 710c5c5..2e61cef 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -690,6 +690,51 @@ static int acp3x_audio_remove(struct platform_device *pdev) return 0; } +static int acp3x_resume(struct device *dev) +{ + int status; + u32 val; + struct i2s_dev_data *adata = dev_get_drvdata(dev); + + status = acp3x_init(adata->acp3x_base); + if (status) + return -ENODEV; + + if (adata->play_stream && adata->play_stream->runtime) { + struct i2s_stream_instance *rtd = + adata->play_stream->runtime->private_data; + config_acp3x_dma(rtd, SNDRV_PCM_STREAM_PLAYBACK); + rv_writel((rtd->xfer_resolution << 3), + rtd->acp3x_base + mmACP_BTTDM_ITER); + if (adata->tdm_mode == true) { + rv_writel(adata->tdm_fmt, adata->acp3x_base + + mmACP_BTTDM_TXFRMT); + val = rv_readl(adata->acp3x_base + mmACP_BTTDM_ITER); + rv_writel((val | 0x2), adata->acp3x_base + + mmACP_BTTDM_ITER); + } + } + + if (adata->capture_stream && adata->capture_stream->runtime) { + struct i2s_stream_instance *rtd = + adata->capture_stream->runtime->private_data; + config_acp3x_dma(rtd, SNDRV_PCM_STREAM_CAPTURE); + rv_writel((rtd->xfer_resolution << 3), + rtd->acp3x_base + mmACP_BTTDM_IRER); + if (adata->tdm_mode == true) { + rv_writel(adata->tdm_fmt, adata->acp3x_base + + mmACP_BTTDM_RXFRMT); + val = rv_readl(adata->acp3x_base + mmACP_BTTDM_IRER); + rv_writel((val | 0x2), adata->acp3x_base + + mmACP_BTTDM_IRER); + } + } + + rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); + return 0; +} + + static int acp3x_pcm_runtime_suspend(struct device *dev) { int status; @@ -721,6 +766,7 @@ static int acp3x_pcm_runtime_resume(struct device *dev) static const struct dev_pm_ops acp3x_pm_ops = { .runtime_suspend = acp3x_pcm_runtime_suspend, .runtime_resume = acp3x_pcm_runtime_resume, + .resume = acp3x_resume, }; static struct platform_driver acp3x_dma_driver = { From patchwork Mon Nov 12 05:35:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10678135 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 02EBC14E2 for ; Mon, 12 Nov 2018 05:34:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E542A29332 for ; Mon, 12 Nov 2018 05:34:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9128293DC; Mon, 12 Nov 2018 05:34:15 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 27FE129332 for ; Mon, 12 Nov 2018 05:34:15 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EFF0B26792F; Mon, 12 Nov 2018 06:34:13 +0100 (CET) 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 E7498267A67; Mon, 12 Nov 2018 06:34:11 +0100 (CET) Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690061.outbound.protection.outlook.com [40.107.69.61]) by alsa0.perex.cz (Postfix) with ESMTP id A10512677E4 for ; Mon, 12 Nov 2018 06:34:09 +0100 (CET) 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=pie8MTmVnWsE4MZx2fY3vNr0/mw0muYPynLs9HUAPU0=; b=BXg0cWxhfzo87LIXDu+U7nnrdG4qv/cyoI1oZ0E8qrEx1ZdvdktKrmOz5lla98zAQRbxAiyMAFA87ILNkhRrWS3cM081BVibR7I8t5UZdrMltzfDVCYC+tIM5ajOsUw9t0NOHHoweRMY48LwMDt5Q/+N0p0TjCvbcsMbE9QqVNA= Received: from BN6PR1201CA0014.namprd12.prod.outlook.com (2603:10b6:405:4c::24) by SN1PR12MB0431.namprd12.prod.outlook.com (2a01:111:e400:5865::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.27; Mon, 12 Nov 2018 05:34:06 +0000 Received: from CO1NAM03FT009.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::204) by BN6PR1201CA0014.outlook.office365.com (2603:10b6:405:4c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.21 via Frontend Transport; Mon, 12 Nov 2018 05:34:06 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; diasemi.com; dkim=none (message not signed) header.d=none;diasemi.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT009.mail.protection.outlook.com (10.152.80.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:34:06 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:34:03 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:05:02 +0530 Message-ID: <1542000903-19020-12-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(376002)(136003)(346002)(396003)(2980300002)(428003)(189003)(199004)(105586002)(106466001)(48376002)(186003)(39060400002)(426003)(1671002)(5660300001)(50466002)(53416004)(4326008)(77096007)(26005)(305945005)(126002)(336012)(86362001)(2616005)(476003)(486006)(2906002)(11346002)(446003)(316002)(16586007)(356004)(72206003)(50226002)(104016004)(51416003)(97736004)(7696005)(76176011)(36756003)(54906003)(47776003)(478600001)(81156014)(81166006)(68736007)(8676002)(8936002)(53936002)(109986005)(42413003)(266003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0431; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT009; 1:hpG6248axAKL/DKEXQf1N0hta0Wf/1gbweG3kUdNiBwy+YRdmL7Zb52TkafFE6qz43/AfzML3fhmeR2gbg4QGTAkGR8t4U00sGSS61LOeANcT0UWvhF8Am4AcoYYgNWe X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72b0557a-6e98-4aa2-df2c-08d64860769c X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:SN1PR12MB0431; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0431; 3:/H2wQxjVfBFShkMT9UWSCtcYlKZxFwV8S1XNrDRQCV/t8dNZEINMVeisFpq12Nj1yl/5s9RwwJxYDtA3+InPro6oK4fWYuk72C3RxrB5bSK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wZZzHF0WyFTs8nzLh2akgMzN6EfmygBu5XVi32Fl08zWoiZeCJNPTuvxy8R6fQm/CKQAPhThkE/JK5GshtCPunB4KMC+I++9ilCUREjWWogHTb++JS9FUvH8kygt6sXyJ0iZKklrWMBjkeotR4DPl1YdlvOQfCD3zqw8VBQytQV9MXYslIcpnjPiuKohf7Kr0QNbh4MheiJirO6v+7A92u8O1TBPTwcG9tM2p19ZEisDPQm4aSKq7wj9CgrDj/gjW5+lupaGsztfRRBRR9S/JkyLiIAOL+GUMrdQSPh8GEvkiuVm9a8ec4GhgyBDiBJzUGo/gG+3FVyNeh8RmWBZV7PSsC136+0nh4WN0RRaTAlKPJq8z2wQU72a2q0+WK 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)(3002001)(3231382)(944501410)(52105112)(10201501046)(93006095)(93003095)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:SN1PR12MB0431; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0431; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0431; 4:5FsoEcCOkv3rGpIREJGb+i1m0MuVHIvh/gcfWaKQbrZatFQyE4htbgLuZ/AYoSuRiuJ3LgrBGmL6ECstFjBIpmLGxuwUjVRqbhNSAQz1aVr+QtepbYbQKjHygfxHlyv/Roy1XNl+C8QY9OyM8UMxu3/xvregYo1pZ8eC2FRPU/h4EAr7pTKEpNbuCYs1BcXIMTMuKrevWbEQpNaPGipXAuV6d/xJTe3QMrJ7iHqiS2w2jrJoefxgeckwkZjzQfHQ5np275F5KRtd15yoyR96Z942D3ugUw7+vunjcQuQ/naVNbEKkJwr2RmQyUnm5kIa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zmAIhFsq1WRty8SxQMfMqw1kQtA0QIKKnxdgI5IodW7+c8HsORaXkpcnz5YOxMeO2/cATBPBsdK6OuQ==; 5:EOj3gnjT9iLigLUJ0yoGvPhmdEpcZ2VdgRcPm69odjzmZXQHekxRJajRFNubsC7WX6klFjrGZiT+523hWFHIaViERigJaXyZOzx4BJzTpDA5FswI1he/8YrqUDd6+YVXxZPg4UO20sRYYXe89COxbwDVvZr+9+yw4Jpxw0VoaE0=; 7:luYKjNeu8SnaU2j2Pf3ZeqYdfmeAcLovWYID/9BQLuMcRI/NXnbNUZXuBJ/aO5qpHrV5h33bb0DtotVZ6Ffii8gYXjDWs9UFITArir2CZ9tXY2bH5u9uAgEVrssjq1wF75zz0z0/NrBJrlklWu1SEw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0431; 20:o6YBltxYu6OyYemv0QHeY0wo3q2stMvdkWN4ABih3MrNwpALCxHR2k0plgdzmo/tiXWdY8VKV3Bbki4yGtWGpgYGDhErvfG9WlDQspUcUeNTPkFAa2XwLZoTCKgEokvrlIjB4bAVQmhti5yVGbPnrnoB3pB0ijMEw9NXkubq+csXRQa2sP4id1AJ/GPxtxdip10jluhEksivsAOK/YdQLtun5ijPDr/1I1megeOhjqCmxRtWfTPVbv1uGlylXJz8 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:34:06.0118 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 72b0557a-6e98-4aa2-df2c-08d64860769c 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0431 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alex Deucher , Adam Thomson , Akshu Agrawal Subject: [alsa-devel] [PATCH 11/11] ASoC: amd: enable acp3x drivers build 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 ACP3x drivers can be built by selecting necessary kernel config option. The patch enables build support of the same. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/Kconfig | 5 +++++ sound/soc/amd/Makefile | 1 + sound/soc/amd/raven/Makefile | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 sound/soc/amd/raven/Makefile diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index 58c1dcb..5f3b560 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -19,3 +19,8 @@ config SND_SOC_AMD_CZ_RT5645_MACH depends on SND_SOC_AMD_ACP && I2C help This option enables machine driver for rt5645. + +config SND_SOC_AMD_ACP3x + tristate "AMD Audio Coprocessor-v3.x support" + help + This option enables ACP v3.x I2S support on AMD platform diff --git a/sound/soc/amd/Makefile b/sound/soc/amd/Makefile index 79b0622..8e1c571 100644 --- a/sound/soc/amd/Makefile +++ b/sound/soc/amd/Makefile @@ -5,3 +5,4 @@ snd-soc-acp-rt5645-mach-objs := acp-rt5645.o obj-$(CONFIG_SND_SOC_AMD_ACP) += acp_audio_dma.o obj-$(CONFIG_SND_SOC_AMD_CZ_DA7219MX98357_MACH) += snd-soc-acp-da7219mx98357-mach.o obj-$(CONFIG_SND_SOC_AMD_CZ_RT5645_MACH) += snd-soc-acp-rt5645-mach.o +obj-$(CONFIG_SND_SOC_AMD_ACP3x) += raven/ diff --git a/sound/soc/amd/raven/Makefile b/sound/soc/amd/raven/Makefile new file mode 100644 index 0000000..8c03e6f --- /dev/null +++ b/sound/soc/amd/raven/Makefile @@ -0,0 +1,4 @@ +snd-pci-acp3x-objs := pci-acp3x.o +snd-acp3x-pcm-dma-objs := acp3x-pcm-dma.o +obj-$(CONFIG_SND_SOC_AMD_ACP3x) += snd-pci-acp3x.o +obj-$(CONFIG_SND_SOC_AMD_ACP3x) += snd-acp3x-pcm-dma.o