From patchwork Mon Oct 11 05:56:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 045E7C433EF for ; Mon, 11 Oct 2021 05:39:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C56660F35 for ; Mon, 11 Oct 2021 05:39:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6C56660F35 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D029E1689; Mon, 11 Oct 2021 07:38:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D029E1689 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633930764; bh=H7Wx+shRBPVNn7QXQbORE40IVMu24VawE1oB3KWU7lY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EvIcX0829Rel9rKkOI5iP8vx/+XPmgOoGf0dxylIYWyFLtsiFHu2LHd42ubwUr9cq g4dO77PfrTB6gpNwWvpuy7UTIv/IogW7bJWo/dM1TGnXlBADMgSSepEhJQbtQInu3Y mcWpMf35B+am6IzGqqRXAB80DYmPK4YEUL1Uad3E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6DE92F80104; Mon, 11 Oct 2021 07:38:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 13EC5F80290; Mon, 11 Oct 2021 07:38:32 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2084.outbound.protection.outlook.com [40.107.236.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E3E97F8016D for ; Mon, 11 Oct 2021 07:38:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E3E97F8016D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="QhASsnwC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RJ6xCDS91jp+X/1obO8fouihw7rXYctP9iFK+UR60ECCDq3R/kyuHkDWe0CTm4BIAEe3cTJQn/s/+zSW8PcH+SRTa3M0bG9VTXIsw5OODohfQW1jz/cTyxrwLI+Te88Q5pieUdbrzrJ9BVtsGRL8wFeoJyz3Bk2ozQQhvBF9gB/bxmsFlSfrEbXwAD3DpejNOWzFuZijXBqi3z2s8Rv38zBRGM5zAmFnqn/Srzlb3aSCjEWqkkWa6vj7CpQGE2X8AAYvvHiGK6Gmkjp1qpbmPMlq6hyM+teYJ5gYPPC2RKqE3tf3HsqgIr3ZzIPswuu25ksrKev4blfyaokCUJzUyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WxQskQZeYVmvbRjWvdA0cruHSNoAafycSj+oz3vUrzM=; b=IGJpbvevoey5FYT1NtKtR6yfOTCTUZ13QV8nEFizDhb1+6/HvOVgwXHSSxWjXFd7W8SE+c/6TfaUZ9AdXIHmuU6puEolc4Lu+Ah1VueHtJx1e1QSRnd97T3qpETDmeZA1Dd64tkBODWC5PfHpWtWOc2hb0/08OXXG0pHIFuBUwvCzkCsPLtglOG2r4tvVBt7JPv8yUm5VRFVAWmLX5MeNFqZSkYfgmMzd4O9RpgVd6Lynx8GrDZmwG0lcg+dl3wkwDsUXq7zXaaPxXd5E+Y3agW0RV/p56IGQynJCaa5tiQVg8W9exGJ2EbF7g7x45+YjNZ4o2jUD+2fhm1uiKBYdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WxQskQZeYVmvbRjWvdA0cruHSNoAafycSj+oz3vUrzM=; b=QhASsnwCpG3/0h1kxkDJhxztMOVjk5t5sxUsu1A12GU/XfnhrjuXHO/J0vfR+CjhkMcWMIpAGMx9vVluZNWZV9N3M0BIqX14lQMVWFjvhE8S+YmCGoWN7kwbGT+4xiUzFHc5nPnqG6Sm/mDG9+9hN/dwdC4n8vQL3oaL54C2iVs= Received: from DM6PR06CA0084.namprd06.prod.outlook.com (2603:10b6:5:336::17) by SN6PR12MB4749.namprd12.prod.outlook.com (2603:10b6:805:e8::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Mon, 11 Oct 2021 05:38:18 +0000 Received: from DM6NAM11FT006.eop-nam11.prod.protection.outlook.com (2603:10b6:5:336:cafe::85) by DM6PR06CA0084.outlook.office365.com (2603:10b6:5:336::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:38:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT006.mail.protection.outlook.com (10.13.173.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:38:18 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:38:16 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sun, 10 Oct 2021 22:38:15 -0700 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:38:12 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 01/13] ASoC: amd: add Yellow Carp ACP6x IP register header Date: Mon, 11 Oct 2021 11:26:09 +0530 Message-ID: <20211011055621.13240-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6c599a6b-0d51-42a0-4b24-08d98c795470 X-MS-TrafficTypeDiagnostic: SN6PR12MB4749: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:404; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /640PTuJycxvV4JlArdAzsOlQ4I1ryDsArhHUJ6/VSVN30UiQigDCrszZI8tq/E/1LlAGyZm6U+sfWteAyvMVqd1L8mwb/N7RK+cbkr/kr76h+D4ApxMisbYlRmRIFdUuzn7pfgiWFFHCnD4vEQxLNu1Acfa8V6ujdAAfFrcT2XJu+N6hl1PrILT1qvly7bGaR5y8hAxt3bwFInjnZZ7x+90G1g+92Llvrt5UwU9eeDG9NFCAs7h+t6cfdV6BKe6KQ03tc+x+WQacA26GuZ7jb4PyB3mi2Cx5lkNkR0LiFfeLUZauMJagD+3IMNCUVLxyb3IqJtUDJ4ud14zoNTfEwmOtk5eY8+t0uCe32OJbkxTSNBYksUWKr873cl/7KTxaaUcMBkLJI0IzHvOAw86FxxGRy389bzyAvoodZi8I+TDbfYlpvY2jt+PFU1qOnaKtJlakwgg0x928t/60Np/n+2rJv3hLfxevtUXwx2SiBMs3nJTzX0lbFSsZCKH/ADMQxXCruhsh8i4bv+Jho1HFAShZzOlFX8+0Kck7qgGzRJCjSArP1/PKzQa480GoyOXz2QCO6Vt88xG9cm8Xx9Emd6kQza6pd2FKrl6yxxJfz05k2ZmPVpxjTQkfODXsMGNZWJEoxGKOXOoCTVFz9nVBmWXtOoapm6Hsp5RGZQVAUgRiHecmt7ei5lSVg4sQXbirbstdBiu3OUgb+A5ZDvT3Cm4B4p2JYml3HzanwlBfe6C4dXdLvMxlxySeI5IOpKO X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(36860700001)(508600001)(86362001)(316002)(4326008)(5660300002)(54906003)(110136005)(26005)(356005)(81166007)(7696005)(47076005)(70206006)(6666004)(8936002)(82310400003)(336012)(426003)(70586007)(83380400001)(1076003)(2616005)(186003)(36756003)(2906002)(30864003)(8676002)(32563001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:38:18.4383 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c599a6b-0d51-42a0-4b24-08d98c795470 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT006.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB4749 Cc: Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add register header for ACP6x IP in Yellow Carp platform. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x_chip_offset_byte.h | 444 ++++++++++++++++++++++ 1 file changed, 444 insertions(+) create mode 100644 sound/soc/amd/yc/acp6x_chip_offset_byte.h diff --git a/sound/soc/amd/yc/acp6x_chip_offset_byte.h b/sound/soc/amd/yc/acp6x_chip_offset_byte.h new file mode 100644 index 000000000000..f05fb2dfb5da --- /dev/null +++ b/sound/soc/amd/yc/acp6x_chip_offset_byte.h @@ -0,0 +1,444 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * AMD ACP 6.x Register Documentation + * + * Copyright 2021 Advanced Micro Devices, Inc. + */ + +#ifndef _acp6x_OFFSET_HEADER +#define _acp6x_OFFSET_HEADER + +/* Registers from ACP_DMA block */ +#define ACP_DMA_CNTL_0 0x1240000 +#define ACP_DMA_CNTL_1 0x1240004 +#define ACP_DMA_CNTL_2 0x1240008 +#define ACP_DMA_CNTL_3 0x124000C +#define ACP_DMA_CNTL_4 0x1240010 +#define ACP_DMA_CNTL_5 0x1240014 +#define ACP_DMA_CNTL_6 0x1240018 +#define ACP_DMA_CNTL_7 0x124001C +#define ACP_DMA_DSCR_STRT_IDX_0 0x1240020 +#define ACP_DMA_DSCR_STRT_IDX_1 0x1240024 +#define ACP_DMA_DSCR_STRT_IDX_2 0x1240028 +#define ACP_DMA_DSCR_STRT_IDX_3 0x124002C +#define ACP_DMA_DSCR_STRT_IDX_4 0x1240030 +#define ACP_DMA_DSCR_STRT_IDX_5 0x1240034 +#define ACP_DMA_DSCR_STRT_IDX_6 0x1240038 +#define ACP_DMA_DSCR_STRT_IDX_7 0x124003C +#define ACP_DMA_DSCR_CNT_0 0x1240040 +#define ACP_DMA_DSCR_CNT_1 0x1240044 +#define ACP_DMA_DSCR_CNT_2 0x1240048 +#define ACP_DMA_DSCR_CNT_3 0x124004C +#define ACP_DMA_DSCR_CNT_4 0x1240050 +#define ACP_DMA_DSCR_CNT_5 0x1240054 +#define ACP_DMA_DSCR_CNT_6 0x1240058 +#define ACP_DMA_DSCR_CNT_7 0x124005C +#define ACP_DMA_PRIO_0 0x1240060 +#define ACP_DMA_PRIO_1 0x1240064 +#define ACP_DMA_PRIO_2 0x1240068 +#define ACP_DMA_PRIO_3 0x124006C +#define ACP_DMA_PRIO_4 0x1240070 +#define ACP_DMA_PRIO_5 0x1240074 +#define ACP_DMA_PRIO_6 0x1240078 +#define ACP_DMA_PRIO_7 0x124007C +#define ACP_DMA_CUR_DSCR_0 0x1240080 +#define ACP_DMA_CUR_DSCR_1 0x1240084 +#define ACP_DMA_CUR_DSCR_2 0x1240088 +#define ACP_DMA_CUR_DSCR_3 0x124008C +#define ACP_DMA_CUR_DSCR_4 0x1240090 +#define ACP_DMA_CUR_DSCR_5 0x1240094 +#define ACP_DMA_CUR_DSCR_6 0x1240098 +#define ACP_DMA_CUR_DSCR_7 0x124009C +#define ACP_DMA_CUR_TRANS_CNT_0 0x12400A0 +#define ACP_DMA_CUR_TRANS_CNT_1 0x12400A4 +#define ACP_DMA_CUR_TRANS_CNT_2 0x12400A8 +#define ACP_DMA_CUR_TRANS_CNT_3 0x12400AC +#define ACP_DMA_CUR_TRANS_CNT_4 0x12400B0 +#define ACP_DMA_CUR_TRANS_CNT_5 0x12400B4 +#define ACP_DMA_CUR_TRANS_CNT_6 0x12400B8 +#define ACP_DMA_CUR_TRANS_CNT_7 0x12400BC +#define ACP_DMA_ERR_STS_0 0x12400C0 +#define ACP_DMA_ERR_STS_1 0x12400C4 +#define ACP_DMA_ERR_STS_2 0x12400C8 +#define ACP_DMA_ERR_STS_3 0x12400CC +#define ACP_DMA_ERR_STS_4 0x12400D0 +#define ACP_DMA_ERR_STS_5 0x12400D4 +#define ACP_DMA_ERR_STS_6 0x12400D8 +#define ACP_DMA_ERR_STS_7 0x12400DC +#define ACP_DMA_DESC_BASE_ADDR 0x12400E0 +#define ACP_DMA_DESC_MAX_NUM_DSCR 0x12400E4 +#define ACP_DMA_CH_STS 0x12400E8 +#define ACP_DMA_CH_GROUP 0x12400EC +#define ACP_DMA_CH_RST_STS 0x12400F0 + +/* Registers from ACP_AXI2AXIATU block */ +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_1 0x1240C00 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_1 0x1240C04 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_2 0x1240C08 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_2 0x1240C0C +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_3 0x1240C10 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_3 0x1240C14 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_4 0x1240C18 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_4 0x1240C1C +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_5 0x1240C20 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_5 0x1240C24 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_6 0x1240C28 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_6 0x1240C2C +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_7 0x1240C30 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_7 0x1240C34 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_8 0x1240C38 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_8 0x1240C3C +#define ACPAXI2AXI_ATU_CTRL 0x1240C40 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_9 0x1240C44 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_9 0x1240C48 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_10 0x1240C4C +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_10 0x1240C50 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_11 0x1240C54 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_11 0x1240C58 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_12 0x1240C5C +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_12 0x1240C60 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_13 0x1240C64 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_13 0x1240C68 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_14 0x1240C6C +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_14 0x1240C70 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_15 0x1240C74 +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_15 0x1240C78 +#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_16 0x1240C7C +#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_16 0x1240C80 + +/* Registers from ACP_CLKRST block */ +#define ACP_SOFT_RESET 0x1241000 +#define ACP_CONTROL 0x1241004 +#define ACP_STATUS 0x1241008 +#define ACP_DYNAMIC_CG_MASTER_CONTROL 0x1241010 +#define ACP_ZSC_DSP_CTRL 0x1241014 +#define ACP_ZSC_STS 0x1241018 +#define ACP_PGFSM_CONTROL 0x1241024 +#define ACP_PGFSM_STATUS 0x1241028 +#define ACP_CLKMUX_SEL 0x124102C + +/* Registers from ACP_AON block */ +#define ACP_PME_EN 0x1241400 +#define ACP_DEVICE_STATE 0x1241404 +#define AZ_DEVICE_STATE 0x1241408 +#define ACP_PIN_CONFIG 0x1241440 +#define ACP_PAD_PULLUP_CTRL 0x1241444 +#define ACP_PAD_PULLDOWN_CTRL 0x1241448 +#define ACP_PAD_DRIVE_STRENGTH_CTRL 0x124144C +#define ACP_PAD_SCHMEN_CTRL 0x1241450 +#define ACP_SW_PAD_KEEPER_EN 0x1241454 +#define ACP_SW_WAKE_EN 0x1241458 +#define ACP_I2S_WAKE_EN 0x124145C +#define ACP_SW1_WAKE_EN 0x1241460 + +/* Registers from ACP_P1_MISC block */ +#define ACP_EXTERNAL_INTR_ENB 0x1241A00 +#define ACP_EXTERNAL_INTR_CNTL 0x1241A04 +#define ACP_EXTERNAL_INTR_CNTL1 0x1241A08 +#define ACP_EXTERNAL_INTR_STAT 0x1241A0C +#define ACP_EXTERNAL_INTR_STAT1 0x1241A10 +#define ACP_ERROR_STATUS 0x1241A4C +#define ACP_P1_SW_I2S_ERROR_REASON 0x1241A50 +#define ACP_P1_SW_POS_TRACK_I2S_TX_CTRL 0x1241A6C +#define ACP_P1_SW_I2S_TX_DMA_POS 0x1241A70 +#define ACP_P1_SW_POS_TRACK_I2S_RX_CTRL 0x1241A74 +#define ACP_P1_SW_I2S_RX_DMA_POS 0x1241A78 +#define ACP_P1_DMIC_I2S_GPIO_INTR_CTRL 0x1241A7C +#define ACP_P1_DMIC_I2S_GPIO_INTR_STATUS 0x1241A80 +#define ACP_SCRATCH_REG_BASE_ADDR 0x1241A84 +#define ACP_P1_SW_POS_TRACK_BT_TX_CTRL 0x1241A88 +#define ACP_P1_SW_BT_TX_DMA_POS 0x1241A8C +#define ACP_P1_SW_POS_TRACK_HS_TX_CTRL 0x1241A90 +#define ACP_P1_SW_HS_TX_DMA_POS 0x1241A94 +#define ACP_P1_SW_POS_TRACK_BT_RX_CTRL 0x1241A98 +#define ACP_P1_SW_BT_RX_DMA_POS 0x1241A9C +#define ACP_P1_SW_POS_TRACK_HS_RX_CTRL 0x1241AA0 +#define ACP_P1_SW_HS_RX_DMA_POS 0x1241AA4 + +/* Registers from ACP_AUDIO_BUFFERS block */ +#define ACP_I2S_RX_RINGBUFADDR 0x1242000 +#define ACP_I2S_RX_RINGBUFSIZE 0x1242004 +#define ACP_I2S_RX_LINKPOSITIONCNTR 0x1242008 +#define ACP_I2S_RX_FIFOADDR 0x124200C +#define ACP_I2S_RX_FIFOSIZE 0x1242010 +#define ACP_I2S_RX_DMA_SIZE 0x1242014 +#define ACP_I2S_RX_LINEARPOSITIONCNTR_HIGH 0x1242018 +#define ACP_I2S_RX_LINEARPOSITIONCNTR_LOW 0x124201C +#define ACP_I2S_RX_INTR_WATERMARK_SIZE 0x1242020 +#define ACP_I2S_TX_RINGBUFADDR 0x1242024 +#define ACP_I2S_TX_RINGBUFSIZE 0x1242028 +#define ACP_I2S_TX_LINKPOSITIONCNTR 0x124202C +#define ACP_I2S_TX_FIFOADDR 0x1242030 +#define ACP_I2S_TX_FIFOSIZE 0x1242034 +#define ACP_I2S_TX_DMA_SIZE 0x1242038 +#define ACP_I2S_TX_LINEARPOSITIONCNTR_HIGH 0x124203C +#define ACP_I2S_TX_LINEARPOSITIONCNTR_LOW 0x1242040 +#define ACP_I2S_TX_INTR_WATERMARK_SIZE 0x1242044 +#define ACP_BT_RX_RINGBUFADDR 0x1242048 +#define ACP_BT_RX_RINGBUFSIZE 0x124204C +#define ACP_BT_RX_LINKPOSITIONCNTR 0x1242050 +#define ACP_BT_RX_FIFOADDR 0x1242054 +#define ACP_BT_RX_FIFOSIZE 0x1242058 +#define ACP_BT_RX_DMA_SIZE 0x124205C +#define ACP_BT_RX_LINEARPOSITIONCNTR_HIGH 0x1242060 +#define ACP_BT_RX_LINEARPOSITIONCNTR_LOW 0x1242064 +#define ACP_BT_RX_INTR_WATERMARK_SIZE 0x1242068 +#define ACP_BT_TX_RINGBUFADDR 0x124206C +#define ACP_BT_TX_RINGBUFSIZE 0x1242070 +#define ACP_BT_TX_LINKPOSITIONCNTR 0x1242074 +#define ACP_BT_TX_FIFOADDR 0x1242078 +#define ACP_BT_TX_FIFOSIZE 0x124207C +#define ACP_BT_TX_DMA_SIZE 0x1242080 +#define ACP_BT_TX_LINEARPOSITIONCNTR_HIGH 0x1242084 +#define ACP_BT_TX_LINEARPOSITIONCNTR_LOW 0x1242088 +#define ACP_BT_TX_INTR_WATERMARK_SIZE 0x124208C +#define ACP_HS_RX_RINGBUFADDR 0x1242090 +#define ACP_HS_RX_RINGBUFSIZE 0x1242094 +#define ACP_HS_RX_LINKPOSITIONCNTR 0x1242098 +#define ACP_HS_RX_FIFOADDR 0x124209C +#define ACP_HS_RX_FIFOSIZE 0x12420A0 +#define ACP_HS_RX_DMA_SIZE 0x12420A4 +#define ACP_HS_RX_LINEARPOSITIONCNTR_HIGH 0x12420A8 +#define ACP_HS_RX_LINEARPOSITIONCNTR_LOW 0x12420AC +#define ACP_HS_RX_INTR_WATERMARK_SIZE 0x12420B0 +#define ACP_HS_TX_RINGBUFADDR 0x12420B4 +#define ACP_HS_TX_RINGBUFSIZE 0x12420B8 +#define ACP_HS_TX_LINKPOSITIONCNTR 0x12420BC +#define ACP_HS_TX_FIFOADDR 0x12420C0 +#define ACP_HS_TX_FIFOSIZE 0x12420C4 +#define ACP_HS_TX_DMA_SIZE 0x12420C8 +#define ACP_HS_TX_LINEARPOSITIONCNTR_HIGH 0x12420CC +#define ACP_HS_TX_LINEARPOSITIONCNTR_LOW 0x12420D0 +#define ACP_HS_TX_INTR_WATERMARK_SIZE 0x12420D4 + +/* Registers from ACP_I2S_TDM block */ +#define ACP_I2STDM_IER 0x1242400 +#define ACP_I2STDM_IRER 0x1242404 +#define ACP_I2STDM_RXFRMT 0x1242408 +#define ACP_I2STDM_ITER 0x124240C +#define ACP_I2STDM_TXFRMT 0x1242410 +#define ACP_I2STDM0_MSTRCLKGEN 0x1242414 +#define ACP_I2STDM1_MSTRCLKGEN 0x1242418 +#define ACP_I2STDM2_MSTRCLKGEN 0x124241C +#define ACP_I2STDM_REFCLKGEN 0x1242420 + +/* Registers from ACP_BT_TDM block */ +#define ACP_BTTDM_IER 0x1242800 +#define ACP_BTTDM_IRER 0x1242804 +#define ACP_BTTDM_RXFRMT 0x1242808 +#define ACP_BTTDM_ITER 0x124280C +#define ACP_BTTDM_TXFRMT 0x1242810 +#define ACP_HSTDM_IER 0x1242814 +#define ACP_HSTDM_IRER 0x1242818 +#define ACP_HSTDM_RXFRMT 0x124281C +#define ACP_HSTDM_ITER 0x1242820 +#define ACP_HSTDM_TXFRMT 0x1242824 + +/* Registers from ACP_WOV block */ +#define ACP_WOV_PDM_ENABLE 0x1242C04 +#define ACP_WOV_PDM_DMA_ENABLE 0x1242C08 +#define ACP_WOV_RX_RINGBUFADDR 0x1242C0C +#define ACP_WOV_RX_RINGBUFSIZE 0x1242C10 +#define ACP_WOV_RX_LINKPOSITIONCNTR 0x1242C14 +#define ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH 0x1242C18 +#define ACP_WOV_RX_LINEARPOSITIONCNTR_LOW 0x1242C1C +#define ACP_WOV_RX_INTR_WATERMARK_SIZE 0x1242C20 +#define ACP_WOV_PDM_FIFO_FLUSH 0x1242C24 +#define ACP_WOV_PDM_NO_OF_CHANNELS 0x1242C28 +#define ACP_WOV_PDM_DECIMATION_FACTOR 0x1242C2C +#define ACP_WOV_PDM_VAD_CTRL 0x1242C30 +#define ACP_WOV_WAKE 0x1242C54 +#define ACP_WOV_BUFFER_STATUS 0x1242C58 +#define ACP_WOV_MISC_CTRL 0x1242C5C +#define ACP_WOV_CLK_CTRL 0x1242C60 +#define ACP_PDM_VAD_DYNAMIC_CLK_GATING_EN 0x1242C64 +#define ACP_WOV_ERROR_STATUS_REGISTER 0x1242C68 +#define ACP_PDM_CLKDIV 0x1242C6C + +/* Registers from ACP_P1_AUDIO_BUFFERS block */ +#define ACP_P1_I2S_RX_RINGBUFADDR 0x1243A00 +#define ACP_P1_I2S_RX_RINGBUFSIZE 0x1243A04 +#define ACP_P1_I2S_RX_LINKPOSITIONCNTR 0x1243A08 +#define ACP_P1_I2S_RX_FIFOADDR 0x1243A0C +#define ACP_P1_I2S_RX_FIFOSIZE 0x1243A10 +#define ACP_P1_I2S_RX_DMA_SIZE 0x1243A14 +#define ACP_P1_I2S_RX_LINEARPOSITIONCNTR_HIGH 0x1243A18 +#define ACP_P1_I2S_RX_LINEARPOSITIONCNTR_LOW 0x1243A1C +#define ACP_P1_I2S_RX_INTR_WATERMARK_SIZE 0x1243A20 +#define ACP_P1_I2S_TX_RINGBUFADDR 0x1243A24 +#define ACP_P1_I2S_TX_RINGBUFSIZE 0x1243A28 +#define ACP_P1_I2S_TX_LINKPOSITIONCNTR 0x1243A2C +#define ACP_P1_I2S_TX_FIFOADDR 0x1243A30 +#define ACP_P1_I2S_TX_FIFOSIZE 0x1243A34 +#define ACP_P1_I2S_TX_DMA_SIZE 0x1243A38 +#define ACP_P1_I2S_TX_LINEARPOSITIONCNTR_HIGH 0x1243A3C +#define ACP_P1_I2S_TX_LINEARPOSITIONCNTR_LOW 0x1243A40 +#define ACP_P1_I2S_TX_INTR_WATERMARK_SIZE 0x1243A44 +#define ACP_P1_BT_RX_RINGBUFADDR 0x1243A48 +#define ACP_P1_BT_RX_RINGBUFSIZE 0x1243A4C +#define ACP_P1_BT_RX_LINKPOSITIONCNTR 0x1243A50 +#define ACP_P1_BT_RX_FIFOADDR 0x1243A54 +#define ACP_P1_BT_RX_FIFOSIZE 0x1243A58 +#define ACP_P1_BT_RX_DMA_SIZE 0x1243A5C +#define ACP_P1_BT_RX_LINEARPOSITIONCNTR_HIGH 0x1243A60 +#define ACP_P1_BT_RX_LINEARPOSITIONCNTR_LOW 0x1243A64 +#define ACP_P1_BT_RX_INTR_WATERMARK_SIZE 0x1243A68 +#define ACP_P1_BT_TX_RINGBUFADDR 0x1243A6C +#define ACP_P1_BT_TX_RINGBUFSIZE 0x1243A70 +#define ACP_P1_BT_TX_LINKPOSITIONCNTR 0x1243A74 +#define ACP_P1_BT_TX_FIFOADDR 0x1243A78 +#define ACP_P1_BT_TX_FIFOSIZE 0x1243A7C +#define ACP_P1_BT_TX_DMA_SIZE 0x1243A80 +#define ACP_P1_BT_TX_LINEARPOSITIONCNTR_HIGH 0x1243A84 +#define ACP_P1_BT_TX_LINEARPOSITIONCNTR_LOW 0x1243A88 +#define ACP_P1_BT_TX_INTR_WATERMARK_SIZE 0x1243A8C +#define ACP_P1_HS_RX_RINGBUFADDR 0x1243A90 +#define ACP_P1_HS_RX_RINGBUFSIZE 0x1243A94 +#define ACP_P1_HS_RX_LINKPOSITIONCNTR 0x1243A98 +#define ACP_P1_HS_RX_FIFOADDR 0x1243A9C +#define ACP_P1_HS_RX_FIFOSIZE 0x1243AA0 +#define ACP_P1_HS_RX_DMA_SIZE 0x1243AA4 +#define ACP_P1_HS_RX_LINEARPOSITIONCNTR_HIGH 0x1243AA8 +#define ACP_P1_HS_RX_LINEARPOSITIONCNTR_LOW 0x1243AAC +#define ACP_P1_HS_RX_INTR_WATERMARK_SIZE 0x1243AB0 +#define ACP_P1_HS_TX_RINGBUFADDR 0x1243AB4 +#define ACP_P1_HS_TX_RINGBUFSIZE 0x1243AB8 +#define ACP_P1_HS_TX_LINKPOSITIONCNTR 0x1243ABC +#define ACP_P1_HS_TX_FIFOADDR 0x1243AC0 +#define ACP_P1_HS_TX_FIFOSIZE 0x1243AC4 +#define ACP_P1_HS_TX_DMA_SIZE 0x1243AC8 +#define ACP_P1_HS_TX_LINEARPOSITIONCNTR_HIGH 0x1243ACC +#define ACP_P1_HS_TX_LINEARPOSITIONCNTR_LOW 0x1243AD0 +#define ACP_P1_HS_TX_INTR_WATERMARK_SIZE 0x1243AD4 + +/* Registers from ACP_SCRATCH block */ +#define ACP_SCRATCH_REG_0 0x1250000 +#define ACP_SCRATCH_REG_1 0x1250004 +#define ACP_SCRATCH_REG_2 0x1250008 +#define ACP_SCRATCH_REG_3 0x125000C +#define ACP_SCRATCH_REG_4 0x1250010 +#define ACP_SCRATCH_REG_5 0x1250014 +#define ACP_SCRATCH_REG_6 0x1250018 +#define ACP_SCRATCH_REG_7 0x125001C +#define ACP_SCRATCH_REG_8 0x1250020 +#define ACP_SCRATCH_REG_9 0x1250024 +#define ACP_SCRATCH_REG_10 0x1250028 +#define ACP_SCRATCH_REG_11 0x125002C +#define ACP_SCRATCH_REG_12 0x1250030 +#define ACP_SCRATCH_REG_13 0x1250034 +#define ACP_SCRATCH_REG_14 0x1250038 +#define ACP_SCRATCH_REG_15 0x125003C +#define ACP_SCRATCH_REG_16 0x1250040 +#define ACP_SCRATCH_REG_17 0x1250044 +#define ACP_SCRATCH_REG_18 0x1250048 +#define ACP_SCRATCH_REG_19 0x125004C +#define ACP_SCRATCH_REG_20 0x1250050 +#define ACP_SCRATCH_REG_21 0x1250054 +#define ACP_SCRATCH_REG_22 0x1250058 +#define ACP_SCRATCH_REG_23 0x125005C +#define ACP_SCRATCH_REG_24 0x1250060 +#define ACP_SCRATCH_REG_25 0x1250064 +#define ACP_SCRATCH_REG_26 0x1250068 +#define ACP_SCRATCH_REG_27 0x125006C +#define ACP_SCRATCH_REG_28 0x1250070 +#define ACP_SCRATCH_REG_29 0x1250074 +#define ACP_SCRATCH_REG_30 0x1250078 +#define ACP_SCRATCH_REG_31 0x125007C +#define ACP_SCRATCH_REG_32 0x1250080 +#define ACP_SCRATCH_REG_33 0x1250084 +#define ACP_SCRATCH_REG_34 0x1250088 +#define ACP_SCRATCH_REG_35 0x125008C +#define ACP_SCRATCH_REG_36 0x1250090 +#define ACP_SCRATCH_REG_37 0x1250094 +#define ACP_SCRATCH_REG_38 0x1250098 +#define ACP_SCRATCH_REG_39 0x125009C +#define ACP_SCRATCH_REG_40 0x12500A0 +#define ACP_SCRATCH_REG_41 0x12500A4 +#define ACP_SCRATCH_REG_42 0x12500A8 +#define ACP_SCRATCH_REG_43 0x12500AC +#define ACP_SCRATCH_REG_44 0x12500B0 +#define ACP_SCRATCH_REG_45 0x12500B4 +#define ACP_SCRATCH_REG_46 0x12500B8 +#define ACP_SCRATCH_REG_47 0x12500BC +#define ACP_SCRATCH_REG_48 0x12500C0 +#define ACP_SCRATCH_REG_49 0x12500C4 +#define ACP_SCRATCH_REG_50 0x12500C8 +#define ACP_SCRATCH_REG_51 0x12500CC +#define ACP_SCRATCH_REG_52 0x12500D0 +#define ACP_SCRATCH_REG_53 0x12500D4 +#define ACP_SCRATCH_REG_54 0x12500D8 +#define ACP_SCRATCH_REG_55 0x12500DC +#define ACP_SCRATCH_REG_56 0x12500E0 +#define ACP_SCRATCH_REG_57 0x12500E4 +#define ACP_SCRATCH_REG_58 0x12500E8 +#define ACP_SCRATCH_REG_59 0x12500EC +#define ACP_SCRATCH_REG_60 0x12500F0 +#define ACP_SCRATCH_REG_61 0x12500F4 +#define ACP_SCRATCH_REG_62 0x12500F8 +#define ACP_SCRATCH_REG_63 0x12500FC +#define ACP_SCRATCH_REG_64 0x1250100 +#define ACP_SCRATCH_REG_65 0x1250104 +#define ACP_SCRATCH_REG_66 0x1250108 +#define ACP_SCRATCH_REG_67 0x125010C +#define ACP_SCRATCH_REG_68 0x1250110 +#define ACP_SCRATCH_REG_69 0x1250114 +#define ACP_SCRATCH_REG_70 0x1250118 +#define ACP_SCRATCH_REG_71 0x125011C +#define ACP_SCRATCH_REG_72 0x1250120 +#define ACP_SCRATCH_REG_73 0x1250124 +#define ACP_SCRATCH_REG_74 0x1250128 +#define ACP_SCRATCH_REG_75 0x125012C +#define ACP_SCRATCH_REG_76 0x1250130 +#define ACP_SCRATCH_REG_77 0x1250134 +#define ACP_SCRATCH_REG_78 0x1250138 +#define ACP_SCRATCH_REG_79 0x125013C +#define ACP_SCRATCH_REG_80 0x1250140 +#define ACP_SCRATCH_REG_81 0x1250144 +#define ACP_SCRATCH_REG_82 0x1250148 +#define ACP_SCRATCH_REG_83 0x125014C +#define ACP_SCRATCH_REG_84 0x1250150 +#define ACP_SCRATCH_REG_85 0x1250154 +#define ACP_SCRATCH_REG_86 0x1250158 +#define ACP_SCRATCH_REG_87 0x125015C +#define ACP_SCRATCH_REG_88 0x1250160 +#define ACP_SCRATCH_REG_89 0x1250164 +#define ACP_SCRATCH_REG_90 0x1250168 +#define ACP_SCRATCH_REG_91 0x125016C +#define ACP_SCRATCH_REG_92 0x1250170 +#define ACP_SCRATCH_REG_93 0x1250174 +#define ACP_SCRATCH_REG_94 0x1250178 +#define ACP_SCRATCH_REG_95 0x125017C +#define ACP_SCRATCH_REG_96 0x1250180 +#define ACP_SCRATCH_REG_97 0x1250184 +#define ACP_SCRATCH_REG_98 0x1250188 +#define ACP_SCRATCH_REG_99 0x125018C +#define ACP_SCRATCH_REG_100 0x1250190 +#define ACP_SCRATCH_REG_101 0x1250194 +#define ACP_SCRATCH_REG_102 0x1250198 +#define ACP_SCRATCH_REG_103 0x125019C +#define ACP_SCRATCH_REG_104 0x12501A0 +#define ACP_SCRATCH_REG_105 0x12501A4 +#define ACP_SCRATCH_REG_106 0x12501A8 +#define ACP_SCRATCH_REG_107 0x12501AC +#define ACP_SCRATCH_REG_108 0x12501B0 +#define ACP_SCRATCH_REG_109 0x12501B4 +#define ACP_SCRATCH_REG_110 0x12501B8 +#define ACP_SCRATCH_REG_111 0x12501BC +#define ACP_SCRATCH_REG_112 0x12501C0 +#define ACP_SCRATCH_REG_113 0x12501C4 +#define ACP_SCRATCH_REG_114 0x12501C8 +#define ACP_SCRATCH_REG_115 0x12501CC +#define ACP_SCRATCH_REG_116 0x12501D0 +#define ACP_SCRATCH_REG_117 0x12501D4 +#define ACP_SCRATCH_REG_118 0x12501D8 +#define ACP_SCRATCH_REG_119 0x12501DC +#define ACP_SCRATCH_REG_120 0x12501E0 +#define ACP_SCRATCH_REG_121 0x12501E4 +#define ACP_SCRATCH_REG_122 0x12501E8 +#define ACP_SCRATCH_REG_123 0x12501EC +#define ACP_SCRATCH_REG_124 0x12501F0 +#define ACP_SCRATCH_REG_125 0x12501F4 +#define ACP_SCRATCH_REG_126 0x12501F8 +#define ACP_SCRATCH_REG_127 0x12501FC +#define ACP_SCRATCH_REG_128 0x1250200 +#endif From patchwork Mon Oct 11 05:56:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14CF9C433EF for ; Mon, 11 Oct 2021 05:39:52 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A4A660F57 for ; Mon, 11 Oct 2021 05:39:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8A4A660F57 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4C5F41693; Mon, 11 Oct 2021 07:38:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4C5F41693 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633930788; bh=J5Vxg8Oy4yOgm5j/Its1QubO6Ovc+XgCi6nIkjmPdng=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ZASZL5+BVinFckFMnXFTvIZExP98dd2KhWRwjWJw8wezHtSTx/7n+YWxudd19kWab ZLGsi8xZJY6b+GmnzKLCKOzOXcdWtDLX+nz3C775RuKm6OIHnj2LnawLmLPm2CQf1a DCYneTUCXUzVSMmuvFk7fNOJNU20Ysm+4ceJgz9w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CEF92F804E7; Mon, 11 Oct 2021 07:38:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 10A8AF804EB; Mon, 11 Oct 2021 07:38:45 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2066.outbound.protection.outlook.com [40.107.212.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0D6B9F804E2 for ; Mon, 11 Oct 2021 07:38:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0D6B9F804E2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="JX7FcNKP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XQOqLorWhXWL+2Mamj7GJI6vnteSD+wI8GnJ+piziwAl9p9tX9yizGfLsXsuce8uqtfKo9Lu3Az5GPxRYHxpP53AT1dB7/2ov8Chs+84KtspYtar1oAPyq5Kx9QmFALZOHcdvP0SAKP7NND2u8bxW3sY1/hQO9Hls4V9Ol/anhL1MCbMRUsR+B27XGzKQ7wEgXNkJgAF2v77JUwvYlRpnN/AxBoEhrYpZ0AiPpdmvtWT0ynkeNQFnEyfLIrpmmCVhccVJseid347tdCAQwCzMfHULWGnSwEHCUiet72KFDb90iF6x1utO8hEyifd8xAhyn1p7PD00DQyDvCpmrygRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nFbGgQS1/ss/XQmt9sL/r27LZ98Dt9dc7heR7fYQ0Tk=; b=RR20It+j7WG/GXA9irQ0+1Tw/9Tmn3TGCovcP29jdco6bh0WeEe2WXddVS6WKASuuo5mvnX1jd1uuHgt6aL+wfMY2lE9I/a5V6DTxh6/+eaYwq0Q9heRvnGq/NDb17f1O/bMhzTSkCJpolGk6xdWTUQVIEWzz21QJr4EjVrZsae7zVdraWem9sUWlfpytQN1RMTANh7wdglTCpUXADuwHLBQBWDM+9afjsNOld+Yde9eryE4C18rd/HwYJExipv4EnbI+wEx+Okjk0b3/q7uz3l7OzZgJeu5oKooSVIl5QTZzb/+Zalo0sfPIvJeb+tyBbLzapLp+ieaWb3x0zCTaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nFbGgQS1/ss/XQmt9sL/r27LZ98Dt9dc7heR7fYQ0Tk=; b=JX7FcNKP+Rz4r6tpLj0LPUwwI93X6ITXo0SpaD2N0xN0g7pMk6n2cZUrQcfPWZmbf9wjAUL0Af3fJt34B1OZtCYzxAC+he5UvMR5x1Cyumi93H79lzXPDrFjQofEzb0YHRfFygVW4UYaV6oBAMBOaFgR9AAVw1OifwEHKkiK0NM= Received: from DM5PR07CA0141.namprd07.prod.outlook.com (2603:10b6:3:13e::31) by BN9PR12MB5273.namprd12.prod.outlook.com (2603:10b6:408:11e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Mon, 11 Oct 2021 05:38:31 +0000 Received: from DM6NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13e:cafe::23) by DM5PR07CA0141.outlook.office365.com (2603:10b6:3:13e::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19 via Frontend Transport; Mon, 11 Oct 2021 05:38:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT034.mail.protection.outlook.com (10.13.173.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:38:30 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:38:30 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sun, 10 Oct 2021 22:38:29 -0700 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:38:26 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 02/13] ASoC: amd: add Yellow Carp ACP PCI driver Date: Mon, 11 Oct 2021 11:26:10 +0530 Message-ID: <20211011055621.13240-3-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c69e125-5133-4fc2-97fa-08d98c795ba0 X-MS-TrafficTypeDiagnostic: BN9PR12MB5273: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:565; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bszjQiXenGzpOxhUtUNwH2fho/EP4fBYa4WHpqIT9pba+WQeDHyflh5Wpu9QKQtifBbuQYmtD1urASEDUf8uJqGGr1bpCSIP1J6BSf9p9MXZtnYEjpMrIqinewysBAebbrN7igthQu6i6NTaZWJVhKJyJSuz1XZDkEwcuTEsE8C4XzCcU8fS7HRT64ohQxm9DCeRHCPaWqAJDvkmFTRPoX8uA+QGSc5boGk4AWkxsy+vsH5Z+2XJih1pTHxYTRj7VVS94Rp5VBmAbZZD+xbPz4IhhjTTiFiupw/bXcSLQVaFULeXFCh6T798nELGuIqmcnQRAKrLpbzn75N7PNsnwI+kBmJLa8ZZFUsvzUMhOW+bmQsxqIRJq/ztQU68Zpve/9WiQeZ8OdBl7qMDOXNkOx8+Pnh39HPYOzx7Sb/wyXOXBxM5qOcAeN4TrogvaZ+a+fT4llgmcgItgkcabrgQd6/xce6lfIgpp94aNjsXteFP63R9DQ3vkZ787EGsl3UK2OrAcUPdWeE5M34DOCpHuE7tHYT1cMObPPUMqTSeYM0oonTWiJfCQR7e3+A4xJH9GRk342f0yIIxL9fXCDySp+BGovOHieS5dbn+sTdJJRq3XpOSghGKzA/uJrGJFSDGWd5ixuglUBJ/xE2WP9Qkb8gxlGj3qQ14o6k+k/IiNUlcC06Bjh+n1qGhblFtjzvlmNPVb8TnSq5ESiNW/x9XCR/44kZUuny5aNFsUZBRBIs= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(83380400001)(356005)(2616005)(1076003)(36860700001)(110136005)(8676002)(86362001)(426003)(336012)(316002)(47076005)(81166007)(2906002)(7696005)(5660300002)(54906003)(8936002)(508600001)(186003)(4326008)(36756003)(70586007)(70206006)(6666004)(82310400003)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:38:30.5009 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c69e125-5133-4fc2-97fa-08d98c795ba0 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5273 Cc: Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" ACP is a PCI audio device. This patch adds PCI driver to bind to this device and get PCI resources. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x.h | 21 +++++++++ sound/soc/amd/yc/pci-acp6x.c | 89 ++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 sound/soc/amd/yc/acp6x.h create mode 100644 sound/soc/amd/yc/pci-acp6x.c diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h new file mode 100644 index 000000000000..62a05db5e34c --- /dev/null +++ b/sound/soc/amd/yc/acp6x.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * AMD ALSA SoC PDM Driver + * + * Copyright (C) 2021 Advanced Micro Devices, Inc. All rights reserved. + */ + +#include "acp6x_chip_offset_byte.h" + +#define ACP_DEVICE_ID 0x15E2 +#define ACP6x_PHY_BASE_ADDRESS 0x1240000 + +static inline u32 acp6x_readl(void __iomem *base_addr) +{ + return readl(base_addr - ACP6x_PHY_BASE_ADDRESS); +} + +static inline void acp6x_writel(u32 val, void __iomem *base_addr) +{ + writel(val, base_addr - ACP6x_PHY_BASE_ADDRESS); +} diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c new file mode 100644 index 000000000000..2965e8b00314 --- /dev/null +++ b/sound/soc/amd/yc/pci-acp6x.c @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0+ +// +// AMD Renoir ACP PCI Driver +// +//Copyright 2021 Advanced Micro Devices, Inc. + +#include +#include +#include + +#include "acp6x.h" + +struct acp6x_dev_data { + void __iomem *acp6x_base; +}; + +static int snd_acp6x_probe(struct pci_dev *pci, + const struct pci_device_id *pci_id) +{ + struct acp6x_dev_data *adata; + int ret; + u32 addr; + + /* Yellow Carp device check */ + if (pci->revision != 0x60) + return -ENODEV; + + 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 acp6x_dev_data), + GFP_KERNEL); + if (!adata) { + ret = -ENOMEM; + goto release_regions; + } + + addr = pci_resource_start(pci, 0); + adata->acp6x_base = devm_ioremap(&pci->dev, addr, + pci_resource_len(pci, 0)); + if (!adata->acp6x_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_acp6x_remove(struct pci_dev *pci) +{ + pci_release_regions(pci); + pci_disable_device(pci); +} + +static const struct pci_device_id snd_acp6x_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_AMD, ACP_DEVICE_ID), + .class = PCI_CLASS_MULTIMEDIA_OTHER << 8, + .class_mask = 0xffffff }, + { 0, }, +}; +MODULE_DEVICE_TABLE(pci, snd_acp6x_ids); + +static struct pci_driver yc_acp6x_driver = { + .name = KBUILD_MODNAME, + .id_table = snd_acp6x_ids, + .probe = snd_acp6x_probe, + .remove = snd_acp6x_remove, +}; + +module_pci_driver(yc_acp6x_driver); + +MODULE_AUTHOR("Vijendar.Mukunda@amd.com"); +MODULE_DESCRIPTION("AMD ACP Yellow Carp PCI driver"); +MODULE_LICENSE("GPL v2"); From patchwork Mon Oct 11 05:56:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 794A0C433F5 for ; Mon, 11 Oct 2021 05:40:03 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D16F360F21 for ; Mon, 11 Oct 2021 05:40:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D16F360F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 397301671; Mon, 11 Oct 2021 07:39:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 397301671 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633930801; bh=yByZ5ePUgl+6XZZmewyQzi2GO4l9qu6P0LXBVkIZafs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=M35+Bv4jd6NvIxvcnmbI586XdCxyHMU8nZak18YsJfT7N8xbksCBmweavNn/c3GRN w6ljgvhX74qySwtzxz0QDqc8YDplpx7ZHPbM6nwmxqpO8oA8W3CeoQlXb95uUylVYq ONljqrK2zDPu5WWuw+wHVAf2ttglPLooywIWd9YE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AADE5F8016D; Mon, 11 Oct 2021 07:38:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4E5B8F804E6; Mon, 11 Oct 2021 07:38:53 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2073.outbound.protection.outlook.com [40.107.93.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3C368F8016D for ; Mon, 11 Oct 2021 07:38:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3C368F8016D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="AO7/lA69" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cLc3nquyLzd9njD9zkE+C9OIxPjJMjxScsqwnWZwLN/Chc9/1pfU7l/mIn8fEZq+UMCF9/95wIM/ZYsN8PxmTQsxge5MHM4fchGRePxxvowQH4e5jIGHRntRdKaxq1W8Y0zKZOog/bmOR2RjX/vGULa+7699UbMJ5GCn/Tpn23yRdIsp272MCJedrgtV5VHUkOGfHgc94GGl5p6/VohRpgFD90G/Sw+I+CQAF7RhjffkI03usNsjLzW5nRmsdPEHOSO8Jg4YEJv/iXmUuTBSnpBKo2F7il+Bp0sIkhSkPwyw2wlov1Am/BFRJPB+GtJDUDIafVB3+rXyHahQbFRTcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FFvgQN0DB2DMUD/B6RjasXlc25OcveMTQPFh/i/8JPo=; b=YgzeyoXD/xba4LhZqZRSV/+F0qKFKLPhQxDLTtuG4pQsJM+TYPaHJmWZ2JgRmLUzscmxVyOF5Hg4abUWSZM1CiXteohsdbhPuTngG9V7jyvyHFfFqFUQGBTLBgDwKH8c+vdBD+usMtE6SyQdV6A+d80Dzb9cqRw3kO9qnH+OrPbIjUOPbHqJzLd76LVdj49W928UyQMlU6ii8BCS7tM9rrBasISbTkYfxjEJe+1xd7sqdU5spQ/hYGAqypWyFENHPD9Ag+lWpy72BIaflc0VgpEEaGzbmtdqP7U/0HeVVV2hCtpKq0jk+e9mb7NI1/PCbgWuhy7HdZdryTJiEwb1Tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FFvgQN0DB2DMUD/B6RjasXlc25OcveMTQPFh/i/8JPo=; b=AO7/lA69zquzg2xN8b8OA+BkypLu5i+/Ec43/RNY8r3CcGv0JXFrjhm3uXOoPnCAbGopj155LzbFGbu1L3KksqSJDXx2Ug2VGEePs2lYIrit3Zrr10kSJmIw/JJ48WV3zvbEGWHd2p4vPNSDnlUu5XHmo7qM59iWT9tbBQlc9+0= Received: from MWHPR1701CA0013.namprd17.prod.outlook.com (2603:10b6:301:14::23) by BY5PR12MB4243.namprd12.prod.outlook.com (2603:10b6:a03:20f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Mon, 11 Oct 2021 05:38:42 +0000 Received: from CO1NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:301:14:cafe::b8) by MWHPR1701CA0013.outlook.office365.com (2603:10b6:301:14::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20 via Frontend Transport; Mon, 11 Oct 2021 05:38:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT036.mail.protection.outlook.com (10.13.174.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:38:41 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:38:40 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sun, 10 Oct 2021 22:38:39 -0700 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:38:36 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 03/13] ASoC: amd: add acp6x init/de-init functions Date: Mon, 11 Oct 2021 11:26:11 +0530 Message-ID: <20211011055621.13240-4-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af6f2fa2-b11c-4685-9391-08d98c79626a X-MS-TrafficTypeDiagnostic: BY5PR12MB4243: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:160; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gnHh6zQPVt9qUBvpBsM+sXDNeWYCyQJe6gxKwxEjVkiiBzLItk9jP39sggjHP3C0pRcIf70TAH/9zR+mNaVMd0NDcJ8sm9OjnI4K5fhioGuq6HhTE7YrIciVA4PUBnZeoRPfqadD7H9NwP9c8eIOPyNx/OqZ0dSw4/8xLnlj7LqT6fe9OinbR2ndrWUdW21l7nyyM+1kgnP8NCbgtlS4c97nKxZez7cMK7/1oPHVq4mkFO8Qp4Dr+VcJxpoRgzuIa/mdK/LwkJccTOQ2m0+b4qtQcUsuU0AID2W5waYuaVhR9shZxG5lnfCNMT/tt8eU3YBUr2B65TZw+mEUV1jFd5b9wqYD9DQC8Z5he0DDma2F7Rio1KrTHzHCmwORTZNfa4Q046vr9E9+tJt3091JlPQaaKH87YSITch42frlK+Ar5FuGp6jJdzDFQ62aLJQzvXGafFM1yq2l0fDCCMp5xPlg8t3Qo+PCOgmkJehxAEvlC6NmcsKEY4JFWwmA20qNgXydfhehwSRNa3PTksXbY9OTf34D4a/wIvpPfvqhliHC8OKAMLat15xyt/EETx8Gg9H1540cFCRJkHtNqvSg0FgN7g2yf3XxKtQhKFTtIakK/u3l+o7f/PEKgHvvSqwHFwmB1jzT42rmpeWBvG8Up7TKbnNnc1mEFDMMLvXLN7VCUWXNk6hDaCDS5AJuXzd7wKs6yQvJr1rxfEKM4em2+F+WqPxEpzeUyaZylwFiFuQc8AcvgFAHSXrq8/HUWSxthfRAy/TUDEl2hWzLkDzNUQ== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(316002)(4326008)(70586007)(508600001)(336012)(81166007)(6666004)(110136005)(70206006)(356005)(36860700001)(7696005)(2906002)(186003)(1076003)(47076005)(82310400003)(86362001)(26005)(5660300002)(36756003)(8936002)(2616005)(8676002)(426003)(54906003)(32563001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:38:41.8269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af6f2fa2-b11c-4685-9391-08d98c79626a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4243 Cc: Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add Yellow Carp platform ACP6x PCI driver init/deinit functions. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x.h | 12 ++++ sound/soc/amd/yc/pci-acp6x.c | 109 +++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h index 62a05db5e34c..76e9e860e9bb 100644 --- a/sound/soc/amd/yc/acp6x.h +++ b/sound/soc/amd/yc/acp6x.h @@ -10,6 +10,18 @@ #define ACP_DEVICE_ID 0x15E2 #define ACP6x_PHY_BASE_ADDRESS 0x1240000 +#define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001 +#define ACP_PGFSM_CNTL_POWER_ON_MASK 1 +#define ACP_PGFSM_CNTL_POWER_OFF_MASK 0 +#define ACP_PGFSM_STATUS_MASK 3 +#define ACP_POWERED_ON 0 +#define ACP_POWER_ON_IN_PROGRESS 1 +#define ACP_POWERED_OFF 2 +#define ACP_POWER_OFF_IN_PROGRESS 3 + +#define ACP_ERROR_MASK 0x20000000 +#define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF + static inline u32 acp6x_readl(void __iomem *base_addr) { return readl(base_addr - ACP6x_PHY_BASE_ADDRESS); diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c index 2965e8b00314..56fd7cdbc442 100644 --- a/sound/soc/amd/yc/pci-acp6x.c +++ b/sound/soc/amd/yc/pci-acp6x.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "acp6x.h" @@ -14,6 +15,103 @@ struct acp6x_dev_data { void __iomem *acp6x_base; }; +static int acp6x_power_on(void __iomem *acp_base) +{ + u32 val; + int timeout; + + val = acp6x_readl(acp_base + ACP_PGFSM_STATUS); + + if (val == 0) + return val; + + if ((val & ACP_PGFSM_STATUS_MASK) != ACP_POWER_ON_IN_PROGRESS) + acp6x_writel(ACP_PGFSM_CNTL_POWER_ON_MASK, acp_base + ACP_PGFSM_CONTROL); + timeout = 0; + while (++timeout < 500) { + val = acp6x_readl(acp_base + ACP_PGFSM_STATUS); + if (!val) + return 0; + udelay(1); + } + return -ETIMEDOUT; +} + +static int acp6x_reset(void __iomem *acp_base) +{ + u32 val; + int timeout; + + acp6x_writel(1, acp_base + ACP_SOFT_RESET); + timeout = 0; + while (++timeout < 500) { + val = acp6x_readl(acp_base + ACP_SOFT_RESET); + if (val & ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK) + break; + cpu_relax(); + } + acp6x_writel(0, acp_base + ACP_SOFT_RESET); + timeout = 0; + while (++timeout < 500) { + val = acp6x_readl(acp_base + ACP_SOFT_RESET); + if (!val) + return 0; + cpu_relax(); + } + return -ETIMEDOUT; +} + +static void acp6x_enable_interrupts(void __iomem *acp_base) +{ + acp6x_writel(0x01, acp_base + ACP_EXTERNAL_INTR_ENB); +} + +static void acp6x_disable_interrupts(void __iomem *acp_base) +{ + acp6x_writel(ACP_EXT_INTR_STAT_CLEAR_MASK, acp_base + + ACP_EXTERNAL_INTR_STAT); + acp6x_writel(0x00, acp_base + ACP_EXTERNAL_INTR_CNTL); + acp6x_writel(0x00, acp_base + ACP_EXTERNAL_INTR_ENB); +} + +static int acp6x_init(void __iomem *acp_base) +{ + int ret; + + /* power on */ + ret = acp6x_power_on(acp_base); + if (ret) { + pr_err("ACP power on failed\n"); + return ret; + } + acp6x_writel(0x01, acp_base + ACP_CONTROL); + /* Reset */ + ret = acp6x_reset(acp_base); + if (ret) { + pr_err("ACP reset failed\n"); + return ret; + } + acp6x_writel(0x03, acp_base + ACP_CLKMUX_SEL); + acp6x_enable_interrupts(acp_base); + return 0; +} + +static int acp6x_deinit(void __iomem *acp_base) +{ + int ret; + + acp6x_disable_interrupts(acp_base); + /* Reset */ + ret = acp6x_reset(acp_base); + if (ret) { + pr_err("ACP reset failed\n"); + return ret; + } + acp6x_writel(0x00, acp_base + ACP_CLKMUX_SEL); + acp6x_writel(0x00, acp_base + ACP_CONTROL); + return 0; +} + static int snd_acp6x_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { @@ -52,6 +150,10 @@ static int snd_acp6x_probe(struct pci_dev *pci, } pci_set_master(pci); pci_set_drvdata(pci, adata); + ret = acp6x_init(adata->acp6x_base); + if (ret) + goto release_regions; + return 0; release_regions: pci_release_regions(pci); @@ -63,6 +165,13 @@ static int snd_acp6x_probe(struct pci_dev *pci, static void snd_acp6x_remove(struct pci_dev *pci) { + struct acp6x_dev_data *adata; + int ret; + + adata = pci_get_drvdata(pci); + ret = acp6x_deinit(adata->acp6x_base); + if (ret) + dev_err(&pci->dev, "ACP de-init failed\n"); pci_release_regions(pci); pci_disable_device(pci); } From patchwork Mon Oct 11 05:56:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5F47C433FE for ; Mon, 11 Oct 2021 05:40:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A56B60F35 for ; Mon, 11 Oct 2021 05:40:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1A56B60F35 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 79C351691; Mon, 11 Oct 2021 07:39:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 79C351691 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633930818; bh=g5Ex7gK8/l9eTYl9BgtJLt8jO0Afa6OyNBssB9vN4s4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SBFtILkd4+jlm+vhN+GnNVn0HE7F2L3wg6cY3RNxvSF25jAyPuGz8wSHG2ueP2krX N+sEq1olo+tC5Z4o07bWWJzcZZGujFmRSL+BD7YdQU0h72yUHQd/vsxMAR89UmY9V7 G7slHRZ8nl+FBaMBtQrjaZLRf4jqf26nGHAvLHp0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6FADEF80430; Mon, 11 Oct 2021 07:39:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BF898F804E2; Mon, 11 Oct 2021 07:39:02 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2070.outbound.protection.outlook.com [40.107.94.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 88319F8028D for ; Mon, 11 Oct 2021 07:38:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 88319F8028D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="v31nQW1y" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GeIh2zaOP1mUo1XZ0Jk3ppYLzEJaHslXcMYuOCymrAQm5rJAbb5xPdFpsjnqox/ZY2MYQ/OJA2OW/twUzbz0GyPKwMCmxL4bxHwVm1PzCjI7vHbqW10rOCUdrJG7Sy6oJgKqqNKbJGmTMdSWata0xNwfrnwx+5O0hhPUR73ixwDqIwfvWbxNikMC/ChB2Q7sINGnrmDatpm3WszE5VzxsIQLVIK1adBscszwG+4ioKiAb5T3A4V2a1chOWIFyYV5kbXfs1mI7cUbAD669lGFFVIlBxH+3I0lLgHkMCYZEcpBmvezfIsc1jV4tcSnzsnwrajp+rzg4OPPA+fIGBZJmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PTorS6TE1MOUe5xzZCe5FwZ1vWNzb4SqytDu1K4+878=; b=au7HnVPs3HSxddsM/zKHwQf3reKmbVUBMNpSvJz72J6jjQYdQjq5cXruqPf20mBz2Z2Qau5JPHF7qa4crcIBCjLnzyUu9U56si1geh8m2aSe9cwx4kc36+2s2EMzJQQR5KElm2ytefGtZFXEiFimQUk8kzHTE5zMNXDtBprMlkdblYozGyOcMufiPdLzC5c6OsGey64g4eV45pcdvo1U3c7/LeXHAGjtkbfZGPfdRR4SQ9RC0kjpUBIye3aE/IOjpO59hwvgHw/YUmrE4ud4ChHcE6rKuq5FdCfyZWG7huCtszo17PwU0nUZN7vRUeJ8xsEA9K3uVR0ladNLq8es+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PTorS6TE1MOUe5xzZCe5FwZ1vWNzb4SqytDu1K4+878=; b=v31nQW1yfCE403N2tLxsHogbDsK+pUdZ3uJxgjCZVXLgxXziecMOhpwQ745BcOGDhSbDX/Yb63l4wz01u9R50SVNYvMPbjc3NUJuEka/b3LM+1XGA/BBGb2eBnnFZchiV8/AlB+Vt+LCk9xNdqy+lRuMudv4k/o6/NeEskefiwk= Received: from DM5PR19CA0045.namprd19.prod.outlook.com (2603:10b6:3:9a::31) by DM4PR12MB5295.namprd12.prod.outlook.com (2603:10b6:5:39f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Mon, 11 Oct 2021 05:38:52 +0000 Received: from DM6NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:3:9a:cafe::48) by DM5PR19CA0045.outlook.office365.com (2603:10b6:3:9a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:38:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT068.mail.protection.outlook.com (10.13.173.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:38:51 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:38:50 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sun, 10 Oct 2021 22:38:50 -0700 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:38:46 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 04/13] ASoC: amd: add platform devices for acp6x pdm driver and dmic driver Date: Mon, 11 Oct 2021 11:26:12 +0530 Message-ID: <20211011055621.13240-5-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec7f8962-a5b1-4bec-ec1d-08d98c796858 X-MS-TrafficTypeDiagnostic: DM4PR12MB5295: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZFkzVWHKjfUNBd/cDSHuhkNngIPqMSmwdvN8YLwStbBkDM3sgwtEnr7EXg9PWJyHw6ikr83PJPozr2e8lssPwltGngfGZmdKi5Tc6a2D55YercZ25h9Ch0HTKLFGkSRaHkjIYtB24SU8ZVC6gGS6bMbGCIhiF9DjQOvuLnwcHyoi0JkioM+Juwoql/ZG1LDBl7CrG70O5FTgeWkCgNovhMUPDZwEWUmuUYBU9w3QeCd0Gbsgrbo0AUA61zjmrK2qhM8Gd9Q52IDdpfJONnv5KiV8A+qgl4GA75gszHPUwGMsVXfE4uwTtTF29rF3HqYST0ixRlHsVIc0V8U92rHMn9y/zK2sa9pzXQ3KRP7yKEG0Q3aOnEaQoZY2wDtlGRFtleNeV2hTwTu2FHazTLEJmK8G9PeZDN5yG3ox/a+Cl0v/1Kg9kHJtQIPksYZlGMgUBI/EWaZN6pSh1b3QLl5rzid8G8Mr4et/YXAxwgzmyUIs+khewYF4dtT5EWzsgeSzWY3geaLnRlrSE7KpMYFcBuVOCUtCmGaKv4h67QLfa8l4pPew4NiZ80BsQrUUDuuB9N903aw3zPASvUUugZ824Y7e5HqmBW+aLHUEFyV+sTcInCqRjapgHNj9jtSSzvVDtunIgLv7tbWVX2c3sOkQz7HxMAmLbY/IktwrQQutghnEh3PBGEZtLDkn0BP7SmaZr9dDaCyil4iwAbdrlcT3iMFgeXChh0ZP0meGPbkoY6YPieeRrVJTJlpaD/pKSB6sdjEAdIHFvu3ZHJShuaCLVg== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(8676002)(110136005)(8936002)(86362001)(4326008)(54906003)(36756003)(316002)(83380400001)(82310400003)(47076005)(1076003)(6666004)(36860700001)(81166007)(2906002)(356005)(70206006)(70586007)(426003)(186003)(336012)(26005)(508600001)(2616005)(5660300002)(7696005)(32563001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:38:51.8435 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec7f8962-a5b1-4bec-ec1d-08d98c796858 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT068.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5295 Cc: Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" ACP6.x IP has PDM decoder block. Create a platform device for it, so that the PDM platform driver can be bound to this device. Pass PCI resources like MMIO to this platform device. Create a platform device for generic dmic codec driver. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x.h | 23 ++++++++++++ sound/soc/amd/yc/pci-acp6x.c | 68 ++++++++++++++++++++++++++++++++++-- 2 files changed, 89 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h index 76e9e860e9bb..63bdea3188ea 100644 --- a/sound/soc/amd/yc/acp6x.h +++ b/sound/soc/amd/yc/acp6x.h @@ -9,6 +9,10 @@ #define ACP_DEVICE_ID 0x15E2 #define ACP6x_PHY_BASE_ADDRESS 0x1240000 +#define ACP6x_REG_START 0x1240000 +#define ACP6x_REG_END 0x1250200 +#define ACP6x_DEVS 2 +#define ACP6x_PDM_MODE 1 #define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001 #define ACP_PGFSM_CNTL_POWER_ON_MASK 1 @@ -22,6 +26,25 @@ #define ACP_ERROR_MASK 0x20000000 #define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF +enum acp_config { + ACP_CONFIG_0 = 0, + ACP_CONFIG_1, + ACP_CONFIG_2, + ACP_CONFIG_3, + ACP_CONFIG_4, + ACP_CONFIG_5, + ACP_CONFIG_6, + ACP_CONFIG_7, + ACP_CONFIG_8, + ACP_CONFIG_9, + ACP_CONFIG_10, + ACP_CONFIG_11, + ACP_CONFIG_12, + ACP_CONFIG_13, + ACP_CONFIG_14, + ACP_CONFIG_15, +}; + static inline u32 acp6x_readl(void __iomem *base_addr) { return readl(base_addr - ACP6x_PHY_BASE_ADDRESS); diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c index 56fd7cdbc442..26c8d652fd08 100644 --- a/sound/soc/amd/yc/pci-acp6x.c +++ b/sound/soc/amd/yc/pci-acp6x.c @@ -8,11 +8,15 @@ #include #include #include +#include #include "acp6x.h" struct acp6x_dev_data { void __iomem *acp6x_base; + struct resource *res; + bool acp6x_audio_mode; + struct platform_device *pdev[ACP6x_DEVS]; }; static int acp6x_power_on(void __iomem *acp_base) @@ -116,7 +120,9 @@ static int snd_acp6x_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { struct acp6x_dev_data *adata; - int ret; + struct platform_device_info pdevinfo[ACP6x_DEVS]; + int ret, index; + int val = 0x00; u32 addr; /* Yellow Carp device check */ @@ -153,8 +159,62 @@ static int snd_acp6x_probe(struct pci_dev *pci, ret = acp6x_init(adata->acp6x_base); if (ret) goto release_regions; + val = acp6x_readl(adata->acp6x_base + ACP_PIN_CONFIG); + switch (val) { + case ACP_CONFIG_0: + case ACP_CONFIG_1: + case ACP_CONFIG_2: + case ACP_CONFIG_3: + case ACP_CONFIG_9: + case ACP_CONFIG_15: + dev_info(&pci->dev, "Audio Mode %d\n", val); + break; + default: + adata->res = devm_kzalloc(&pci->dev, + sizeof(struct resource), + GFP_KERNEL); + if (!adata->res) { + ret = -ENOMEM; + goto de_init; + } + + adata->res->name = "acp_iomem"; + adata->res->flags = IORESOURCE_MEM; + adata->res->start = addr; + adata->res->end = addr + (ACP6x_REG_END - ACP6x_REG_START); + + adata->acp6x_audio_mode = ACP6x_PDM_MODE; + + memset(&pdevinfo, 0, sizeof(pdevinfo)); + pdevinfo[0].name = "acp_yc_pdm_dma"; + pdevinfo[0].id = 0; + pdevinfo[0].parent = &pci->dev; + pdevinfo[0].num_res = 1; + pdevinfo[0].res = adata->res; + + pdevinfo[1].name = "dmic-codec"; + pdevinfo[1].id = 0; + pdevinfo[1].parent = &pci->dev; + for (index = 0; index < ACP6x_DEVS; index++) { + adata->pdev[index] = + platform_device_register_full(&pdevinfo[index]); + if (IS_ERR(adata->pdev[index])) { + dev_err(&pci->dev, "cannot register %s device\n", + pdevinfo[index].name); + ret = PTR_ERR(adata->pdev[index]); + goto unregister_devs; + } + } + break; + } return 0; +unregister_devs: + for (--index; index >= 0; index--) + platform_device_unregister(adata->pdev[index]); +de_init: + if (acp6x_deinit(adata->acp6x_base)) + dev_err(&pci->dev, "ACP de-init failed\n"); release_regions: pci_release_regions(pci); disable_pci: @@ -166,9 +226,13 @@ static int snd_acp6x_probe(struct pci_dev *pci, static void snd_acp6x_remove(struct pci_dev *pci) { struct acp6x_dev_data *adata; - int ret; + int ret, index; adata = pci_get_drvdata(pci); + if (adata->acp6x_audio_mode == ACP6x_PDM_MODE) { + for (index = 0; index < ACP6x_DEVS; index++) + platform_device_unregister(adata->pdev[index]); + } ret = acp6x_deinit(adata->acp6x_base); if (ret) dev_err(&pci->dev, "ACP de-init failed\n"); From patchwork Mon Oct 11 05:56:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C7C0C433F5 for ; Mon, 11 Oct 2021 05:40:51 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A1FD660230 for ; Mon, 11 Oct 2021 05:40:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A1FD660230 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 97D9F1673; Mon, 11 Oct 2021 07:39:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 97D9F1673 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633930848; bh=y4UkV6P3OCYyZgyzVfSQmzvM/17hzdVC0OwqjvF2QJo=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BoVroB/pq7Oth0Q+d0Q2P0j0m/79xJ8nGJqFIjaBkRpoxY/ECz5jNR87XtMGul+UK 6+avLW0I/YcBS3yJ4XdF27wOc7VruTf40UMNQGjWjI3yU8d3K+TmnB3nDxSn+0wG2s j/no8UJI9BK2Vdz4r6qpNd68cp/7X7b7yPaKydME= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 21380F804FD; Mon, 11 Oct 2021 07:39:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5195DF804FE; Mon, 11 Oct 2021 07:39:19 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2086.outbound.protection.outlook.com [40.107.236.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AC291F804E5 for ; Mon, 11 Oct 2021 07:39:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AC291F804E5 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="sINpf8os" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V7upO487lgulz7wbT8P3NMAwxNAiLWwVBXTXP1bR9O04/PFJBJJ5sXMjSo9quWo7QOPtaopKCiHba1YzCQdsKeh/JonrkzCSASIT2me18KTNYgGqm0t6JUaUEN6yX6jZmYZkSUHepF7kWZ/vR3TLgblTAtjipYYPDNTSpGtWOgs1XtxSKQCAHRfpblpX22xHerT+N8sixlHhW8FkcKEi7akLYPFTj9wM5LsQ6bdrYUeU0UIN0dLFhhNvtr32YKAaQ7yToVJ/lP7UT2SqQQlBfBOapDJHBcvCPsdINVoA7jRuRcYl1HCubw4HUfKj46ZLag7q/4KAwtFrbkv/QEUl6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PD7AmQRaOH7b12a1/4ruSuM2VuXVXIKtTO126TURZDI=; b=exRpXUW9D+gK7ticnpuzcCxvdxwZuFpY5mM6rNJaFs+UNg7gKeFR6v3Pod52Dx3l2qmWggiTbs5IyrW79I8pe4JDc9eALw8znt5b0hBgXC2iLkOx7/678XE2uI7LYZRJz0IzvSr+2j+nwS1KWTRXKFu7vIEw2LkRC9g2jvlhzd5jtYwblngPZRJ+/aYFZu6vfp6kvyn/ZDImSQ8xNTK5hBXElv+GrrCdR0kVC2efkZKdAmz6RKKfan585ZjERqRPueciDfnuFyRBEJ4rqibmM1tsK92UfbDQeTOGvfKi9f55u57b4Vibdlu4oA/SdMA3JpzHIl1Bot976XvRm0Lkxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PD7AmQRaOH7b12a1/4ruSuM2VuXVXIKtTO126TURZDI=; b=sINpf8oswO5FcnIY4jKhf2OXpgfXeXeK+Cf4KvLc7oSTqKDwWiFaEboqNcwYHCKzcBQskPyvMZpqthjDEMdxA7eCQhTiMZh2nMP1j/384uUPLjEDahJgOHg5ERXi2TCQxaDSWICgiD0OuTpzyggXNgKM3jkR5g8Z3uuCzjJGpJI= Received: from MW4PR04CA0255.namprd04.prod.outlook.com (2603:10b6:303:88::20) by BN6PR12MB1458.namprd12.prod.outlook.com (2603:10b6:405:d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Mon, 11 Oct 2021 05:39:05 +0000 Received: from CO1NAM11FT041.eop-nam11.prod.protection.outlook.com (2603:10b6:303:88:cafe::92) by MW4PR04CA0255.outlook.office365.com (2603:10b6:303:88::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:39:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT041.mail.protection.outlook.com (10.13.174.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:39:04 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:00 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sun, 10 Oct 2021 22:39:00 -0700 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:38:56 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 05/13] ASoC: amd: add acp6x pdm platform driver Date: Mon, 11 Oct 2021 11:26:13 +0530 Message-ID: <20211011055621.13240-6-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be4c2996-d801-4dcc-ccc4-08d98c79700f X-MS-TrafficTypeDiagnostic: BN6PR12MB1458: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:38; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XKQsoEvImZdiGKoJ66ZoE/ns6RGy7mFtX351AYC1FckGauQY6T5pFnJeWL45ojFoxnGHECNGeNQupqO3Tf4n3SM21B/LisZu1X4hGg4o2taiSBb2vj2yN89wnaU6je1x/v0Iznhuho2gAZ/nfhFsvOPgtHPgHWasgGM8E8bjYRZCQm3OA9vuFTz/2shGbm60a2bbS1TRXmudgn5kVs3WT7gT8v4TqrQcNoCk90yt8IgMXHyctS2yR4ps61gSpDDybvnnhH5bz8ml+gfoLKcb+2uKH7vUEli6yamjIyplIUH2JduC4OEScuxqaZXtZjS7NPfTrRY5al0dY+a4W8DcDhaoM3wD/jQ+1SGJvdqyRj0XBwK/84o/e09cwJAzR7sSYYKZIBDCogg5mRNJLGHhhiAfHNTtOXJiw1FNEWz0ZFchoI1cyX6fOtgKDs3SLhtFDMbDA93AsbfpjeLH25BF57hrZFObU1PuzwKf26H1TZeb2k2b8CaCKwyzAVd4wHsWK42VObF4SREJ4CdLVTHKdqj3zWvOy2rTxwv6biMz8v6l/cPRmgyYBYtiXJShXonORmkCsIgtkFh4etcnM0ol0mfz6x5YiqpHWwpk4ZlmFH267MaoKgRMLw+dQ5mo4YN83ljwE2Dz6c4QEekfMPg8sHUjdizpl6nL7N+zqo5GGrbvEYJDoHOd1+xcjs91H2P6emlGutAqfnoo1uzOgCmKPoC/szDC6rcu9LHtavL1rAx037EZIByFkvHIxSshJBDjzbCYbaRtfLZ6d+9grbSXtA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(336012)(8676002)(82310400003)(81166007)(6666004)(5660300002)(186003)(316002)(36860700001)(508600001)(86362001)(426003)(110136005)(70206006)(36756003)(2906002)(70586007)(26005)(2616005)(356005)(47076005)(1076003)(4326008)(54906003)(8936002)(7696005)(32563001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:39:04.7111 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be4c2996-d801-4dcc-ccc4-08d98c79700f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT041.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1458 Cc: Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" PDM platform driver binds to the platform device created by ACP6x PCI device. PDM driver registers ALSA DMA and CPU DAI components with ASoC framework. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x-pdm-dma.c | 80 ++++++++++++++++++++++++++++++++ sound/soc/amd/yc/acp6x.h | 5 ++ 2 files changed, 85 insertions(+) create mode 100644 sound/soc/amd/yc/acp6x-pdm-dma.c diff --git a/sound/soc/amd/yc/acp6x-pdm-dma.c b/sound/soc/amd/yc/acp6x-pdm-dma.c new file mode 100644 index 000000000000..e1a25268bc5c --- /dev/null +++ b/sound/soc/amd/yc/acp6x-pdm-dma.c @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-2.0+ +// +// AMD ALSA SoC Yellow Carp PDM Driver +// +//Copyright 2021 Advanced Micro Devices, Inc. + +#include +#include +#include +#include +#include +#include +#include + +#include "acp6x.h" + +#define DRV_NAME "acp_yc_pdm_dma" + +static struct snd_soc_dai_driver acp6x_pdm_dai_driver = { + .capture = { + .rates = SNDRV_PCM_RATE_48000, + .formats = SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 48000, + .rate_max = 48000, + }, +}; + +static const struct snd_soc_component_driver acp6x_pdm_component = { + .name = DRV_NAME, +}; + +static int acp6x_pdm_audio_probe(struct platform_device *pdev) +{ + struct resource *res; + struct pdm_dev_data *adata; + int status; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n"); + return -ENODEV; + } + + adata = devm_kzalloc(&pdev->dev, sizeof(*adata), GFP_KERNEL); + if (!adata) + return -ENOMEM; + + adata->acp6x_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!adata->acp6x_base) + return -ENOMEM; + + adata->capture_stream = NULL; + + dev_set_drvdata(&pdev->dev, adata); + status = devm_snd_soc_register_component(&pdev->dev, + &acp6x_pdm_component, + &acp6x_pdm_dai_driver, 1); + if (status) { + dev_err(&pdev->dev, "Fail to register acp pdm dai\n"); + + return -ENODEV; + } + return 0; +} + +static struct platform_driver acp6x_pdm_dma_driver = { + .probe = acp6x_pdm_audio_probe, + .driver = { + .name = "acp_yc_pdm_dma", + }, +}; + +module_platform_driver(acp6x_pdm_dma_driver); + +MODULE_AUTHOR("Vijendar.Mukunda@amd.com"); +MODULE_DESCRIPTION("AMD ACP6x YC PDM Driver"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h index 63bdea3188ea..d6b2c70ce9c8 100644 --- a/sound/soc/amd/yc/acp6x.h +++ b/sound/soc/amd/yc/acp6x.h @@ -45,6 +45,11 @@ enum acp_config { ACP_CONFIG_15, }; +struct pdm_dev_data { + void __iomem *acp6x_base; + struct snd_pcm_substream *capture_stream; +}; + static inline u32 acp6x_readl(void __iomem *base_addr) { return readl(base_addr - ACP6x_PHY_BASE_ADDRESS); From patchwork Mon Oct 11 05:56:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86618C433F5 for ; Mon, 11 Oct 2021 05:41:12 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DCFCB60F35 for ; Mon, 11 Oct 2021 05:41:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DCFCB60F35 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DD26D1696; Mon, 11 Oct 2021 07:40:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DD26D1696 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633930867; bh=VfuAogGRYHW/MBMudAR1pRIEzzeYp74+7qSHgFMGqlE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qH8aGbQa4rK1kh7jOzOz4W4D+NqOkx4OAL7T9vSK8ZH5BmBNCpDNuLi5v0wBOfqHX JMKP016r5u2YpQI7CLRqZczW4QO8nB7iTYpAJa/VsQiAx7y/iDz9uFj/n5MOWUZNI6 mewhdXEKxscBUpQaQtkgQRPwyqhLrvCR07B9OES0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B0018F80506; Mon, 11 Oct 2021 07:39:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 002CDF80507; Mon, 11 Oct 2021 07:39:22 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2051.outbound.protection.outlook.com [40.107.237.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C5283F804FB for ; Mon, 11 Oct 2021 07:39:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C5283F804FB Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ADV5izI6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CndeyrEdfvPcCmYjMbsSxcC5aayCabh2XPu9eID6HFZrFCrt75eGv91N8c0LUsFJIVcC91k2uyj3flw/G7aJl0RzeH/nGA1QdPtrTPxjq7IXr0WfKj5OpmYBIL60tg+bEp7oDKqMNY8xErZkhq90sxpBqOrHlsyhWlaM52214hzYnTq7S+UjVSD1gGVr3Ky14IdEKH2s3/9IFmRaJD7iaT59b003mhw2eMMT9W+cD/bKuzG2NtQi+0jmNh1KXAdWEebO6u3IecCKRudo7JEdEpF8KzfVjQ5JtiwxkHk63ST03UOdc5EuMEICQ+edeRVC0Og3QuvW3CKvnhOSVE3hxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GwPQx5COo81YES06ebaC2WmNpLcU0Dcrq2Lp9un263Q=; b=TAWJaJOqpHUug4UlpwhT83pIXqk+olrnImymqjRGiJNDLE7aaHIPVrYdvbiwprFZh1t3j3RLMRMqKrY9pnm3SILlZqwLaKkjm9gKPynUD5sXAhFwgTh76pf2IAgFyOWyYsGoIeR2tDpr4RDz67aU0rNEpQtxX4F65EA1iQRRAgAtuBhOVGXbKJZXncFx9a+eWEHZ1dOhXv0hKFTn24mbX9gixW64OV8gMiuaRjwhn0yzz8DgOhDtGGe7YxNYOby55rN3dLufmd7WOiOcaAlNdGv8CZ3U5dCv5y28omREYaoJLS4L3TKJV+IN9XSIfJ+jogN9iXBB8eMLdXF1arOMwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GwPQx5COo81YES06ebaC2WmNpLcU0Dcrq2Lp9un263Q=; b=ADV5izI6v2yaabgwdi8waVyBDQUAS8ROE0ZboMFDnl8KZxxUnzVl0XJwkgx4RFJxE2y8+OjAAplo1b2XV9/JQfic7YcFl8H9QZlzKzXpng0jZrHZpnXXVNvUmkevk743ss238tt/U+rctpzYKfLN3jZMXx+7FmTds4fhffBiOJs= Received: from MWHPR1701CA0003.namprd17.prod.outlook.com (2603:10b6:301:14::13) by BN8PR12MB3380.namprd12.prod.outlook.com (2603:10b6:408:43::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Mon, 11 Oct 2021 05:39:13 +0000 Received: from CO1NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:301:14:cafe::43) by MWHPR1701CA0003.outlook.office365.com (2603:10b6:301:14::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:39:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT036.mail.protection.outlook.com (10.13.174.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:39:12 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:11 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:10 -0500 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:39:07 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 06/13] ASoC: amd: add acp6x irq handler Date: Mon, 11 Oct 2021 11:26:14 +0530 Message-ID: <20211011055621.13240-7-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b91f3956-eedf-4963-ea47-08d98c797499 X-MS-TrafficTypeDiagnostic: BN8PR12MB3380: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U9bhCvwjfd6yCfKfTV/r/SLxbb4VEYbzZFMgcGZo0IsB6aDH2jQeL7PdPjW1/OAzM1bu/0M6SjHgFOwnYydGjaXnT92GPmefzv33IwOBkhSHBlLGXuZuzOn78+ilgLMfOqiVboJHZrXrrzX0ygXCIHB/6Q8QCcVfHBY3GZpFW7ChgK5G9UAtIKw7l+gmKJvosrNf9pJXwd0XfhOyHVcdLolrIjkv1Zw1Nv03EpKzByflcqDNtDd3Eh9QFeRhEVKLt/VzjPB35oGACvaHNgCRb8nNREZhrC6KyGjSF7UdSbPpvAinXXaIBofZQtHifkj7nr9dNP8LdquQYA2Jw+/rcjVIJodB9V2I4gVAE11wmzoDsizWi262D6f1qeQW2ziQo5n1TeMvcc6lnxNbqMnmUjPYq7qLDnFLjavGDy/JxQLhz1wtD6j4BbyoVcOI2+dKnMcajUdY7lgenq1Ce37ydFlrIlNDLCXDL5nVnSf54WqoiHGHWopcaA4C0WkKAT4Lo1lp/dc89w4FbbnDaGy1t/b1+NMdxqBJgjHPOZ4iUY4Bwb7mH91hdlcD7Uq1RcCBOMRc9p99yqQV94zAVXg9gOSZhrEovmPBA/Z+gDOM6rvVc2w92nrbdh4MbItjQED9rUBwmJwWd6fscDT5RDt8SrK2ChpBfBNQE3ooj5zSrtoGj29/R44OGn83m/JQOKKtI1eXhAHWc6rUT7Kb2ZZfNUCoCG5wyDoMWkQD6olz3L7M7kQhrmTFdZMIswEPUUGjBYIrd9EOxokJQ6eJ1VeGwQ== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(70206006)(70586007)(2906002)(5660300002)(36756003)(4326008)(110136005)(2616005)(1076003)(8676002)(82310400003)(508600001)(316002)(47076005)(186003)(26005)(83380400001)(336012)(6666004)(8936002)(36860700001)(7696005)(356005)(81166007)(86362001)(54906003)(426003)(32563001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:39:12.3362 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b91f3956-eedf-4963-ea47-08d98c797499 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3380 Cc: Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add ACP6x irq handler for handling irq events for ACP IP. Add pdm irq events handling. Whenever audio data equal to the PDM watermark level are consumed, interrupt is generated. Acknowledge the interrupt. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x.h | 2 ++ sound/soc/amd/yc/pci-acp6x.c | 37 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h index d6b2c70ce9c8..4ea37794db84 100644 --- a/sound/soc/amd/yc/acp6x.h +++ b/sound/soc/amd/yc/acp6x.h @@ -25,6 +25,7 @@ #define ACP_ERROR_MASK 0x20000000 #define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF +#define PDM_DMA_STAT 0x10 enum acp_config { ACP_CONFIG_0 = 0, @@ -46,6 +47,7 @@ enum acp_config { }; struct pdm_dev_data { + u32 pdm_irq; void __iomem *acp6x_base; struct snd_pcm_substream *capture_stream; }; diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c index 26c8d652fd08..86b33f401e12 100644 --- a/sound/soc/amd/yc/pci-acp6x.c +++ b/sound/soc/amd/yc/pci-acp6x.c @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include "acp6x.h" @@ -116,6 +118,33 @@ static int acp6x_deinit(void __iomem *acp_base) return 0; } +static irqreturn_t acp6x_irq_handler(int irq, void *dev_id) +{ + struct acp6x_dev_data *adata; + struct pdm_dev_data *yc_pdm_data; + u16 irq_flag; + u32 val; + + adata = dev_id; + if (!adata) + return IRQ_NONE; + + irq_flag = 0; + val = acp6x_readl(adata->acp6x_base + ACP_EXTERNAL_INTR_STAT); + if (val & BIT(PDM_DMA_STAT)) { + yc_pdm_data = dev_get_drvdata(&adata->pdev[0]->dev); + acp6x_writel(BIT(PDM_DMA_STAT), adata->acp6x_base + ACP_EXTERNAL_INTR_STAT); + if (yc_pdm_data->capture_stream) + snd_pcm_period_elapsed(yc_pdm_data->capture_stream); + irq_flag = 1; + } + + if (irq_flag) + return IRQ_HANDLED; + else + return IRQ_NONE; +} + static int snd_acp6x_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { @@ -124,7 +153,9 @@ static int snd_acp6x_probe(struct pci_dev *pci, int ret, index; int val = 0x00; u32 addr; + unsigned int irqflags; + irqflags = IRQF_SHARED; /* Yellow Carp device check */ if (pci->revision != 0x60) return -ENODEV; @@ -208,6 +239,12 @@ static int snd_acp6x_probe(struct pci_dev *pci, } break; } + ret = devm_request_irq(&pci->dev, pci->irq, acp6x_irq_handler, + irqflags, "ACP_PCI_IRQ", adata); + if (ret) { + dev_err(&pci->dev, "ACP PCI IRQ request failed\n"); + goto unregister_devs; + } return 0; unregister_devs: for (--index; index >= 0; index--) From patchwork Mon Oct 11 05:56:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF1EEC433F5 for ; Mon, 11 Oct 2021 05:41:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 391B460F35 for ; Mon, 11 Oct 2021 05:41:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 391B460F35 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9BEA61694; Mon, 11 Oct 2021 07:40:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9BEA61694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633930887; bh=y7iDYMOs1AiHnbn6QanVKDybIyXNGDMe4bcfn28Sp9k=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PTbYgGXEWQirBQydOmZWOy/GH1NkZv47w+y1wtIPB1f0FgWbnBLp65YIV7epcenh/ e970ve7bHF09M/qyZQCstGgsGPz64/1MIZk2Ohiq3pxg0AAXuHyVRW7UEQiP9N1GNy Y6DC5Nz05T95mDVzE20e6FcRM8b+2vJPFav+uKf0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 68167F8050F; Mon, 11 Oct 2021 07:39:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 21609F80510; Mon, 11 Oct 2021 07:39:31 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2069.outbound.protection.outlook.com [40.107.94.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8A57DF80290 for ; Mon, 11 Oct 2021 07:39:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8A57DF80290 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="WuutJTUj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dHEDj6YG1cZHSXdTReO/UkVpwCAX0ngAp53vv+hBX5CuL2iIvtUia+gdp8Jd0vYMhvORaEgxcSZB+NeLufTmeXUek3CfFjXv/8eL7ZlYgio0nTb9inKQ40cdhDtAwTDIkT1XB9Tgn0F84kLnu+Js78R2cFMR5bIGvDJTvt/gWDHJtCd+n9hUgvb2aO2vjNqjsSEDiynzRme0g322XVFDGsgXWQ1p7+uWfmhbGfJxOfBQKELd/xVM6ii2eIpdDc6n84cjregFWTmoZh7ZVseIbD2R3lva/xYqXIIZCkK0pDcf96giE04jyF+85/PCdEK0VCRr3nCERmlbW4DUw0zAeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Q0n4aB9ikXHu5tOM1bfHReVF3pA4UHaVbk2P3BVirvQ=; b=Yicjb37/mGsHfmvfD40wav9dl8SaIPg/T1CZzUrzsPGu520nHeod4ZIoCxEyBXXkOA18q59aH/ac+DkEr0YKJD5fkhhAst9naxc5w3MA0EWhj3SNuJYz1pR/Wna2UmOkjgWQtkXfmkzF8ujgLGR+COsPL2j6X82p7ZscXISRM7yL6fizXpnkHRlCgzznWkg8lb6agCHlM7qYeD4gvG+x4WqSGi6bbLPjEPr7oUfQf0gcIgkWJuYtkpt3mTMEkmqcbMFIPUbwe5zBdDG76ly8N1DX1gzA8+f0yazqYq07Dq1w+qufA04o+BtiLQl1Nk19p2e48xANueFfyRzfbqfsCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q0n4aB9ikXHu5tOM1bfHReVF3pA4UHaVbk2P3BVirvQ=; b=WuutJTUj4D8ajGgq2ch3Arw/+ttzWqnDkHrbHrwh0wiG4u/Qu3gyROBFcGantzcMSM2Ktq/mKjkGzIE3n3tW0EB/G8LSlC8rVfjXIWojABRjF0ZqLHtmRvdJl5H4sgE3XFkNQiGDx3u+zyyyinFdj9H/lhORbgzLW6fyuKs0ShM= Received: from MW4PR04CA0145.namprd04.prod.outlook.com (2603:10b6:303:84::30) by BN8PR12MB2865.namprd12.prod.outlook.com (2603:10b6:408:96::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Mon, 11 Oct 2021 05:39:21 +0000 Received: from CO1NAM11FT040.eop-nam11.prod.protection.outlook.com (2603:10b6:303:84:cafe::60) by MW4PR04CA0145.outlook.office365.com (2603:10b6:303:84::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:39:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT040.mail.protection.outlook.com (10.13.174.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:39:20 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:19 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:19 -0500 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:39:15 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 07/13] ASoC: amd: add acp6x pdm driver dma ops Date: Mon, 11 Oct 2021 11:26:15 +0530 Message-ID: <20211011055621.13240-8-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3f5aba7d-d62f-4975-30a5-08d98c797987 X-MS-TrafficTypeDiagnostic: BN8PR12MB2865: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8tTDfvhHykSyAfEfdrk5J/iRVNblzqgNvkHmWaxUBxZE6ojdvz+wf85xYN4+r7PSh/J2Ok2be3UUxLyzXH/I1fog9GC9JbLAW7oWdDesUKwmVs3JTG7v8k6/VZwM04XyLSm3gZ7zSva082C9IZUOcW50dHcMlUbLYqzhk/asRfr/Yf2b9+VVqEWOHGgHBGP+LNLTN5uHQ+88MwgP+6LlG3QM3ApcajL8/PmqM4I/KkULyeNB/fb6jN146QVsB6MxQFXU21y0jctIDTaoGw2SNU0IEQ7OgMCU1RZ6pJbXeDJh1cdkwl2CCSYO65ZqNECF+h0An8i8dJ4bnOA+RP2GoD9IH5b59AfFAn8bgdFaYXL8Kgh9l/wsdKVX0IoGM00WKJNFQsXDUupHB2Xu/cJPw82u2PwlhZ1PV2UeUPlhZDbX4nSyE5+rYMw1zAUezHY5uPkk+wY289zmrLRcmSpCs/xtDrsb4kSjwE4gG/O473kVIj5BjtlG/c1JdJELD4ohw9HUvJ6rB3x+kSLEN9bp+YuKl39pSrjOKrT+8zpkdf9aXX7H+aPTXuAhN6nc40woRlhp4MmsCUpCQyY820c1skovIw6+X5DGVXsYrT/jD28WAhqOktMlgY1p0lyzutQ9w5LEWnSSOMb5G/03CfNx7V7KpXanOQAInlsfrWYzMjSuULVbZ7RSiHDRw1ZmvOo5LYd0MjAO/0ox2GD6kDsJgIBdYINpJyq8Ffbu1XLbGlsW30JVUnDuI2e57KA5vy4tqFR8gV2Ha9UmWrkN13iJ9Q== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(86362001)(186003)(83380400001)(30864003)(8676002)(1076003)(4326008)(8936002)(2906002)(82310400003)(70586007)(26005)(70206006)(7696005)(36860700001)(356005)(316002)(81166007)(2616005)(426003)(336012)(110136005)(36756003)(508600001)(54906003)(5660300002)(47076005)(32563001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:39:20.5951 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f5aba7d-d62f-4975-30a5-08d98c797987 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT040.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2865 Cc: Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This patch adds PDM driver DMA operations. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x-pdm-dma.c | 310 +++++++++++++++++++++++++++++++ sound/soc/amd/yc/acp6x.h | 41 ++++ 2 files changed, 351 insertions(+) diff --git a/sound/soc/amd/yc/acp6x-pdm-dma.c b/sound/soc/amd/yc/acp6x-pdm-dma.c index e1a25268bc5c..3da74b1896e1 100644 --- a/sound/soc/amd/yc/acp6x-pdm-dma.c +++ b/sound/soc/amd/yc/acp6x-pdm-dma.c @@ -16,6 +16,310 @@ #define DRV_NAME "acp_yc_pdm_dma" +static const struct snd_pcm_hardware acp6x_pdm_hardware_capture = { + .info = SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME, + .formats = SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_48000, + .rate_min = 48000, + .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 void acp6x_init_pdm_ring_buffer(u32 physical_addr, u32 buffer_size, + u32 watermark_size, void __iomem *acp_base) +{ + acp6x_writel(physical_addr, acp_base + ACP_WOV_RX_RINGBUFADDR); + acp6x_writel(buffer_size, acp_base + ACP_WOV_RX_RINGBUFSIZE); + acp6x_writel(watermark_size, acp_base + ACP_WOV_RX_INTR_WATERMARK_SIZE); + acp6x_writel(0x01, acp_base + ACPAXI2AXI_ATU_CTRL); +} + +static void acp6x_enable_pdm_clock(void __iomem *acp_base) +{ + u32 pdm_clk_enable, pdm_ctrl; + + pdm_clk_enable = ACP_PDM_CLK_FREQ_MASK; + pdm_ctrl = 0x00; + + acp6x_writel(pdm_clk_enable, acp_base + ACP_WOV_CLK_CTRL); + pdm_ctrl = acp6x_readl(acp_base + ACP_WOV_MISC_CTRL); + pdm_ctrl |= ACP_WOV_MISC_CTRL_MASK; + acp6x_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL); +} + +static void acp6x_enable_pdm_interrupts(void __iomem *acp_base) +{ + u32 ext_int_ctrl; + + ext_int_ctrl = acp6x_readl(acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_int_ctrl |= PDM_DMA_INTR_MASK; + acp6x_writel(ext_int_ctrl, acp_base + ACP_EXTERNAL_INTR_CNTL); +} + +static void acp6x_disable_pdm_interrupts(void __iomem *acp_base) +{ + u32 ext_int_ctrl; + + ext_int_ctrl = acp6x_readl(acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_int_ctrl &= ~PDM_DMA_INTR_MASK; + acp6x_writel(ext_int_ctrl, acp_base + ACP_EXTERNAL_INTR_CNTL); +} + +static bool acp6x_check_pdm_dma_status(void __iomem *acp_base) +{ + bool pdm_dma_status; + u32 pdm_enable, pdm_dma_enable; + + pdm_dma_status = false; + pdm_enable = acp6x_readl(acp_base + ACP_WOV_PDM_ENABLE); + pdm_dma_enable = acp6x_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); + if ((pdm_enable & ACP_PDM_ENABLE) && (pdm_dma_enable & ACP_PDM_DMA_EN_STATUS)) + pdm_dma_status = true; + + return pdm_dma_status; +} + +static int acp6x_start_pdm_dma(void __iomem *acp_base) +{ + u32 pdm_enable; + u32 pdm_dma_enable; + int timeout; + + pdm_enable = 0x01; + pdm_dma_enable = 0x01; + + acp6x_enable_pdm_clock(acp_base); + acp6x_writel(pdm_enable, acp_base + ACP_WOV_PDM_ENABLE); + acp6x_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE); + timeout = 0; + while (++timeout < ACP_COUNTER) { + pdm_dma_enable = acp6x_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); + if ((pdm_dma_enable & 0x02) == ACP_PDM_DMA_EN_STATUS) + return 0; + udelay(DELAY_US); + } + return -ETIMEDOUT; +} + +static int acp6x_stop_pdm_dma(void __iomem *acp_base) +{ + u32 pdm_enable, pdm_dma_enable; + int timeout; + + pdm_enable = 0x00; + pdm_dma_enable = 0x00; + + pdm_enable = acp6x_readl(acp_base + ACP_WOV_PDM_ENABLE); + pdm_dma_enable = acp6x_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); + if (pdm_dma_enable & 0x01) { + pdm_dma_enable = 0x02; + acp6x_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE); + timeout = 0; + while (++timeout < ACP_COUNTER) { + pdm_dma_enable = acp6x_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); + if ((pdm_dma_enable & 0x02) == 0x00) + break; + udelay(DELAY_US); + } + if (timeout == ACP_COUNTER) + return -ETIMEDOUT; + } + if (pdm_enable == ACP_PDM_ENABLE) { + pdm_enable = ACP_PDM_DISABLE; + acp6x_writel(pdm_enable, acp_base + ACP_WOV_PDM_ENABLE); + } + acp6x_writel(0x01, acp_base + ACP_WOV_PDM_FIFO_FLUSH); + return 0; +} + +static void acp6x_config_dma(struct pdm_stream_instance *rtd, int direction) +{ + u16 page_idx; + u32 low, high, val; + dma_addr_t addr; + + addr = rtd->dma_addr; + val = PDM_PTE_OFFSET; + + /* Group Enable */ + acp6x_writel(ACP_SRAM_PTE_OFFSET | BIT(31), rtd->acp6x_base + + ACPAXI2AXI_ATU_BASE_ADDR_GRP_1); + acp6x_writel(PAGE_SIZE_4K_ENABLE, rtd->acp6x_base + + ACPAXI2AXI_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 */ + low = lower_32_bits(addr); + high = upper_32_bits(addr); + + acp6x_writel(low, rtd->acp6x_base + ACP_SCRATCH_REG_0 + val); + high |= BIT(31); + acp6x_writel(high, rtd->acp6x_base + ACP_SCRATCH_REG_0 + val + 4); + val += 8; + addr += PAGE_SIZE; + } +} + +static int acp6x_pdm_dma_open(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime; + struct pdm_dev_data *adata; + struct pdm_stream_instance *pdm_data; + int ret; + + runtime = substream->runtime; + adata = dev_get_drvdata(component->dev); + pdm_data = kzalloc(sizeof(*pdm_data), GFP_KERNEL); + if (!pdm_data) + return -EINVAL; + + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + runtime->hw = acp6x_pdm_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"); + kfree(pdm_data); + return ret; + } + + acp6x_enable_pdm_interrupts(adata->acp6x_base); + + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + adata->capture_stream = substream; + + pdm_data->acp6x_base = adata->acp6x_base; + runtime->private_data = pdm_data; + return ret; +} + +static int acp6x_pdm_dma_hw_params(struct snd_soc_component *component, + struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct pdm_stream_instance *rtd; + size_t size, period_bytes; + + rtd = substream->runtime->private_data; + if (!rtd) + return -EINVAL; + size = params_buffer_bytes(params); + period_bytes = params_period_bytes(params); + rtd->dma_addr = substream->runtime->dma_addr; + rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); + acp6x_config_dma(rtd, substream->stream); + acp6x_init_pdm_ring_buffer(PDM_MEM_WINDOW_START, size, + period_bytes, rtd->acp6x_base); + return 0; +} + +static u64 acp6x_pdm_get_byte_count(struct pdm_stream_instance *rtd, + int direction) +{ + union acp_pdm_dma_count byte_count; + + byte_count.bcount.high = + acp6x_readl(rtd->acp6x_base + ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH); + byte_count.bcount.low = + acp6x_readl(rtd->acp6x_base + ACP_WOV_RX_LINEARPOSITIONCNTR_LOW); + return byte_count.bytescount; +} + +static snd_pcm_uframes_t acp6x_pdm_dma_pointer(struct snd_soc_component *comp, + struct snd_pcm_substream *stream) +{ + struct pdm_stream_instance *rtd; + u32 pos, buffersize; + u64 bytescount; + + rtd = stream->runtime->private_data; + buffersize = frames_to_bytes(stream->runtime, + stream->runtime->buffer_size); + bytescount = acp6x_pdm_get_byte_count(rtd, stream->stream); + if (bytescount > rtd->bytescount) + bytescount -= rtd->bytescount; + pos = do_div(bytescount, buffersize); + return bytes_to_frames(stream->runtime, pos); +} + +static int acp6x_pdm_dma_new(struct snd_soc_component *component, + struct snd_soc_pcm_runtime *rtd) +{ + struct device *parent = component->dev->parent; + + snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, + parent, MIN_BUFFER, MAX_BUFFER); + return 0; +} + +static int acp6x_pdm_dma_close(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct pdm_dev_data *adata = dev_get_drvdata(component->dev); + + acp6x_disable_pdm_interrupts(adata->acp6x_base); + adata->capture_stream = NULL; + return 0; +} + +static int acp6x_pdm_dai_trigger(struct snd_pcm_substream *substream, + int cmd, struct snd_soc_dai *dai) +{ + struct pdm_stream_instance *rtd; + int ret; + bool pdm_status; + unsigned int ch_mask; + + rtd = substream->runtime->private_data; + ret = 0; + switch (substream->runtime->channels) { + case TWO_CH: + ch_mask = 0x00; + break; + default: + return -EINVAL; + } + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + acp6x_writel(ch_mask, rtd->acp6x_base + ACP_WOV_PDM_NO_OF_CHANNELS); + acp6x_writel(PDM_DECIMATION_FACTOR, rtd->acp6x_base + + ACP_WOV_PDM_DECIMATION_FACTOR); + rtd->bytescount = acp6x_pdm_get_byte_count(rtd, substream->stream); + pdm_status = acp6x_check_pdm_dma_status(rtd->acp6x_base); + if (!pdm_status) + ret = acp6x_start_pdm_dma(rtd->acp6x_base); + break; + case SNDRV_PCM_TRIGGER_STOP: + case SNDRV_PCM_TRIGGER_SUSPEND: + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + pdm_status = acp6x_check_pdm_dma_status(rtd->acp6x_base); + if (pdm_status) + ret = acp6x_stop_pdm_dma(rtd->acp6x_base); + break; + default: + ret = -EINVAL; + break; + } + return ret; +} + +static struct snd_soc_dai_ops acp6x_pdm_dai_ops = { + .trigger = acp6x_pdm_dai_trigger, +}; + static struct snd_soc_dai_driver acp6x_pdm_dai_driver = { .capture = { .rates = SNDRV_PCM_RATE_48000, @@ -25,10 +329,16 @@ static struct snd_soc_dai_driver acp6x_pdm_dai_driver = { .rate_min = 48000, .rate_max = 48000, }, + .ops = &acp6x_pdm_dai_ops, }; static const struct snd_soc_component_driver acp6x_pdm_component = { .name = DRV_NAME, + .open = acp6x_pdm_dma_open, + .close = acp6x_pdm_dma_close, + .hw_params = acp6x_pdm_dma_hw_params, + .pointer = acp6x_pdm_dma_pointer, + .pcm_construct = acp6x_pdm_dma_new, }; static int acp6x_pdm_audio_probe(struct platform_device *pdev) diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h index 4ea37794db84..3f83de229409 100644 --- a/sound/soc/amd/yc/acp6x.h +++ b/sound/soc/amd/yc/acp6x.h @@ -27,6 +27,31 @@ #define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF #define PDM_DMA_STAT 0x10 +#define PDM_DMA_INTR_MASK 0x10000 +#define ACP_ERROR_STAT 29 +#define PDM_DECIMATION_FACTOR 2 +#define ACP_PDM_CLK_FREQ_MASK 7 +#define ACP_WOV_MISC_CTRL_MASK 0x10 +#define ACP_PDM_ENABLE 1 +#define ACP_PDM_DISABLE 0 +#define ACP_PDM_DMA_EN_STATUS 2 +#define TWO_CH 2 +#define DELAY_US 5 +#define ACP_COUNTER 20000 + +#define ACP_SRAM_PTE_OFFSET 0x03800000 +#define PAGE_SIZE_4K_ENABLE 2 +#define PDM_PTE_OFFSET 0 +#define PDM_MEM_WINDOW_START 0x4000000 + +#define CAPTURE_MIN_NUM_PERIODS 4 +#define CAPTURE_MAX_NUM_PERIODS 4 +#define CAPTURE_MAX_PERIOD_SIZE 8192 +#define CAPTURE_MIN_PERIOD_SIZE 4096 + +#define MAX_BUFFER (CAPTURE_MAX_PERIOD_SIZE * CAPTURE_MAX_NUM_PERIODS) +#define MIN_BUFFER MAX_BUFFER + enum acp_config { ACP_CONFIG_0 = 0, ACP_CONFIG_1, @@ -52,6 +77,22 @@ struct pdm_dev_data { struct snd_pcm_substream *capture_stream; }; +struct pdm_stream_instance { + u16 num_pages; + u16 channels; + dma_addr_t dma_addr; + u64 bytescount; + void __iomem *acp6x_base; +}; + +union acp_pdm_dma_count { + struct { + u32 low; + u32 high; + } bcount; + u64 bytescount; +}; + static inline u32 acp6x_readl(void __iomem *base_addr) { return readl(base_addr - ACP6x_PHY_BASE_ADDRESS); From patchwork Mon Oct 11 05:56:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549069 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F4BBC433F5 for ; Mon, 11 Oct 2021 05:42:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 76DA760F21 for ; Mon, 11 Oct 2021 05:42:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 76DA760F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 082E4169D; Mon, 11 Oct 2021 07:41:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 082E4169D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633930917; bh=EFOD2znPIv7NA2mhHm+282CtCT5vO4mKqAYHakew7Ww=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LMhE/FMq1jiPpF+D8tse5/lYEHl5o0jfV1ujpDkUJHI2FlnKBVxnQ4zkccgcCPI8h 8ptO3uI2RezCaym3jabWyZa3ohg6fh5qK8PJSG66ASt51mncYZICFSAXdiVH6kpaF3 XYhPhdyeoKaz625vlMl8etaO2WE9eC3QGOneYB6g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AB712F804FA; Mon, 11 Oct 2021 07:40:36 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E144AF804FB; Mon, 11 Oct 2021 07:40:35 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2045.outbound.protection.outlook.com [40.107.93.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BE302F80511 for ; Mon, 11 Oct 2021 07:39:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BE302F80511 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="xXQiDOWw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kaNrJ0dp/PjOCE1h/Hvkibrsma82Je82fOwMv+/Q63FEImcffWPBl/PysylB8luTubXSLnFJEKVy00Tq/Azk4CI+wkRLUhhVdAyMGt2KLlpaboxY8nES1Z4CWNatZ5ZRqg8KNObhDs1Sij8HQgNt6SyxuQ6PjzqWOCOruMQGeGGQL2gxloGl2rsJWdheam9M/E1tBVMy6k6NK7oiUmwhTJj1wSETis2RRolVNaUvUOVNC00YSGowXB4RVhEDu977MEd+47BCUPZWJuyCO8ZCi3j0RNMpLXtPYz1LA29dlYDjjnvyVsNG9ZSLtcwWw1morwiLsRUWujPEz/z14fjpRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZUbQ5dk9Qx+qM+XaWzj3zlKoSYxHMJUP5TBqiIb7xRs=; b=JWIxf8/WTpL3HZtDox6xy5eQV/EXbYOSnyIa1f0EfovOnn/8Hunw0Wh6FHXJVak6i3JI5HKM17QHlfrrW0eD9tUQ12XjrITgHTCMFtMF06cIyTiG6AiNWfbaOU4SCk5FBW13F9Ye5YTk2nq1SfWUVNUciUAXzRCinTJKgzhLnrJXeZdGIr+w7Nw6YWWjqdZxn0VaG95z8UROLSUJakXzcJ7/2HkZHglG6yHYaH7PKwogRsfDZ6v7gGjpqxwdo9OWWn0Q3RfgzptKF28tv2gLS7AKrthViRE3x+PEKFKfb9qFtoe4TUiKjMOQ4DkmPSzBpDpzZvUxRvWCpFooHMzbjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZUbQ5dk9Qx+qM+XaWzj3zlKoSYxHMJUP5TBqiIb7xRs=; b=xXQiDOWwsjW2ody3+Ph2ADfK+PTQivUxu43n+gC5m5keBnQR+Xh64k/Oa3Akz9oNtbqS9s3keMlCu22tydUSoloVGlwv/ErN9Yu+vD31rvB/8Y2vbnA0JZazu4AQqc3d6y6TOmCndvo6uVW0Zv/LfAAQcgJPGeDi47SinJbtIp8= Received: from CO2PR07CA0077.namprd07.prod.outlook.com (2603:10b6:100::45) by SN6PR12MB2784.namprd12.prod.outlook.com (2603:10b6:805:68::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.24; Mon, 11 Oct 2021 05:39:31 +0000 Received: from CO1NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:100:0:cafe::5c) by CO2PR07CA0077.outlook.office365.com (2603:10b6:100::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:39:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT020.mail.protection.outlook.com (10.13.174.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:39:31 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:30 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:29 -0500 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:39:26 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 08/13] ASoC: amd: add acp6x pci driver pm ops Date: Mon, 11 Oct 2021 11:26:16 +0530 Message-ID: <20211011055621.13240-9-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d7892f5a-8492-4fb1-ea30-08d98c797fde X-MS-TrafficTypeDiagnostic: SN6PR12MB2784: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PVLVCy4PV+qXEteEr/Jb8G5DZtcDz5KvJz+61j2kx/zTRgE0wmcfqQfL+Qf58+46ItOYPZw20coPYPPtGHWQ8gr7utjwqUvmzqNbNb3ArS9uVhvafjZCTpDXKjFPEqDuVH9HpRC2qidq5s4WP/CxZD/cZCGYncXeTYmDu77y0NfQh+G3yTUA71XcI/3q/d9VlgF95X/CZeLtHS8zsvncL/LveVG3JZSbqbw5ZDiZFuJNImcVIrSBb1RQY0oKJVrGFGwtMx8thUIFZcjNArcBhv4Qzt1snBBVaz8wVjdhFG1pJ+gcvRvXx9yYDCgpiELm4ghzJAuP2WGulDlF/vSNHZ275fF445u2zw40FTQTGV46em74RpwsIPpWd1uVCkI8GqurHQA/nbH7jHtWYogMyIOlaay6+pJNRWKp7Ezv+fxveQsTva192Xip/tT1nMsHVJ8kYUrMAEswx9fKhAix3dWOcJZ3LzAa2rtDKBkcg6dIX1zxOoukTMYOL5pv1BbtjlKeK53UHYtDMxZtsy8xwWlbVWGCQGTBJsqK3gK02Sb72fFB9ZE56DNJXOS+qfCu8yZzweMbGvDjPzo3HnZnn6QBtfYPIRMJ6ngK7F8v977NLLEs5BHhYJo75gFV4CtNbi1+HAK0Vkp7emD/AaE4bQH0PMABf3jBDX0mXrC69UIiiJC9EhNC5zkarpmfAREA8CbYCNYhappkeTY+RqdPxFZdDWxTsS3BRyFe+Q90/NJmqLx2H5G9lp0/KTm4yzTQ8Obs4n6SXL3cmzGa/wbb+g== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(356005)(2616005)(86362001)(83380400001)(336012)(426003)(6666004)(4326008)(81166007)(508600001)(70586007)(70206006)(82310400003)(2906002)(36860700001)(1076003)(186003)(36756003)(26005)(316002)(47076005)(8676002)(8936002)(5660300002)(110136005)(54906003)(7696005)(32563001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:39:31.2435 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7892f5a-8492-4fb1-ea30-08d98c797fde 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2784 Cc: Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add acp6x pci driver pm ops. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x.h | 3 +++ sound/soc/amd/yc/pci-acp6x.c | 40 ++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h index 3f83de229409..b0d3f6a9d0ce 100644 --- a/sound/soc/amd/yc/acp6x.h +++ b/sound/soc/amd/yc/acp6x.h @@ -52,6 +52,9 @@ #define MAX_BUFFER (CAPTURE_MAX_PERIOD_SIZE * CAPTURE_MAX_NUM_PERIODS) #define MIN_BUFFER MAX_BUFFER +/* time in ms for runtime suspend delay */ +#define ACP_SUSPEND_DELAY_MS 2000 + enum acp_config { ACP_CONFIG_0 = 0, ACP_CONFIG_1, diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c index 86b33f401e12..5f07db987cca 100644 --- a/sound/soc/amd/yc/pci-acp6x.c +++ b/sound/soc/amd/yc/pci-acp6x.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "acp6x.h" @@ -245,6 +246,11 @@ static int snd_acp6x_probe(struct pci_dev *pci, dev_err(&pci->dev, "ACP PCI IRQ request failed\n"); goto unregister_devs; } + pm_runtime_set_autosuspend_delay(&pci->dev, ACP_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(&pci->dev); + pm_runtime_put_noidle(&pci->dev); + pm_runtime_allow(&pci->dev); + return 0; unregister_devs: for (--index; index >= 0; index--) @@ -260,6 +266,35 @@ static int snd_acp6x_probe(struct pci_dev *pci, return ret; } +static int __maybe_unused snd_acp6x_suspend(struct device *dev) +{ + struct acp6x_dev_data *adata; + int ret; + + adata = dev_get_drvdata(dev); + ret = acp6x_deinit(adata->acp6x_base); + if (ret) + dev_err(dev, "ACP de-init failed\n"); + return ret; +} + +static int __maybe_unused snd_acp6x_resume(struct device *dev) +{ + struct acp6x_dev_data *adata; + int ret; + + adata = dev_get_drvdata(dev); + ret = acp6x_init(adata->acp6x_base); + if (ret) + dev_err(dev, "ACP init failed\n"); + return ret; +} + +static const struct dev_pm_ops acp6x_pm = { + SET_RUNTIME_PM_OPS(snd_acp6x_suspend, snd_acp6x_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(snd_acp6x_suspend, snd_acp6x_resume) +}; + static void snd_acp6x_remove(struct pci_dev *pci) { struct acp6x_dev_data *adata; @@ -273,6 +308,8 @@ static void snd_acp6x_remove(struct pci_dev *pci) ret = acp6x_deinit(adata->acp6x_base); if (ret) dev_err(&pci->dev, "ACP de-init failed\n"); + pm_runtime_forbid(&pci->dev); + pm_runtime_get_noresume(&pci->dev); pci_release_regions(pci); pci_disable_device(pci); } @@ -290,6 +327,9 @@ static struct pci_driver yc_acp6x_driver = { .id_table = snd_acp6x_ids, .probe = snd_acp6x_probe, .remove = snd_acp6x_remove, + .driver = { + .pm = &acp6x_pm, + } }; module_pci_driver(yc_acp6x_driver); From patchwork Mon Oct 11 05:56:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549071 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00FFAC433F5 for ; Mon, 11 Oct 2021 05:42:17 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C68D60EE7 for ; Mon, 11 Oct 2021 05:42:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6C68D60EE7 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CEB1B167E; Mon, 11 Oct 2021 07:41:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CEB1B167E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633930934; bh=uKs1Qw5fYlr0nKd+MEw3jcX7nZkVVJuw7N+EK/pJRAk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BGaFwVcZW2QYgxLvORpukRT+svaaPytaoOlYCKN8tFMSukya/c8/bW8iOf9G3h8MD SbtpwqgX5hOJeJa/ksn/Qk3ymwOLcrcpGETMpBMwpLsLGIip+PApFCUfOR7fXfs3Ei K59Sl+v3TMIlwynr75wR0BeRNj1lfqeLupM+eeEU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 99266F80507; Mon, 11 Oct 2021 07:40:37 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E80E8F804FA; Mon, 11 Oct 2021 07:40:35 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2080.outbound.protection.outlook.com [40.107.244.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 13B18F80507 for ; Mon, 11 Oct 2021 07:39:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 13B18F80507 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="FfsVjmW2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hnHpg1ACeberqQM4j+LHQImdJ3SKmyA679O1+IEOv6S6sXLyhuDTsE3rHGjfz5b4EmyKhs4NnwKCSY3iA6e5v26nJi0UZOFX3h+UrhqI84+e6d+KcnfGf0RO+fmXf5ZWCHTTu2UGBNwmIzKwadRQnSPdhMhiVbeul3J+5xGQ20xCyPOmwfE+xPD6r1eBOucFUakNQ+0BUHPJXrFfSM3ThPiMUfHiuUb+1D4zIL7t1+HD9gQ4SVminH1m2mlvq0nyMBYiEK54QjjL/7y5bOuvFVz/tSzqM24mLhbQgT0v0clDmsGIvN3EWdP0w9H6yUJ3PuQr4Bqdf3Cp2hnCBWzRgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IfyDwpLyXYu4yJ9W8sHlUm9uWO68UVCr++PmGdj7oIg=; b=EtE0fF3mTrl9pUb9voYrn+mUg9096Oskg3h1YVqtyGVwxK8bVExGK+UGl4Wg8CvvsVwcWUQv3NuLDKpP8IRRvU19zAAc2tJgY4WNxyzYNhJDCFno1ryydM1Mya4jc7LkK4dFT6xTkLBkdPRuY1/bH2IStBQZ0Cqj+oozWuFUrB7sKVyBi6slGk5/CYgMCa+NF8v0iVdzBN3rLNn+uLvhhe9FYlR5mhg6IIPNAaOqlWmHfYZxz7dSaulXf7l2FkOmglJ4REzGFooDHZ+XXpH2sMtQFwivJzr+b5fgIO3fzzYeVnF+W9W5FycBUsoaICGAjaBJAZ2BWptS3VSiNwCdDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IfyDwpLyXYu4yJ9W8sHlUm9uWO68UVCr++PmGdj7oIg=; b=FfsVjmW2rEx77s9CdHqVKKAXg1ciK+uNhxzFUdtzamNiiQe+d3il/C7Y4LikyOzBONYgMD1q36uaA5pJTqVbCGL91yio/6lc+xKoFrwIAyQOcWS8ZlPOQxjnmWWgM/vnWw3BGMZantuJWqHwPLWHjsiHakJ+p/JWWICnuuuYTuU= Received: from MW4PR03CA0046.namprd03.prod.outlook.com (2603:10b6:303:8e::21) by DM5PR12MB1754.namprd12.prod.outlook.com (2603:10b6:3:10f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25; Mon, 11 Oct 2021 05:39:37 +0000 Received: from CO1NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::3e) by MW4PR03CA0046.outlook.office365.com (2603:10b6:303:8e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25 via Frontend Transport; Mon, 11 Oct 2021 05:39:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT011.mail.protection.outlook.com (10.13.175.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:39:36 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:36 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:35 -0500 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:39:32 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 09/13] ASoC: amd: add acp6x pdm driver pm ops Date: Mon, 11 Oct 2021 11:26:17 +0530 Message-ID: <20211011055621.13240-10-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2a02093a-b128-4f78-410e-08d98c798331 X-MS-TrafficTypeDiagnostic: DM5PR12MB1754: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:510; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OQhDbrHr5Sn9b6xuGqifsvqaXKur9xqkwDV/VQbpCaKNn5ei+BiTmE5UnQLjriSUmpzmRl1qlFY3186XcCSEqWtyNMtxnd10573MbmCzI9xHuq9jkGi7FQhRsclMHYseKFeW6s+oLpfS54R9SK38cv6jxMrnj7BbAwgbIJmha6HqaVA1BqWf+6/8DvQKl5ZtH8zIuVbzMhcpP1q7vGCqPMEb8F5o+yuXKFTGshYPYbCv1pm0Uwkj4imgUEz8n2TmTY+PwEbZStvhCoBEWBHP/ragtlFKkM1U/gkWqrB+VuQedpWdgjNz2vKz9Au9JDDIRlkbGDFPQwEKiPPO0lVdH64SB8I2l2tkb+0LQBemVRHKZP2pt+H0Dm85z+Mlkd2SsFL7uTvPr2AvJIwL7J27qVGeHQQM6BnE85YyJFXx3A/n+XqJgddpEIQKGRKFzEAUGwzD8FKvhMCQcGAfPLEjrcM6PkH2k6vCnPamjStiJxx5CUzc8PsYkPDdJP2lHaoV28a8p6BRtUD0huXEduBUoLB2Q5UID7ug/FxNsHwQCdW6SQhtL5f1f24+kU0B/umVGZeFfSwSIQ8MIxKFAsklETjNiy/2schdxCYsQdkTBbI4aG0DOHu4dULT1TVY2VYbijiPgQ5Gl0mxCJ4Dj6gkXCSwSqISoRieZ++F9lYU/ackjFrR9TY7FpD+tASI0qXBccXeHjDVbXypq8NiK6GDtToFw++oiIVJFX6WXE3022w7U8PntvJl+SFqHdhnZnc1Zo1CJhIk04x23DsAhPXxgw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(426003)(7696005)(36860700001)(508600001)(8936002)(8676002)(186003)(356005)(81166007)(1076003)(26005)(70586007)(86362001)(36756003)(4326008)(54906003)(336012)(2906002)(110136005)(83380400001)(6666004)(47076005)(2616005)(82310400003)(70206006)(316002)(5660300002)(32563001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:39:36.8053 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2a02093a-b128-4f78-410e-08d98c798331 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1754 Cc: Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add acp6x pdm driver pm ops. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x-pdm-dma.c | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/sound/soc/amd/yc/acp6x-pdm-dma.c b/sound/soc/amd/yc/acp6x-pdm-dma.c index 3da74b1896e1..a37df4d051e5 100644 --- a/sound/soc/amd/yc/acp6x-pdm-dma.c +++ b/sound/soc/amd/yc/acp6x-pdm-dma.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "acp6x.h" @@ -372,13 +373,69 @@ static int acp6x_pdm_audio_probe(struct platform_device *pdev) return -ENODEV; } + pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_enable(&pdev->dev); + pm_runtime_allow(&pdev->dev); return 0; } +static int acp6x_pdm_audio_remove(struct platform_device *pdev) +{ + pm_runtime_disable(&pdev->dev); + return 0; +} + +static int __maybe_unused acp6x_pdm_resume(struct device *dev) +{ + struct pdm_dev_data *adata; + struct snd_pcm_runtime *runtime; + struct pdm_stream_instance *rtd; + u32 period_bytes, buffer_len; + + adata = dev_get_drvdata(dev); + if (adata->capture_stream && adata->capture_stream->runtime) { + runtime = adata->capture_stream->runtime; + rtd = runtime->private_data; + period_bytes = frames_to_bytes(runtime, runtime->period_size); + buffer_len = frames_to_bytes(runtime, runtime->buffer_size); + acp6x_config_dma(rtd, SNDRV_PCM_STREAM_CAPTURE); + acp6x_init_pdm_ring_buffer(PDM_MEM_WINDOW_START, buffer_len, + period_bytes, adata->acp6x_base); + } + acp6x_enable_pdm_interrupts(adata->acp6x_base); + return 0; +} + +static int __maybe_unused acp6x_pdm_suspend(struct device *dev) +{ + struct pdm_dev_data *adata; + + adata = dev_get_drvdata(dev); + acp6x_disable_pdm_interrupts(adata->acp6x_base); + return 0; +} + +static int __maybe_unused acp6x_pdm_runtime_resume(struct device *dev) +{ + struct pdm_dev_data *adata; + + adata = dev_get_drvdata(dev); + acp6x_enable_pdm_interrupts(adata->acp6x_base); + return 0; +} + +static const struct dev_pm_ops acp6x_pdm_pm_ops = { + SET_RUNTIME_PM_OPS(acp6x_pdm_suspend, acp6x_pdm_runtime_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(acp6x_pdm_suspend, acp6x_pdm_resume) +}; + static struct platform_driver acp6x_pdm_dma_driver = { .probe = acp6x_pdm_audio_probe, + .remove = acp6x_pdm_audio_remove, .driver = { .name = "acp_yc_pdm_dma", + .pm = &acp6x_pdm_pm_ops, }, }; From patchwork Mon Oct 11 05:56:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549075 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F625C433EF for ; Mon, 11 Oct 2021 05:42:56 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 681C360F38 for ; Mon, 11 Oct 2021 05:42:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 681C360F38 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5F44E168F; Mon, 11 Oct 2021 07:42:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5F44E168F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633930970; bh=ZeCuyn/o3qNgZ2U4F85Bmy3h01ddQ3uX+oB/NelscRA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NsumE/Oi5IdW6YeXFqVQti4uA2E1IrGbTPHYZyhpsKHBlyn0ZH9S5umGhmraScmoL a2MgHCXRkzCbp4JeoGwB6UaE9/phQdSEwm0KWwp/Z/1NJhWq5vFyHhfJvZlN/vewtw D6vZNw+/ZRxE3YSyxUx4WenmqMQHoP0fUhZyE84E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 636EDF8051A; Mon, 11 Oct 2021 07:40:48 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 12EFAF80519; Mon, 11 Oct 2021 07:40:45 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8F87EF804E5 for ; Mon, 11 Oct 2021 07:39:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8F87EF804E5 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="uc2TnI4h" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dMLEx6uCMSb83mGV8oHlnv8fU0v/BZ8zvpLA2nFWXQqZKATsHML0G8A9t/69FKVMclzpnFBvf0+z6a/3q4IWdA/9PgksmPIvm3OVkAX0zs13H3qnhbv+tovvSY6b9yEbOOtU1vxTx8tsN5R6Xn5KtQSfCgxP+sqcAQUZ5aMFfs088D6oEyZFp8z/1iAfefXLhQMY2KTIou2WCnwL23BQHO9BiblF0eGvIBs9icwkp5GbWwT5bsIQ7RB9p5oauwcwx8kF45raoZUEWD4LP4ECJ92LOcdBT0kfzuFmnqPbliIL0rA37VLxqocqnZgW/oyvVY/G2j4BZ6UM5VsdFVopwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GjdCoqkXAPcyZVejsT9vvfyTlAqrljpNufT7T5xzD38=; b=QKqOmO1b97TBzwlraFMkelVLnYanuDTcb7z55jzOidN/VQa5TV5YgWP3jD8GyDBtZe7dv5bS2bRim2AHN1B3DMj+hoIIwc8AtrTVkiN0qC/XjjuFNY+2ADAFEDwL68BRf4ra9tvO+uh/l8FPtDKnADVk8L39sb75JLR7p+dQu8A9pP6mobkUkECmet3QO3zy/MZOcsntM5V9ztbkywUFVbH0limYjOT+Wrc//PdQoaN4BexCUQXntDeWs+rhVfPMpXybm9f4wu6qgCN8JHmNV+zAYkqx0lsTqE9DqxDKdHaDrzhqFY0prfOjJIWiIoEPCDmfwfwmp2MaI0D7emTi4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GjdCoqkXAPcyZVejsT9vvfyTlAqrljpNufT7T5xzD38=; b=uc2TnI4hOWNE1fZ+7VVrxSPO0jo82akuU+OhRDbJP++2NeoVnE2wSR3d1zTf9umEEFrJ9NfbNdZj5muDzIIkkyUBROo3/lE/KYDGnh9EdrCSSQpbSb9iuge8lJa137vLYNmPkc6KGZ8TLrWIjPiEKTXhUZcPXqvBoapNwnWCcWE= Received: from MW4PR04CA0247.namprd04.prod.outlook.com (2603:10b6:303:88::12) by MW3PR12MB4347.namprd12.prod.outlook.com (2603:10b6:303:2e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.24; Mon, 11 Oct 2021 05:39:47 +0000 Received: from CO1NAM11FT041.eop-nam11.prod.protection.outlook.com (2603:10b6:303:88:cafe::df) by MW4PR04CA0247.outlook.office365.com (2603:10b6:303:88::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.26 via Frontend Transport; Mon, 11 Oct 2021 05:39:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT041.mail.protection.outlook.com (10.13.174.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:39:47 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:46 -0500 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:39:42 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 10/13] ASoC: amd: enable Yellow carp acp6x drivers build Date: Mon, 11 Oct 2021 11:26:18 +0530 Message-ID: <20211011055621.13240-11-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 400e15aa-f2d8-41d5-3e67-08d98c79897f X-MS-TrafficTypeDiagnostic: MW3PR12MB4347: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mp3ndbmwud4Jap7jQq/ubqc5vuDLSRQ0bElCBM5g6Bj9fhPeyT2LXUMSaITR19eRG4ROqExTHzA70HIsKoNDgimYP7K2K3/K0qNyS8Qd9z8zEQk91Avbespal1t7aDUiexgPrveGL882xHiEHjgT6Rawk/VXkMsaz7EF88H2GFIvUk0w71EGnGtJgc9oFQEkYy3eRNhM6xGx88M0cm9BAPQkgcN6dixppV+ka9FZkAhyHkfR5NbgalwNm8bvL3c6CyNckoy3VCKCAbnv+o7+EH5fOfS5q88PoeLxJDIZqcCpDMpEPlIXbkPUMttowYxiRhi5fXzxyIjl/2huRYVI/QAyucC41xcIWCg0h+eB9QDUopFoUFgYCG4KiJp9MkIUshmmNinztBQlH6yZlMyDdt/tHAWs6FEdxIe1/Jb5Br8dcs0EQCAQlj20wKQbrlUqgO3zEM6/j72noxLt0B67a0xOt2W/W+y5Czvcdp7g5JS3CQ/vM1XXAaZLTDEtkAARmKBtNG7WBgB2DhuhjChID3EdT35NYM8XjCL+AxDYVIx0+APizQ8U8tfknpJtsNnNWeXzLiNlvRkCClavKsc5wP9UWdhEu0uMzeuIdqgVrSxaMBTfBblJpH3OGRD9fds8S4dfbl1O/RaIAHWmO34ISVum70qPh06yk/islMQDLiKrJkCdqjKSbbH+NE9QIJn1LhXJrXPJivr/qcZgvOz3GjHrlUGPw0Q9SlmRignFlTGa7in5xSu+lBTtffkq7k+lsT/QDh7itgYyXSTWtV9OZg== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(1076003)(5660300002)(70206006)(6666004)(70586007)(508600001)(2906002)(356005)(81166007)(47076005)(36860700001)(26005)(7696005)(316002)(8676002)(186003)(86362001)(8936002)(54906003)(336012)(426003)(110136005)(4326008)(36756003)(82310400003)(2616005)(32563001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:39:47.3845 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 400e15aa-f2d8-41d5-3e67-08d98c79897f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT041.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4347 Cc: Pierre-Louis Bossart , Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Yellow Carp ACP6x drivers can be built by selecting necessary kernel config option. The patch enables build support of the same. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/Kconfig | 6 ++++++ sound/soc/amd/Makefile | 1 + sound/soc/amd/yc/Makefile | 7 +++++++ 3 files changed, 14 insertions(+) create mode 100644 sound/soc/amd/yc/Makefile diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index 49ff5e73e9ba..42825e8ad2ad 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -61,3 +61,9 @@ config SND_SOC_AMD_ACP5x By enabling this flag build will trigger for ACP PCI driver, ACP DMA driver, CPU DAI driver. + +config SND_SOC_AMD_ACP6x + tristate "AMD Audio Coprocessor-v6.x Yellow Carp support" + depends on X86 && PCI + help + This option enables ACP v6.x DMIC support on AMD platform diff --git a/sound/soc/amd/Makefile b/sound/soc/amd/Makefile index 07150d26f315..c5b900d3df0b 100644 --- a/sound/soc/amd/Makefile +++ b/sound/soc/amd/Makefile @@ -11,3 +11,4 @@ obj-$(CONFIG_SND_SOC_AMD_ACP3x) += raven/ obj-$(CONFIG_SND_SOC_AMD_RV_RT5682_MACH) += snd-soc-acp-rt5682-mach.o obj-$(CONFIG_SND_SOC_AMD_RENOIR) += renoir/ obj-$(CONFIG_SND_SOC_AMD_ACP5x) += vangogh/ +obj-$(CONFIG_SND_SOC_AMD_ACP6x) += yc/ diff --git a/sound/soc/amd/yc/Makefile b/sound/soc/amd/yc/Makefile new file mode 100644 index 000000000000..20f8dfe6abb4 --- /dev/null +++ b/sound/soc/amd/yc/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Yellow Carp platform Support +snd-pci-acp6x-objs := pci-acp6x.o +snd-acp6x-pdm-dma-objs := acp6x-pdm-dma.o + +obj-$(CONFIG_SND_SOC_AMD_ACP6x) += snd-pci-acp6x.o +obj-$(CONFIG_SND_SOC_AMD_ACP6x) += snd-acp6x-pdm-dma.o From patchwork Mon Oct 11 05:56:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549073 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DF5BC433F5 for ; Mon, 11 Oct 2021 05:42:30 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A62D960F38 for ; Mon, 11 Oct 2021 05:42:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A62D960F38 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 128F0168D; Mon, 11 Oct 2021 07:41:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 128F0168D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633930948; bh=NtteMnB3mc8S3dn8D9oDTD3iL5cJaoNowotiQWLCqO4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IGlwlTOGqc422cR5yQaqbRAwxUwvjZacWXXiSUfzCFOWfgpXzWj/lSsmWJhRIsg4+ WARITdvN2Xo2Gt1smCrMH2Il0xyf2/CWvb7CWagsAM5p0Vt9xP2IIdLS18O9LrPCAx jVX1oCPNXc4S03IO7X67TgoW37dx9q31/zbpF3GA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C2A53F8016D; Mon, 11 Oct 2021 07:40:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D0D9AF8051A; Mon, 11 Oct 2021 07:40:44 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2055.outbound.protection.outlook.com [40.107.243.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D54FDF804EC for ; Mon, 11 Oct 2021 07:40:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D54FDF804EC Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="JqFwYfXj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W4IPHF8T74whgQNMEXNYS+CPMCCjJmyn2PIe6OAsbpHKNvZbBcXpCejemOBlmEwpUOpwEB6HScFFDXdaUDOXGnFU9y5+Ls5eshAqzTalzUsgnFb8YIHieSA3+nzAEDZiTMTm1bjpi1Cgx/Hu/W0vObPnyD1V74yovqxRI7GkMOmp4ylFieuZDBE+HHFk0FNLsJpK1L621nuCvXfAHFr9ZyYPh2uAT6HE8ks+dvpvmYqgxICNfItAsHi9NrJkEv6cRqiH+QIyoHWrf35k69CfLJ27t3zt2P93cHygvCu+OZnkDGQ627ug5MRM7ObmZwzOL6TYZIWrh9cm8391meMPQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vKJNFoXl+Uup5TjO7IbM3xE5ajCbNgUwUxVam8DfM0I=; b=R94iZ3fIGVR+GvUCdSZoAX4tXztWW3A/HpiHTFicETotLzWm4qPc/AXW+mn88mk9DXKKdVWLiAJFVhS5dkQK0OzfcGdrTsQY5IlnUMiIADM+BV9gcYKBpx5OFP2kDBj97y1Pb7nDJO+u9UHA1GH0Rr8qx6JGgHHFlkcXKMBnJlDirrz0nxQqzIn6TDHK575zG9CpVUilxz+LjJE9yhLU1mDD1sdWeNioCQ/K7uBqIjzWXkNn0y1efkW8BgvkYRGv/NFfE8k4c5M+83ZGuhB3/Uhw2L5gDYW3hmd2nHEkymDgenOOmbLVbLJ2HHJrfiX7RYr/F+gUdz8tu3Wf4V2bBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vKJNFoXl+Uup5TjO7IbM3xE5ajCbNgUwUxVam8DfM0I=; b=JqFwYfXjH287vgzYXLeI7mNZJ7TU/+FIu6y36/Q4/+RwC5JEjhOkHyA+kj25Fry4wYKnhEYoJMaDopbJpPSFfTrHuVf+0REXK9g6jMU6exakeQFLftq+/tagvoH1srLgJ6GBwgTr7JXZ3C9QKaLqULecR2sTaEz+/W3n5j4fHHM= Received: from CO2PR05CA0060.namprd05.prod.outlook.com (2603:10b6:102:2::28) by CY4PR1201MB0264.namprd12.prod.outlook.com (2603:10b6:910:1e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Mon, 11 Oct 2021 05:39:59 +0000 Received: from CO1NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:102:2:cafe::85) by CO2PR05CA0060.outlook.office365.com (2603:10b6:102:2::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.4 via Frontend Transport; Mon, 11 Oct 2021 05:39:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT050.mail.protection.outlook.com (10.13.174.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:39:58 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:57 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:39:57 -0500 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:39:53 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 11/13] ASoC: amd: create platform device for acp6x machine driver Date: Mon, 11 Oct 2021 11:26:19 +0530 Message-ID: <20211011055621.13240-12-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ec50987-4d67-4235-099d-08d98c799023 X-MS-TrafficTypeDiagnostic: CY4PR1201MB0264: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1079; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RJk7+MLk3aCB950i9q80ZqD++pYVSTCJIPXQ9/Xfyl5OUoGpK/4oO3xtLhxL4oGMbEw9h/UtIA4MW2bg4Exdiq2QJvHRDMl7R5klkuTke50aWqBj9o76DdQrp2GZ63jjF++0bWe2gwPeg6kGWhgsF4bi/hCy0d8BXDscpGtz13IydW+XrW6lP91j+cbmMWr+VxZ/l18W+ntlMM8r9U23AlESq05qHIwheMd8vTGhP4wgCPddsSRWKe2XAi6XmpWjFwvLlY4lJvMYX8qtiQHUujXQqnioTH73wF4TTrfd0hchX6+J2xcsrSe1fIhQdWbgJnvROGez9R+UvCPXc6Q6gRR+0eSTGZEpcYtz3dLyyeMUN1yzT97mzfpkoIoSHLpCf6MZlQ0L2Hw4hQO7OxHWshbx5M5UDvtS7g+4JT55pGFBzQYJtpyOZkMuQcRpZlbAc9pZqnqgZcbg7kF+aODENnutasqQ3+W0ese9g8klHEp1MEX5bUTXszZn+t1pqSbexkzVCShKz9X6G1DDbeTXvM/OqXjkR4LCUBOFC2Oj3xlSDlkaoAgB7LjSsXy1inBvm8Gne6rPcpDBXkV11fpU0MOv5yxA0qUEUzYie+b8IM4U9fWT1KR3nlRTPexDgEkEprYFTMfI/RK/aHklb3J1ngnqfA+7FebE8lcZk5oK5SPaLvJrygrmChzI3lHe8AFLcv3nDo7w+xJAie6/ra8apikJvX91zeXR+hl0pDXvBNYar9naIypOZFdvj6Z4JM1VVtebMGa3u9Olny/XaioEJw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(2906002)(5660300002)(2616005)(70586007)(336012)(7696005)(36860700001)(508600001)(6666004)(70206006)(86362001)(26005)(82310400003)(81166007)(8676002)(316002)(47076005)(356005)(8936002)(426003)(54906003)(83380400001)(110136005)(1076003)(36756003)(4326008)(186003)(32563001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:39:58.5333 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ec50987-4d67-4235-099d-08d98c799023 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0264 Cc: Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Create platform device for acp6x machine driver. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x.h | 2 +- sound/soc/amd/yc/pci-acp6x.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h index b0d3f6a9d0ce..74b596e6807a 100644 --- a/sound/soc/amd/yc/acp6x.h +++ b/sound/soc/amd/yc/acp6x.h @@ -11,7 +11,7 @@ #define ACP6x_PHY_BASE_ADDRESS 0x1240000 #define ACP6x_REG_START 0x1240000 #define ACP6x_REG_END 0x1250200 -#define ACP6x_DEVS 2 +#define ACP6x_DEVS 3 #define ACP6x_PDM_MODE 1 #define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001 diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c index 5f07db987cca..c6477ab6aab8 100644 --- a/sound/soc/amd/yc/pci-acp6x.c +++ b/sound/soc/amd/yc/pci-acp6x.c @@ -228,6 +228,10 @@ static int snd_acp6x_probe(struct pci_dev *pci, pdevinfo[1].id = 0; pdevinfo[1].parent = &pci->dev; + pdevinfo[2].name = "acp_yc_mach"; + pdevinfo[2].id = 0; + pdevinfo[2].parent = &pci->dev; + for (index = 0; index < ACP6x_DEVS; index++) { adata->pdev[index] = platform_device_register_full(&pdevinfo[index]); From patchwork Mon Oct 11 05:56:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549081 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4ED3C433EF for ; Mon, 11 Oct 2021 05:43:41 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E23260F57 for ; Mon, 11 Oct 2021 05:43:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2E23260F57 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8E6901695; Mon, 11 Oct 2021 07:42:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8E6901695 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633931019; bh=pK2GGY1S+SvYaM+OAHj8f9PjcxvP4oD/grpb10K26aY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qXE+o7/VBVqz4F9AFWOiyaxF3OAlRiwddyRBAVNMHCenjwWut1KLsj6Oz4FJUd6tM 6RcXslkdrAQljEzBYEJkG7t1QeHdjr6+DVrwCrqsBMYqh7qF0y4Mtkgmpz1yITQ2oH A3nlfb/ox+bj9+7KQpD6IM54KrXna840xlErhreQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 40BBFF80524; Mon, 11 Oct 2021 07:40:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B0370F80524; Mon, 11 Oct 2021 07:40:54 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2079.outbound.protection.outlook.com [40.107.96.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A2924F804EB for ; Mon, 11 Oct 2021 07:40:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A2924F804EB Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="C5v43OiO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kVFC+ji83tLagMvkrg4EZaJro6Y/GayCl0ubCkWejouMCJqL20Gkj53sjzLWZPQDdUVNzIsUZZReqnBX4u97UWmVARl2uZ9LFjfuBMgqCd3RoB3dx98EEvGzGG4XkWdyLyH6Cez2sVPdclPP1+W+YOdftEjH0/gStfSAQ3WG8eYKqx3CW/8wZg496Kl4hovrzYjWtflKtN1qPoucl+LCDIEZdexOmukZyp7xVLdtMBOZzBDQ3YM+1cr8CWStmBNA56XT4qryEpSLcqFKCKRz9U9+CAvJTr0I+mDrELbKyNnkkYA3uNSb/SI6bxj0ofba9wWtpobxn7mHS1NLbl5oxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BwZOqvi0lCQek0PCXkSUmZpFhPnMS/07A4HUvqZLZA4=; b=ZL4nsjUEvhbQbrcFjGXbt/aSJUfFYS405CnjfI82iLjZhr/NdPanF940PojtAPsvGhXxmOlgPaR5eQAfhnimjNYi/wU3GSRS76Vbtbb0Pg9RNezaKa3q+3Uika5dSH5khfFIUkVoSUMN1ESqtEDkWGimPru4KuoTf6jkCn+JrlZl5fw7lUWbtnVgiodF4oPFCSZANoY9kaNIQbrdODwL/tWXMfnE4JjThnCugUJJU0AQiX0k120uLCewv2MX1mIPvFLdDtD0CHHwsBw+0bGx6+JrQPxKkHdj+YgSxn3IRBoNHcD0ktDb5tww7zsz5rZp4rwqJQb7NpTZNEc35LjPow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BwZOqvi0lCQek0PCXkSUmZpFhPnMS/07A4HUvqZLZA4=; b=C5v43OiOYFXgfjwhtNTVcKxBcUT9QutGPUa0PLa3EoQRfj8ZEqqucUCbE/A81KR/2GkHG10obYMEpalUF9M+OHwHvEW1JnODDNnctJR3DqgJUW4gwuvCMsiE5BDQZrnB8r2OZz+9aQHlUbUOOs1g4OpZQJ8aRv/w/9g5RR1Qd/Q= Received: from MWHPR18CA0049.namprd18.prod.outlook.com (2603:10b6:300:39::11) by MWHPR12MB1150.namprd12.prod.outlook.com (2603:10b6:300:f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Mon, 11 Oct 2021 05:40:06 +0000 Received: from CO1NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:300:39:cafe::bc) by MWHPR18CA0049.outlook.office365.com (2603:10b6:300:39::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:40:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT053.mail.protection.outlook.com (10.13.175.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:40:05 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:40:04 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sun, 10 Oct 2021 22:40:03 -0700 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:40:00 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 12/13] ASoC: amd: add YC machine driver using dmic Date: Mon, 11 Oct 2021 11:26:20 +0530 Message-ID: <20211011055621.13240-13-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 46d9944a-ee2d-4d84-5949-08d98c799484 X-MS-TrafficTypeDiagnostic: MWHPR12MB1150: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t//tj7zgy8WBOCXWbe/DknuDkfhQyocSkv5cUd9bbzbYEWXSDhoyxbyQIgfQVUGhxWdF6cNpTl723uSeAf8NaEPvuRRY1Gjo1LzDASSpPRV1fRCfkXm8Uyh7khnJHhM/s1BXNQB7i+yv+5E96kjY4wmb2UNv+rm3gQRUY3W0GKrbRLbxZnlyH5+jZFxetjf0r+Kdda94di3nJvbUX/FHDoFxLTol2WP16niX7D2MfbhKhBpduBRkGq52MyPa7MahrgSTuDTboGwaEhlR58R3BSqx/inLtjsZnzehtCrzpijfCtrEZYHwHMt90Zhjt+oEma1sdZmkqdtML3OJ0980Tlzg8WJyv0wfKMPrv4GdDL8RYuLosSsSspdpwfbP05vs/0oovB2X3fmDnqm4PatAC/viF/o1zV647dh0ilunfUMgXC7LkA6OLVAImeEQc2Te0hDVPr9U+sZTMwIGE5WMs/s9tthWG7GBr1Ew/EG6t+jT8ANLJWjFlr4BEUlsUuUMg/8UgW1+Wny6ab/2ruwkd2jg+JY7nj6Y9PiY0HEi3r6rxLmTKy7Ek1hIX5wR0aKVz/D3IvDepq/R35eBbdnAyc63KVBPBpAHcOHWhtRW6dMqLH3nFSr/HCWux/fQqvDHdCw2nhU8YMZn6yCu/ftou9bo0m8RoywAueRuiPqlOtTR+CD0Lpxx4oM0nkHJ5K6/z2ttO4ttKbCeM+v3BjyXqfKE+VnAgufE91nZR4IsJGA= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(36756003)(2906002)(6666004)(70586007)(426003)(70206006)(356005)(47076005)(36860700001)(2616005)(81166007)(336012)(186003)(8936002)(8676002)(1076003)(110136005)(5660300002)(54906003)(82310400003)(7696005)(26005)(86362001)(4326008)(316002)(508600001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:40:05.8829 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46d9944a-ee2d-4d84-5949-08d98c799484 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1150 Cc: Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add Yellow Carp platform machine driver using dmic. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/yc/acp6x-mach.c | 76 +++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sound/soc/amd/yc/acp6x-mach.c diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c new file mode 100644 index 000000000000..5804d17457d0 --- /dev/null +++ b/sound/soc/amd/yc/acp6x-mach.c @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: GPL-2.0+ +// +// Machine driver for AMD Yellow Carp platform using DMIC +// +//Copyright 2021 Advanced Micro Devices, Inc. + +#include +#include +#include +#include +#include +#include + +#include "acp6x.h" + +#define DRV_NAME "acp_yc_mach" + +SND_SOC_DAILINK_DEF(acp6x_pdm, + DAILINK_COMP_ARRAY(COMP_CPU("acp_yc_pdm_dma.0"))); + +SND_SOC_DAILINK_DEF(dmic_codec, + DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec.0", + "dmic-hifi"))); + +SND_SOC_DAILINK_DEF(pdm_platform, + DAILINK_COMP_ARRAY(COMP_PLATFORM("acp_yc_pdm_dma.0"))); + +static struct snd_soc_dai_link acp6x_dai_pdm[] = { + { + .name = "acp6x-dmic-capture", + .stream_name = "DMIC capture", + .capture_only = 1, + SND_SOC_DAILINK_REG(acp6x_pdm, dmic_codec, pdm_platform), + }, +}; + +static struct snd_soc_card acp6x_card = { + .name = "acp6x", + .owner = THIS_MODULE, + .dai_link = acp6x_dai_pdm, + .num_links = 1, +}; + +static int acp6x_probe(struct platform_device *pdev) +{ + struct acp6x_pdm *machine = NULL; + struct snd_soc_card *card; + int ret; + + card = &acp6x_card; + acp6x_card.dev = &pdev->dev; + + platform_set_drvdata(pdev, card); + snd_soc_card_set_drvdata(card, machine); + ret = devm_snd_soc_register_card(&pdev->dev, card); + if (ret) { + return dev_err_probe(&pdev->dev, ret, + "snd_soc_register_card(%s) failed\n", + card->name); + } + return 0; +} + +static struct platform_driver acp6x_mach_driver = { + .driver = { + .name = "acp_yc_mach", + .pm = &snd_soc_pm_ops, + }, + .probe = acp6x_probe, +}; + +module_platform_driver(acp6x_mach_driver); + +MODULE_AUTHOR("Vijendar.Mukunda@amd.com"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); From patchwork Mon Oct 11 05:56:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 12549079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CAF6C433F5 for ; Mon, 11 Oct 2021 05:43:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF81760F6E for ; Mon, 11 Oct 2021 05:43:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BF81760F6E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 29B1E168B; Mon, 11 Oct 2021 07:42:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 29B1E168B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633931000; bh=dZAjHIjCkxuOy7H3UVghj2rIldKesFdL8r/fSAlx4hQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bj/0JSeiIRt+0TO4/xGIPixO2wPOvq9xbu6nmxR0mJG6FjFNcdJsA7Gs4f8zK8HCd TOkyA7gxhscJ95HzsKbvzE/eeE8KHIO2FhzOGzk5G9OWasj8nQeVZaAo/Zh0KVQuzI hhjgjEtlWLq1EOCBE5Ech/y5zpoVZ7BLsQLco4XA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id F16A8F80104; Mon, 11 Oct 2021 07:40:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 33D3AF80525; Mon, 11 Oct 2021 07:40:52 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2060c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::60c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2B888F80430 for ; Mon, 11 Oct 2021 07:40:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2B888F80430 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="U+i7ImM+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JMbMtG8NDsbm6ekXoTf9HME4rru/du8udhyDn4zDA3atJH2Dku3lwSCB6irYqWReOwihWVyBkKUf6atYBA1ohpXTaMj035xW6gtSTd/Vm6FOugInMEoMExmmPPcuohtlwQ2Fm4JSgoRHb1dDz980urkG8ql5QlyipmFe5rjwKagm6r6kxqrSCrs12LEw+uDqVi+1Pjea9HdcFlEtNAIACvkeLEkdBPSKrwbXNa1b6ZjdTGEd9vCeWf9hjCn5sm4Ozeis/gbw/iWjtTlZtWiiNmftAqaX4k3PFSLipXN8xeNvUzMfrDcPT7P4SPWmdM9ZSGOBbF9d7Pc2jKwQk6p23w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nUpL4eafriwOTNpGLtKv7Begs7h9B8kBkqyaMCmbU60=; b=j0/FNUX9Sv89GzzYoyRk+HOqgsEENjbhFt9ySL9yYJ5uDBZRp0Vs7tjyzZL1zrX8+DsRcQ1S7juA38XYykeBtQUrBg+cOsHRh7pcJ1Id+bV/PBdb1fcu6dBsjJieJFfOz1t3q6fiGThRY6U8RrkqoRT5GvKFs+KKjteC0kYQaTbqKuR9/7HLZSdD+Y3Z/RBNEG93Htdag+D/qZUGpU0NHSm0HsM/MQRdaGIxRmZfhAvTVvqi6tJHvfy8EuYVNqWByIb0OJVZc3MJG4tr5n2+mgabwVFliTdIGScrd/FHor+6tZOLiU0+ig82LIIClpZJ6hxEv5MJ4Y3S+Kk1Bxilnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nUpL4eafriwOTNpGLtKv7Begs7h9B8kBkqyaMCmbU60=; b=U+i7ImM+gyW1dKfJupz2Aqn/R5fvId5v9ZkTHfvf+25Y1T3vGQANvX/eJhZbudeRtB2eN3Ph83eYYuGqE0BRCabqQiJOtApqMs/yBL2yqIqG4ybBAj16mJxcR2JuCkMHVi61+hAuy//unpJisCCU7NXXxlATSTOUhLmjBhvdpJo= Received: from MW4P223CA0002.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::7) by MN2PR12MB3758.namprd12.prod.outlook.com (2603:10b6:208:169::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Mon, 11 Oct 2021 05:40:14 +0000 Received: from CO1NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:303:80:cafe::b3) by MW4P223CA0002.outlook.office365.com (2603:10b6:303:80::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:40:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT043.mail.protection.outlook.com (10.13.174.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 05:40:13 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:40:12 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 11 Oct 2021 00:40:12 -0500 Received: from LinuxHost.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2308.8 via Frontend Transport; Mon, 11 Oct 2021 00:40:08 -0500 From: Vijendar Mukunda To: , Subject: [PATCH 13/13] ASoC: amd: enable yc machine driver build Date: Mon, 11 Oct 2021 11:26:21 +0530 Message-ID: <20211011055621.13240-14-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> References: <20211011055621.13240-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 250c23e3-c6c6-434f-2fa0-08d98c7998fa X-MS-TrafficTypeDiagnostic: MN2PR12MB3758: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1227; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6/alo1HmBoQBkQsw6/4gQ9yxgRhJzwonwQgsQYcBJ0z2BCn/cer/Xv1SAAC0+Ymcze9lbRo6AIuLnsBtX25a6jBFpf6HK44tALY0dF5icUEseK9aaOaWI/LW2Ef9laEH9+f2NTLteDnFqo3XXM8J8M+7grhJ++GU1wCOGhsk62r6tavtRq3GmngiKtCsJ7DzPbgEJIEx+SqWiEcemVdGuvF8Fb/JqtS6vMkA5dTI70OCCI+41yz8HR0+KlyPVZ1dwnC2ABZ8FwV/p3ENmp3icIsYQ04v1EP01ieKy+YNV8NMEdZi3EJQHdX0xkBCR+NE23Dlflx8dtXHEaGkPIsECJkorBaApIy//8yBpmK9Yy5DQr9CI+pHUjSuMg06nYINHcyb869YDWmBfbk3w9kVOPYW7oGLoVgWRNqI8U09gTsLjpOSgYgx4cUoDE7Kxjw+REy18rEJ4+oewNfP9Uvx36QSDa0C1vzO4RRlQoNNM3ixd6RnOfbgepTYYo50JN8Kzmy/tES4cAxhP/F2p1nzoN8PLDt8Lo/GNedtC7w20ZzuwjH34tH8BIIucMr6vxYFPAyssWNWDtcDOFxMRwfQEj8WMoWaamJaHOLG2ULjBfIcmm9dV8pWg5wtNyDlzkD5RmnmvRz6LzbwggStTuqq6+S690DbIeJoZlGAwGN3WuzTRQHxzz455xo54DdRIw5O/GDVXeou18AA6DTLwJ26Tsodhe6XhAe/yV9CsP5Dv6M= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(5660300002)(36756003)(426003)(6666004)(508600001)(7696005)(36860700001)(336012)(316002)(2906002)(8676002)(356005)(26005)(82310400003)(186003)(70586007)(86362001)(70206006)(8936002)(1076003)(47076005)(4326008)(2616005)(54906003)(110136005)(81166007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 05:40:13.3651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 250c23e3-c6c6-434f-2fa0-08d98c7998fa X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3758 Cc: Pierre-Louis Bossart , Sunil-kumar.Dommati@amd.com, Richard.Gong@amd.com, Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario.Limonciello@amd.com, Vijendar Mukunda , Alexander.Deucher@amd.com, open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Enable YC platform dmic machine driver build. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/Kconfig | 7 +++++++ sound/soc/amd/yc/Makefile | 2 ++ 2 files changed, 9 insertions(+) diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index 42825e8ad2ad..864d80f14421 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -67,3 +67,10 @@ config SND_SOC_AMD_ACP6x depends on X86 && PCI help This option enables ACP v6.x DMIC support on AMD platform + +config SND_SOC_AMD_YC_MACH + tristate "AMD YC support for DMIC" + select SND_SOC_DMIC + depends on SND_SOC_AMD_ACP6x + help + This option enables machine driver for DMIC endpoint diff --git a/sound/soc/amd/yc/Makefile b/sound/soc/amd/yc/Makefile index 20f8dfe6abb4..dc2974440388 100644 --- a/sound/soc/amd/yc/Makefile +++ b/sound/soc/amd/yc/Makefile @@ -2,6 +2,8 @@ # Yellow Carp platform Support snd-pci-acp6x-objs := pci-acp6x.o snd-acp6x-pdm-dma-objs := acp6x-pdm-dma.o +snd-soc-acp6x-mach-objs := acp6x-mach.o obj-$(CONFIG_SND_SOC_AMD_ACP6x) += snd-pci-acp6x.o obj-$(CONFIG_SND_SOC_AMD_ACP6x) += snd-acp6x-pdm-dma.o +obj-$(CONFIG_SND_SOC_AMD_YC_MACH) += snd-soc-acp6x-mach.o