From patchwork Mon May 18 17:16:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 192669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91C25C433DF for ; Mon, 18 May 2020 17:19:53 +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 17069207ED for ; Mon, 18 May 2020 17:19:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="p0LRNfzO"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="NF+VelGQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17069207ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 746641747; Mon, 18 May 2020 19:19:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 746641747 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589822391; bh=D5fITKFJPeZ1X/nUvZ4QzICCBZRH2xmksfOJc4e/8Ps=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=p0LRNfzOVsxTIou7ozQmkMRRFccWBndb5UlVarP+8CfonvIiMHFjFn5jow5xWGptW QbCsjW0NEWlL0FmFkc2g4PRxE6qBu5lhZsOgP4iHxOthicBqnQD/zS6cYoqO7S/w29 ezy0WGGBiNisTnu1ywVXr2/E0M98SdOchzN6AL/g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 86508F802A1; Mon, 18 May 2020 19:17:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E2CF4F8028F; Mon, 18 May 2020 19:17:23 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2040.outbound.protection.outlook.com [40.107.220.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1929CF80213 for ; Mon, 18 May 2020 19:17:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1929CF80213 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="NF+VelGQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=as/h1RoK0/2YvHdsslsnNtgNCb1EQ4WU8ZTzRgcYzoEaFdTziwpfc4C+Qoa/OUG3QvoF/QQea7reuS27za1BYAWDKDIba7N/pbAAyIQkNvlPkGQPX9CH7jdyiPDljgNVxKAwFU5/XmBj0O3jBaFvZP/uD8EsHsDuWGob8kaXgrxOrV7jVaszDVmDuWDh6I+wRug7YneAthkNLk2Cn0j6Y4v/lJR8HmV3dfXvJUIVSFic+T6oU23noZ5ike4ZdqYm9X5fZKrQz2kdqtKd2bBixduUMqGe5rov2SEXkE7puB2ycfrfalskoNXABWV5ZhckkSbfRlUDvfpG1+I8+G+F+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5ILbrMGK1uh6ddCrNvqjFtPFGhrkOgB4RQTK53ejcAA=; b=nN5gOO0DAo6YCrVZ0FR6bSl07B9qpoz3pbew0iIKAdpxkmY/iYYD6gnQbrRwzrrzZcuoXpx3dxAJ7dacrCB8TBioGJ9SwVrI4whDqdafBeUtS4OVud5xQDbiwdy+jjPjwbapM9vFt8uTTRwpo7zq00a2xN+YVdgDJZsApuwPdzXFa9RS76Ef49BEIeSLLsZynz05xQDgAlyqoXX6fP7eSEHohXiaUtscffUJlXqItb5tmobzRX8k5osWGX/O8AcZGhnoebMO5PPx1K4WncGUZT0B7Tp1yYiwItx68aaYnylt9UgBeTjNWcdwyHD9m+7UGre114f2//AhaWMk3TmdUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5ILbrMGK1uh6ddCrNvqjFtPFGhrkOgB4RQTK53ejcAA=; b=NF+VelGQQB3G0mqFw9xzLbOnog9sEDBY6JE8jlKF595ap0KIA0sP8nHS3odWUQzaiPzGCFULDPSVw3X8RdZtPQ5OusmFLHgfQXxq+zAwchRq45j3L49M/YwP/fw0I35dit/Je9SxBBOMP41qAGGBwzgYFAVWE1L/WHTkSeuCz0c= Received: from DM5PR06CA0067.namprd06.prod.outlook.com (2603:10b6:3:37::29) by CH2PR12MB4183.namprd12.prod.outlook.com (2603:10b6:610:7a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20; Mon, 18 May 2020 17:17:12 +0000 Received: from DM6NAM11FT046.eop-nam11.prod.protection.outlook.com (2603:10b6:3:37:cafe::dd) by DM5PR06CA0067.outlook.office365.com (2603:10b6:3:37::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Mon, 18 May 2020 17:17:12 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB01.amd.com (165.204.84.17) by DM6NAM11FT046.mail.protection.outlook.com (10.13.172.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3000.19 via Frontend Transport; Mon, 18 May 2020 17:17:11 +0000 Received: from SATLEXMB02.amd.com (10.181.40.143) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 18 May 2020 12:17:10 -0500 Received: from atgasia02.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 18 May 2020 12:17:09 -0500 From: Vijendar Mukunda To: , , Subject: [PATCH v3 02/14] ASoC: amd: add Renoir ACP PCI driver Date: Tue, 19 May 2020 01:16:52 +0800 Message-ID: <20200518171704.24999-3-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> References: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB01.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(396003)(376002)(39860400002)(136003)(346002)(46966005)(82740400003)(426003)(26005)(8936002)(7696005)(336012)(81166007)(2616005)(82310400002)(186003)(356005)(70586007)(8676002)(36756003)(70206006)(1076003)(2906002)(86362001)(4326008)(54906003)(110136005)(47076004)(316002)(478600001)(5660300002)(6666004); DIR:OUT; SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 05765971-a7a6-448f-7fbe-08d7fb4f4d77 X-MS-TrafficTypeDiagnostic: CH2PR12MB4183: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:565; X-Forefront-PRVS: 04073E895A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qHL3naCt5yUdrWxpXQqYzf1mukAqcxNUHXMTWWdV316MKzl13z7KtITw/ThHkfeLHkspDlfvd+ECOGatxhRFR47iEuPqQfnWU988TC45h2r7k+51rpExKvJM4s1n88mviMfObPjJxbM7N4iqM3olcoDiddhX2K+I39o39fMWkkx74hKEAEys9LydxfmanahG7ZCLxkbLDn0uUkGMV3EDHnY5cR4k5D1IM115F1a3BmGhbZCferBZTieyPqAqVhmtOCeM5/Ev+ZWqH0ewiaL2W9nB41VUMVS//5FsEwMi21MvGNxhezbCEw0fndSnLbr9QAZ0qCi9COUVnTP6pEnzzvqh8VDfH3RMOLZUP3H/fBS6gyoPgzvY2zcsFjh5+IMs9BeaX2ffYgXyg0rPBlLH+xDR9OyIGcJGLULDnP82kSuklO6ZUxz9982oDKuEM0IKqmHrCs1q6QT1h8AB6nWw80FMcmYCyyGM267T1lDnaCpcV7oMJ5TWtlHjqDAi518YwiXzq3JKaqtgeYJbFoIZXA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2020 17:17:11.5900 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05765971-a7a6-448f-7fbe-08d7fb4f4d77 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4183 Cc: Alexander.Deucher@amd.com, Vijendar Mukunda 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/renoir/rn-pci-acp3x.c | 87 +++++++++++++++++++++++++++++ sound/soc/amd/renoir/rn_acp3x.h | 21 +++++++ 2 files changed, 108 insertions(+) create mode 100644 sound/soc/amd/renoir/rn-pci-acp3x.c create mode 100644 sound/soc/amd/renoir/rn_acp3x.h diff --git a/sound/soc/amd/renoir/rn-pci-acp3x.c b/sound/soc/amd/renoir/rn-pci-acp3x.c new file mode 100644 index 000000000000..56b76e355cd4 --- /dev/null +++ b/sound/soc/amd/renoir/rn-pci-acp3x.c @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: GPL-2.0+ +// +// AMD Renoir ACP PCI Driver +// +//Copyright 2020 Advanced Micro Devices, Inc. + +#include +#include +#include + +#include "rn_acp3x.h" + +struct acp_dev_data { + void __iomem *acp_base; +}; + +static int snd_rn_acp_probe(struct pci_dev *pci, + const struct pci_device_id *pci_id) +{ + struct acp_dev_data *adata; + int ret; + u32 addr; + + 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 acp_dev_data), + GFP_KERNEL); + if (!adata) { + ret = -ENOMEM; + goto release_regions; + } + + addr = pci_resource_start(pci, 0); + adata->acp_base = devm_ioremap(&pci->dev, addr, + pci_resource_len(pci, 0)); + if (!adata->acp_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_rn_acp_remove(struct pci_dev *pci) +{ + pci_disable_msi(pci); + pci_release_regions(pci); + pci_disable_device(pci); +} + +static const struct pci_device_id snd_rn_acp_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_rn_acp_ids); + +static struct pci_driver rn_acp_driver = { + .name = KBUILD_MODNAME, + .id_table = snd_rn_acp_ids, + .probe = snd_rn_acp_probe, + .remove = snd_rn_acp_remove, +}; + +module_pci_driver(rn_acp_driver); + +MODULE_AUTHOR("Vijendar.Mukunda@amd.com"); +MODULE_DESCRIPTION("AMD ACP Renoir PCI driver"); +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/amd/renoir/rn_acp3x.h b/sound/soc/amd/renoir/rn_acp3x.h new file mode 100644 index 000000000000..da5715759646 --- /dev/null +++ b/sound/soc/amd/renoir/rn_acp3x.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * AMD ALSA SoC PDM Driver + * + * Copyright 2020 Advanced Micro Devices, Inc. + */ + +#include "rn_chip_offset_byte.h" + +#define ACP_PHY_BASE_ADDRESS 0x1240000 +#define ACP_DEVICE_ID 0x15E2 + +static inline u32 rn_readl(void __iomem *base_addr) +{ + return readl(base_addr - ACP_PHY_BASE_ADDRESS); +} + +static inline void rn_writel(u32 val, void __iomem *base_addr) +{ + writel(val, base_addr - ACP_PHY_BASE_ADDRESS); +} From patchwork Mon May 18 17:16:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 192668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E6F1C433DF for ; Mon, 18 May 2020 17:20: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 ECAFB2070A for ; Mon, 18 May 2020 17:20:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="BzPiNh35"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="3dcaz19a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECAFB2070A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4712B173C; Mon, 18 May 2020 19:19:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4712B173C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589822449; bh=XXCnLF1cNCGpEN3F+7JZigjD98xMguZnUE+XGV0qCI8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BzPiNh35r2BrkVTP2lhGm7kQRgMLETetkhGlmTaVv5e6iI0L0Sk+HyvJ/fi82aj4r VnTcXs9TftpEqUToB93bjw2HLVE/WHQUEZbHhbpA/TZngsLlGqiFNDxn/y3IYA5XPp /23fiKNJAnQsIH03aR3Q9ssv/Apyvk4pCyQ1asGE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 148D1F802BE; Mon, 18 May 2020 19:17:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 91F84F802A7; Mon, 18 May 2020 19:17:27 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20626.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::626]) (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 1615EF800C9 for ; Mon, 18 May 2020 19:17:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1615EF800C9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="3dcaz19a" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=If265OWmTSCmXNKI058L7kRGaxrMi9fneucUNEsDj5MiKF6X4rxudwzYfieDqnsUe1n5rJM5asYfzB3AVb7MPMFGiZsuicsNRVqB+cAbWtWZJWpRVLCniKwbsx25Jx5FZzPSxFL3GRx2WWX+U88Dkxm/St6AmZPYE8jv4GCF37enTriK/Iq3X1T8W75G6gRcHsuEA8p04M8iHsCMwsLEuo0F/4NyTmLX9HZzhC5oIossEbypGaN2qhMDWMqlAGD/hW5ZTr2I5gRn/YiaNeZqjIcqIQ+m2SvcpjS5qHokSnVFiuQ80kxsxb3uACI4+hS6Id2uAHF+pL12xU13GieI4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0tm4oFJ3XO2ZZTSDCdwax0pIwSrzNci+VwHVjafDfUM=; b=JF7/im9AIQEeWiNPBUI+WD6DkT5P5zF+8AZ7ZvA18Am5FeE66D4JCqxDmk4HVjsmr3yukJju4cPrjPi5t4HHvQRwq72XzDGILgLxNIFJ9WSJHPof23a1PQKBvsBF8pqjC/L8mKj5thSKDNEHRm7yfovqeEiv0IuuSbuPmbNCGWoGgeen/W8EsB5qpyyLzOj99gNdvuq9ascafMxvnfCvc+WUIIuKT61cJLrgNBb9xMO0Ccwkaqa47FYet4IZy/ZVnGzh/tX4ahECZAfKeWo4shu2FZH1Wx6/xgCEUxbrM9X6hKOY2j4+2Dxs+KoHc2DVfyX7qlJKmdVdzbXJr0DjjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0tm4oFJ3XO2ZZTSDCdwax0pIwSrzNci+VwHVjafDfUM=; b=3dcaz19auKyads/nhBITAXJWfTSzyuAQkTg3/4ct1UA4j7TgRSINpLOionTUye9dXfyLxPvON0lIwKYikBq7UckvRfXQatVksHVAmLveDTEbKelp98I+2C1U1XLVAvm7Y5EYk3AWas4PWmEVKJ+6UFmQbv8RjC9hleKYp/GJYnA= Received: from MWHPR18CA0027.namprd18.prod.outlook.com (2603:10b6:320:31::13) by SN6PR12MB2800.namprd12.prod.outlook.com (2603:10b6:805:6c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.27; Mon, 18 May 2020 17:17:15 +0000 Received: from CO1NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:320:31:cafe::84) by MWHPR18CA0027.outlook.office365.com (2603:10b6:320:31::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Mon, 18 May 2020 17:17:15 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by CO1NAM11FT003.mail.protection.outlook.com (10.13.175.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3000.19 via Frontend Transport; Mon, 18 May 2020 17:17:15 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 18 May 2020 12:17:14 -0500 Received: from SATLEXMB02.amd.com (10.181.40.143) 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.1713.5; Mon, 18 May 2020 12:17:14 -0500 Received: from atgasia02.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 18 May 2020 12:17:13 -0500 From: Vijendar Mukunda To: , , Subject: [PATCH v3 04/14] ASoC: amd: create acp3x pdm platform device Date: Tue, 19 May 2020 01:16:54 +0800 Message-ID: <20200518171704.24999-5-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> References: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB02.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(396003)(136003)(376002)(346002)(39860400002)(46966005)(6666004)(5660300002)(2616005)(82310400002)(478600001)(356005)(81166007)(110136005)(54906003)(186003)(316002)(426003)(7696005)(26005)(336012)(86362001)(47076004)(8936002)(2906002)(82740400003)(1076003)(4326008)(36756003)(8676002)(70206006)(70586007)(42413003)(32563001); DIR:OUT; SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bbadeb54-e995-4c5c-fe41-08d7fb4f4f98 X-MS-TrafficTypeDiagnostic: SN6PR12MB2800: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 04073E895A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TlnzEuSehxb0iwFu9THEphcvdjpUKB9+qOnZTsDCnbscZgboE9hcM8GGM0CNk6iuZ0NiLZR3ZWra4hR8dGEqMALJQqy1iSSKhHaL89YCHPaaoiJaGWeNAjo74HtUwihZqXgS2PbWHtKk8fFdjeDex0s5ch7sQo2KQdVsDDKhkrxdDncgTqm5FnVZrmzGchReu+zDSAg4LQwWjpp3xyWC7tjGzgEbVSOlXSAG1ssPj2z6nMDf1sQNxXE3nPJhsVj90tISAjr1xrxULfFX88JkDlEchW+bG8Aqc9kxO0248045pR9KGoa2U53GWxYzVlTRag2oRePkVSB2DY5eruAx/FIuVMBAOSg58khd/T00RJQD8PNwzty2WMO8otJNTF24A/nPh9AvTxPSZRjOfTHLvWcNH7sKOC197d1JtfNbndkrQlPAmVbGuE37t1ybWyhberuU78LgpO+Jb0P1YteYXAjQVVi12O1NOYenXodLQB/etKxPsfB3gPoIxZe75aNsC3RyhDUKbJHSMX1xiz1jaHjqLGNVyb/j1kkq+isTJX4XAydn4GR1ufXpc03Xmqms X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2020 17:17:15.1010 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bbadeb54-e995-4c5c-fe41-08d7fb4f4f98 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=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2800 Cc: Alexander.Deucher@amd.com, Vijendar Mukunda 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 3x IP has PDM decoder as one of IP blocks. Create a platform device for it, so that the PDM platform driver can be bound to this device. Pass PCI resources like MMIO, irq to this platform device. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/renoir/rn-pci-acp3x.c | 61 ++++++++++++++++++++++++++++- sound/soc/amd/renoir/rn_acp3x.h | 3 ++ 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/renoir/rn-pci-acp3x.c b/sound/soc/amd/renoir/rn-pci-acp3x.c index 429813f6ba1c..362409ef0d85 100644 --- a/sound/soc/amd/renoir/rn-pci-acp3x.c +++ b/sound/soc/amd/renoir/rn-pci-acp3x.c @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include "rn_acp3x.h" @@ -17,6 +19,8 @@ MODULE_PARM_DESC(acp_power_gating, "Enable acp power gating"); struct acp_dev_data { void __iomem *acp_base; + struct resource *res; + struct platform_device *pdev; }; static int rn_acp_power_on(void __iomem *acp_base) @@ -151,6 +155,8 @@ static int snd_rn_acp_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { struct acp_dev_data *adata; + struct platform_device_info pdevinfo; + unsigned int irqflags; int ret; u32 addr; @@ -172,20 +178,70 @@ static int snd_rn_acp_probe(struct pci_dev *pci, goto release_regions; } + /* check for msi interrupt support */ + ret = pci_enable_msi(pci); + if (ret) + /* msi is not enabled */ + irqflags = IRQF_SHARED; + else + /* msi is enabled */ + irqflags = 0; + addr = pci_resource_start(pci, 0); adata->acp_base = devm_ioremap(&pci->dev, addr, pci_resource_len(pci, 0)); if (!adata->acp_base) { ret = -ENOMEM; - goto release_regions; + goto disable_msi; } pci_set_master(pci); pci_set_drvdata(pci, adata); ret = rn_acp_init(adata->acp_base); if (ret) - goto release_regions; + goto disable_msi; + + adata->res = devm_kzalloc(&pci->dev, + sizeof(struct resource) * 2, + GFP_KERNEL); + if (!adata->res) { + ret = -ENOMEM; + goto de_init; + } + + adata->res[0].name = "acp_pdm_iomem"; + adata->res[0].flags = IORESOURCE_MEM; + adata->res[0].start = addr; + adata->res[0].end = addr + (ACP_REG_END - ACP_REG_START); + adata->res[1].name = "acp_pdm_irq"; + adata->res[1].flags = IORESOURCE_IRQ; + adata->res[1].start = pci->irq; + adata->res[1].end = pci->irq; + + memset(&pdevinfo, 0, sizeof(pdevinfo)); + pdevinfo.name = "acp_rn_pdm_dma"; + pdevinfo.id = 0; + pdevinfo.parent = &pci->dev; + pdevinfo.num_res = 2; + pdevinfo.res = adata->res; + pdevinfo.data = &irqflags; + pdevinfo.size_data = sizeof(irqflags); + + adata->pdev = platform_device_register_full(&pdevinfo); + if (IS_ERR(adata->pdev)) { + dev_err(&pci->dev, "cannot register %s device\n", + pdevinfo.name); + ret = PTR_ERR(adata->pdev); + goto unregister_devs; + } return 0; +unregister_devs: + platform_device_unregister(adata->pdev); +de_init: + if (rn_acp_deinit(adata->acp_base)) + dev_err(&pci->dev, "ACP de-init failed\n"); +disable_msi: + pci_disable_msi(pci); release_regions: pci_release_regions(pci); disable_pci: @@ -200,6 +256,7 @@ static void snd_rn_acp_remove(struct pci_dev *pci) int ret; adata = pci_get_drvdata(pci); + platform_device_unregister(adata->pdev); ret = rn_acp_deinit(adata->acp_base); if (ret) dev_err(&pci->dev, "ACP de-init failed\n"); diff --git a/sound/soc/amd/renoir/rn_acp3x.h b/sound/soc/amd/renoir/rn_acp3x.h index ec2a85085163..5e4fd99397d5 100644 --- a/sound/soc/amd/renoir/rn_acp3x.h +++ b/sound/soc/amd/renoir/rn_acp3x.h @@ -8,6 +8,9 @@ #include "rn_chip_offset_byte.h" #define ACP_PHY_BASE_ADDRESS 0x1240000 +#define ACP_REG_START 0x1240000 +#define ACP_REG_END 0x1250200 + #define ACP_DEVICE_ID 0x15E2 #define ACP_POWER_ON 0x00 #define ACP_POWER_ON_IN_PROGRESS 0x01 From patchwork Mon May 18 17:16:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 192667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 006EAC433DF for ; Mon, 18 May 2020 17:22:15 +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 7FCC42070A for ; Mon, 18 May 2020 17:22:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="dj+yX6a9"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="LSpNUwqk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FCC42070A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B9E471744; Mon, 18 May 2020 19:21:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B9E471744 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589822532; bh=jLwFtK/csV9DfuGb6qmfOcHdTFsqFVN2sqpyBYzKErY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dj+yX6a9UjOu0VV2mCOVjl3EfELD0wTJEMVXrmK+p8XhvW7bXIG5rRW2u3v1qDDaH /yEjKOcjCMpJgdSL2nFhcizV6QP2x6S/hqm+FLAb9yD8USfTh51M7mn+NLwlgb3gkZ BSbKYsmti1aNpfJhl6jM2CXUvXMcnEv2pYh/5S+0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0814CF802DF; Mon, 18 May 2020 19:17:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B9FC0F80213; Mon, 18 May 2020 19:17:33 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2060.outbound.protection.outlook.com [40.107.223.60]) (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 29AB1F80213 for ; Mon, 18 May 2020 19:17:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 29AB1F80213 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="LSpNUwqk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CHTYswTgtCPGSdxpnfDM0xmNfuYQ957bSEXP23DXSLP1ZQyVHRGkacPNNZ+vzrFrcheXb3W6G9RoXCVALcCB5vHgkjGxrjS9WweXtD8YO2AbIbpbNYOLx2/SPETHLzDT/p7pXwOoOfkSfdX2GUOab8AOzUZm+yOai+ZDX5YZmKVguZqIe/URgQ7ofgp1sFzGEvvXMgE8JELK2OW6YG9wTdnAyl+Ygr547zK0EuyYaMzknl5SmfGz20Zd6iViDrv7DEQAvpiIorqzHMGjF8IqW6qAR9zErvs0BfEQMaEUR0EiG53KDPTjmpJw0cewFmarNZopvTT0B4eiHp9nF5hYlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o2IFhCrOv7HBYq0YMXJA07ZCZEGuMW53IP0NhL17iDI=; b=NMk9OF9+gV87LoYJNitw2LC8J8CAyamSPZcPOEB8Ggnh7fI65WKUmk/ZZ/O+YZaqzg+EI9o/VRgcAuc9Sl39a+PpWR1o0by6V20aae4XsmRngI9qLm1f8+1QhrYWZoKGZUWRpbkVrJGaAKPItmHkx6Y87cjPsj68JID3TBrIQNrhqJTOht2mivRQS0FRAcm3QT2lS57vNFT7S6MdTYaWWkkxvXnI/YEeaOGTkwkYuC6rhyg4gU0iBRIiFj3PtAJgX/jHr2WjcQfWUTarQn6yVKPIKxVyGUhPqhYlfliBBYcQuMg6VyZDvbcfPhAxALX2P3dAxM6nXVSl4YoFzmHT1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o2IFhCrOv7HBYq0YMXJA07ZCZEGuMW53IP0NhL17iDI=; b=LSpNUwqkH9CLhvXtoS/F/yjqLTC5bQK4i6YrHtBadfFpOAZ2iV8I/hFvcO4WvpyfIPR+D3lYEnIkJmTi+glpYztc2VDm5fGOeTFpfo1ak9Y4wl90pUEPWCTaZU1qVDrGhzZyL1NZWmgiowfR11x8lzN9Z6vtSaQ1IaD2HKE2H18= Received: from CO2PR06CA0059.namprd06.prod.outlook.com (2603:10b6:104:3::17) by DM5PR12MB1515.namprd12.prod.outlook.com (2603:10b6:4:6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20; Mon, 18 May 2020 17:17:21 +0000 Received: from CO1NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:104:3:cafe::ee) by CO2PR06CA0059.outlook.office365.com (2603:10b6:104:3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Mon, 18 May 2020 17:17:21 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by CO1NAM11FT005.mail.protection.outlook.com (10.13.174.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3000.19 via Frontend Transport; Mon, 18 May 2020 17:17:20 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 18 May 2020 12:17:20 -0500 Received: from SATLEXMB02.amd.com (10.181.40.143) 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.1713.5; Mon, 18 May 2020 12:17:20 -0500 Received: from atgasia02.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 18 May 2020 12:17:18 -0500 From: Vijendar Mukunda To: , , Subject: [PATCH v3 07/14] ASoC: amd: add acp3x pdm driver dma ops Date: Tue, 19 May 2020 01:16:57 +0800 Message-ID: <20200518171704.24999-8-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> References: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB02.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(346002)(39860400002)(136003)(396003)(376002)(46966005)(4326008)(8936002)(336012)(426003)(316002)(7696005)(82310400002)(2906002)(356005)(186003)(1076003)(36756003)(81166007)(82740400003)(5660300002)(70586007)(70206006)(110136005)(47076004)(478600001)(86362001)(26005)(6666004)(54906003)(2616005)(8676002)(42413003)(32563001); DIR:OUT; SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e83d37e6-3ddd-4424-30b1-08d7fb4f5316 X-MS-TrafficTypeDiagnostic: DM5PR12MB1515: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 04073E895A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +sOa8w0F59TZlstw73NpJIfMUOUNuIoH3ET0zeD3PErdHvOnYE5XYpxXs8aptsz1lsa3cfJIQFxI1NGlqZDGzY5mAA2RtDNuULgDRbOgTCOd2owFJPiT0H3WXwnzY9mewS7Wpc75O4zhxyv7P4Dli99YDdvLrkJOLvoMuqtwdYgBlSs+mMtoPccfYGXXg1IuU9NgT5X7D3I1Zqds4MPOB/bQ9rkTRXg2nozv6G0v861PDR3vFgDX+SnglxStgVk3Bai67ccJ3OflCotM6/F/m6VwIHjhd73wv9Ph2afhIkM/2NsKKCmBLTPdS+SsnxUaXFm+fHF4aboX2ERisk36t8QL6QPRmJdXWrlSxMtXFVYehUyeQO7ZECYreLSHN29chTthyQ6fKE63Cg/wpIwWIw7oV7pccSCNV5FWxqukXYE+g7ANJv3bWAcCyTZJCGLXEgq4fOPtS2vDRSzDlm0lhYulh4Ol6/p+Gl6yUnuM+6aieNYyJoSpQ8Zq3DgHSaaODIIYHRMk5nZgtTHEkFRYKWWEiNOzuoJvb8011prOk+GvfgX9oDHFrUTvUx3t66j1 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2020 17:17:20.9456 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e83d37e6-3ddd-4424-30b1-08d7fb4f5316 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=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1515 Cc: Alexander.Deucher@amd.com, Vijendar Mukunda 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/renoir/acp3x-pdm-dma.c | 195 +++++++++++++++++++++++++++ sound/soc/amd/renoir/rn_acp3x.h | 29 ++++ 2 files changed, 224 insertions(+) diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c index fdac2c1e3acd..8bb03fa5b4a5 100644 --- a/sound/soc/amd/renoir/acp3x-pdm-dma.c +++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c @@ -16,6 +16,25 @@ #define DRV_NAME "acp_rn_pdm_dma" +static const struct snd_pcm_hardware acp_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 irqreturn_t pdm_irq_handler(int irq, void *dev_id) { struct pdm_dev_data *rn_pdm_data; @@ -41,6 +60,176 @@ static irqreturn_t pdm_irq_handler(int irq, void *dev_id) return IRQ_NONE; } +static void init_pdm_ring_buffer(u32 physical_addr, + u32 buffer_size, + u32 watermark_size, + void __iomem *acp_base) +{ + rn_writel(physical_addr, acp_base + ACP_WOV_RX_RINGBUFADDR); + rn_writel(buffer_size, acp_base + ACP_WOV_RX_RINGBUFSIZE); + rn_writel(watermark_size, acp_base + ACP_WOV_RX_INTR_WATERMARK_SIZE); + rn_writel(0x01, acp_base + ACPAXI2AXI_ATU_CTRL); +} + +static void enable_pdm_interrupts(void __iomem *acp_base) +{ + u32 ext_int_ctrl; + + ext_int_ctrl = rn_readl(acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_int_ctrl |= PDM_DMA_INTR_MASK; + rn_writel(ext_int_ctrl, acp_base + ACP_EXTERNAL_INTR_CNTL); +} + +static void disable_pdm_interrupts(void __iomem *acp_base) +{ + u32 ext_int_ctrl; + + ext_int_ctrl = rn_readl(acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_int_ctrl |= ~PDM_DMA_INTR_MASK; + rn_writel(ext_int_ctrl, acp_base + ACP_EXTERNAL_INTR_CNTL); +} + +static void config_acp_dma(struct pdm_stream_instance *rtd, int direction) +{ + u16 page_idx; + u32 low, high, val; + dma_addr_t addr; + + addr = rtd->dma_addr; + val = 0; + + /* Group Enable */ + rn_writel(ACP_SRAM_PTE_OFFSET | BIT(31), rtd->acp_base + + ACPAXI2AXI_ATU_BASE_ADDR_GRP_1); + rn_writel(PAGE_SIZE_4K_ENABLE, rtd->acp_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); + + rn_writel(low, rtd->acp_base + ACP_SCRATCH_REG_0 + val); + high |= BIT(31); + rn_writel(high, rtd->acp_base + ACP_SCRATCH_REG_0 + val + 4); + val += 8; + addr += PAGE_SIZE; + } +} + +static int acp_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 = acp_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; + } + + enable_pdm_interrupts(adata->acp_base); + + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + adata->capture_stream = substream; + + pdm_data->acp_base = adata->acp_base; + runtime->private_data = pdm_data; + return ret; +} + +static int acp_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->dma_buffer.addr; + rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); + config_acp_dma(rtd, substream->stream); + init_pdm_ring_buffer(MEM_WINDOW_START, size, period_bytes, + rtd->acp_base); + return 0; +} + +static u64 acp_pdm_get_byte_count(struct pdm_stream_instance *rtd, + int direction) +{ + union acp_pdm_dma_count byte_count; + + byte_count.bcount.high = + rn_readl(rtd->acp_base + + ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH); + byte_count.bcount.low = + rn_readl(rtd->acp_base + + ACP_WOV_RX_LINEARPOSITIONCNTR_LOW); + return byte_count.bytescount; +} + +static snd_pcm_uframes_t acp_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 = acp_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 acp_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 acp_pdm_dma_mmap(struct snd_soc_component *component, + struct snd_pcm_substream *substream, + struct vm_area_struct *vma) +{ + return snd_pcm_lib_default_mmap(substream, vma); +} + +static int acp_pdm_dma_close(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct pdm_dev_data *adata = dev_get_drvdata(component->dev); + + disable_pdm_interrupts(adata->acp_base); + adata->capture_stream = NULL; + return 0; +} + static struct snd_soc_dai_driver acp_pdm_dai_driver = { .capture = { .rates = SNDRV_PCM_RATE_48000, @@ -55,6 +244,12 @@ static struct snd_soc_dai_driver acp_pdm_dai_driver = { static const struct snd_soc_component_driver acp_pdm_component = { .name = DRV_NAME, + .open = acp_pdm_dma_open, + .close = acp_pdm_dma_close, + .hw_params = acp_pdm_dma_hw_params, + .pointer = acp_pdm_dma_pointer, + .mmap = acp_pdm_dma_mmap, + .pcm_construct = acp_pdm_dma_new, }; static int acp_pdm_audio_probe(struct platform_device *pdev) diff --git a/sound/soc/amd/renoir/rn_acp3x.h b/sound/soc/amd/renoir/rn_acp3x.h index 1ad8a7845fda..3536d24374f3 100644 --- a/sound/soc/amd/renoir/rn_acp3x.h +++ b/sound/soc/amd/renoir/rn_acp3x.h @@ -29,13 +29,42 @@ #define ACP_ERROR_MASK 0x20000000 #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 ACP_SRAM_PTE_OFFSET 0x02050000 +#define PAGE_SIZE_4K_ENABLE 0x2 +#define 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 struct pdm_dev_data { u32 pdm_irq; void __iomem *acp_base; struct snd_pcm_substream *capture_stream; }; +struct pdm_stream_instance { + u16 num_pages; + u16 channels; + dma_addr_t dma_addr; + u64 bytescount; + void __iomem *acp_base; +}; + +union acp_pdm_dma_count { + struct { + u32 low; + u32 high; + } bcount; + u64 bytescount; +}; + static inline u32 rn_readl(void __iomem *base_addr) { return readl(base_addr - ACP_PHY_BASE_ADDRESS); From patchwork Mon May 18 17:16:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 192666 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48BD8C433DF for ; Mon, 18 May 2020 17:23:15 +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 C79A5204EC for ; Mon, 18 May 2020 17:23:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="hPYMZRfh"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="RpYhoXyq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C79A5204EC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3128C1764; Mon, 18 May 2020 19:22:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3128C1764 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589822593; bh=SmuWqsHQgBYc1mZUNM16UgUr8TU8HY9Vw76+wqUvMYw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hPYMZRfhW8xn6J3DDlIbRUFRVf9LcHrW6W+g9xebQMlmRx3U5YBFt+M2YNpyKjuSR WmPqP0UucTJX8bnrZofUs5Svff2ziH7sd1YTqyauOPXvb7KOjqGC37MPphI+W3RoVr XuKc8rHV46mZKGQxdUomOT+vg8He6v40xap1xJtU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 920CBF802F9; Mon, 18 May 2020 19:17:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3563BF802D2; Mon, 18 May 2020 19:17:35 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2061.outbound.protection.outlook.com [40.107.94.61]) (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 9FAD9F802A7 for ; Mon, 18 May 2020 19:17:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9FAD9F802A7 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="RpYhoXyq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LL2MDLAvPGSDLxkj7RkBF4Tiec7spJifuwK6k69r/5PD6rGtlmE/hJdAm5yz1w/DAUC+dhslVsHgCpsyW/pAXHxJxCK/Xn9k8gFgBiAi8lml85jP9HXN7/jAogdIokqxLwv7NXOkPtSnDPIwBThnkol756lO4YeAuwBFj2wCtxUhfzX/QG+LSqFKke3VP4WWCVhWh8JtTuSFabPhXnAZpEONahdvGe9YSiUoKbX2ZsvCCU3EzH3DV5p/PnApOn9UhC0eTnA/skuk7H5xmqYwDcL7DnDmCj7C0zPLLfacWn2icB+sB6IMjYo1UAR9XL5auHh9cUpiDopU04nlgyZluw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I4AMcxRGKmjPDc4PFWzXOy7ZjSYzAI+QERDBjgeC7Lw=; b=DYQQ3Gbm2PMi2L79A+ozXo9b/LE6Ehm6qYoaKv7tAvtF6mHKyd6W+kEeyT3to8Q0AadFVb52dj7oiopy+dxFFoLm4Rfs8HPVC3Tf0REWh9MUh2CiLxvfkcrppEbI666hRVk7C03TWED1XoEM6RfINhG4en/GxRDxp2Logz2kbAk9Eugj//DxoowmKKAQVdTUQsT7YPh33EMMCARURZ7VvXG7zrrwEwQG4ZAt530ynlfJ4SQqN55I7R8ptPp9MldHGQkN5Ef7zAcA2IbZc9qBTI6rInyOeun139w3+Lh2+P7YJjh2A0axhKh/owZ7edm3Wi7u4HFdhWtwsvqS64i2tw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I4AMcxRGKmjPDc4PFWzXOy7ZjSYzAI+QERDBjgeC7Lw=; b=RpYhoXyqsfZUb/VOodHV/crxoo7MxZGNW05RMjcLogK64KLOWcYbwOWSGwAJyBW1j7ph8ig+QC8eJ8Vz1bQHSIcGhGWqRt3syKEbb/u/b70+31tTZPnd7Waau6jbhh7aKs24sXKr51TXpF2fZ2syVQfJRFirLEiE7/WDys0TxgU= Received: from DM5PR21CA0034.namprd21.prod.outlook.com (2603:10b6:3:ed::20) by DM5PR12MB2566.namprd12.prod.outlook.com (2603:10b6:4:b4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.27; Mon, 18 May 2020 17:17:23 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:3:ed:cafe::d4) by DM5PR21CA0034.outlook.office365.com (2603:10b6:3:ed::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.5 via Frontend Transport; Mon, 18 May 2020 17:17:23 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB01.amd.com (165.204.84.17) by DM6NAM11FT010.mail.protection.outlook.com (10.13.172.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3000.19 via Frontend Transport; Mon, 18 May 2020 17:17:22 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 18 May 2020 12:17:22 -0500 Received: from SATLEXMB02.amd.com (10.181.40.143) 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.1713.5; Mon, 18 May 2020 12:17:22 -0500 Received: from atgasia02.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 18 May 2020 12:17:20 -0500 From: Vijendar Mukunda To: , , Subject: [PATCH v3 08/14] ASoC: amd: add ACP PDM DMA driver dai ops Date: Tue, 19 May 2020 01:16:58 +0800 Message-ID: <20200518171704.24999-9-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> References: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB01.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(346002)(376002)(136003)(396003)(39860400002)(46966005)(47076004)(6666004)(26005)(1076003)(36756003)(82740400003)(5660300002)(186003)(7696005)(2616005)(8936002)(70206006)(70586007)(2906002)(82310400002)(356005)(86362001)(81166007)(110136005)(54906003)(316002)(478600001)(4326008)(336012)(426003)(8676002); DIR:OUT; SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97aa8385-3ea2-416f-93ff-08d7fb4f5423 X-MS-TrafficTypeDiagnostic: DM5PR12MB2566: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:175; X-Forefront-PRVS: 04073E895A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MlwwM8EHy8baj85HLCpyqJzK2p6ARaEB5aLRI+zQOjFgueprcJFPFTkN6DXk52sjQ729tXEqa+9Z0fpEGHAueo1Wy3GPaQeMJqOHs0joS3qsvm8zok2MlF9AUj9ilSlx0h2KLMgWM/gmqxY8vqOKoFLaevzKsKvrzglIET3x83DNXEncdGFaIWWO/FUfyaI5IQo4sIHt0G8kGXFReRKUr+QAGfZTbEUrg2jLfNLVHMk25nSFhAubIRCHVG6x3GMmkENBE9cv1DsvCA1aeI1bcntTYllczgjuKsve613YRVh405qkAtly/IebaVVIGhkwmGnQWSFG9y7PXjef39rMN9Inc0tp8LPkzyxUHyMfY4DC9Mme25QLhxJYJpHb9WSb9awtwPXlOjFsGhK5ejA6nj5Q8nXmWZ88y1DtBPU56vpsxnMpEuhlPF587o4akTqq3PyOb86oGLGB6tKVsrlOS/KnSKLjia/wyqvltQQHuW8PAGNNGPLd8C2quaUFOoGOhih+LRuE8woXOp0+NKjP8w== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2020 17:17:22.7920 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97aa8385-3ea2-416f-93ff-08d7fb4f5423 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2566 Cc: Alexander.Deucher@amd.com, Vijendar Mukunda 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 ACP3x PDM DMA driver DAI operations. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/renoir/acp3x-pdm-dma.c | 149 +++++++++++++++++++++++++++ sound/soc/amd/renoir/rn_acp3x.h | 9 ++ 2 files changed, 158 insertions(+) diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c index 8bb03fa5b4a5..fd19b17f553e 100644 --- a/sound/soc/amd/renoir/acp3x-pdm-dma.c +++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c @@ -71,6 +71,27 @@ static void init_pdm_ring_buffer(u32 physical_addr, rn_writel(0x01, acp_base + ACPAXI2AXI_ATU_CTRL); } +static void config_pdm_stream_params(unsigned int ch_mask, + void __iomem *acp_base) +{ + rn_writel(ch_mask, acp_base + ACP_WOV_PDM_NO_OF_CHANNELS); + rn_writel(PDM_DECIMATION_FACTOR, acp_base + + ACP_WOV_PDM_DECIMATION_FACTOR); +} + +static void enable_pdm_clock(void __iomem *acp_base) +{ + u32 pdm_clk_enable, pdm_ctrl; + + pdm_clk_enable = ACP_PDM_CLK_FREQ_MASK; + pdm_ctrl = 0x00; + + rn_writel(pdm_clk_enable, acp_base + ACP_WOV_CLK_CTRL); + pdm_ctrl = rn_readl(acp_base + ACP_WOV_MISC_CTRL); + pdm_ctrl |= ACP_WOV_MISC_CTRL_MASK; + rn_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL); +} + static void enable_pdm_interrupts(void __iomem *acp_base) { u32 ext_int_ctrl; @@ -89,6 +110,77 @@ static void disable_pdm_interrupts(void __iomem *acp_base) rn_writel(ext_int_ctrl, acp_base + ACP_EXTERNAL_INTR_CNTL); } +static bool check_pdm_dma_status(void __iomem *acp_base) +{ + bool pdm_dma_status; + u32 pdm_enable, pdm_dma_enable; + + pdm_dma_status = false; + pdm_enable = rn_readl(acp_base + ACP_WOV_PDM_ENABLE); + pdm_dma_enable = rn_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 start_pdm_dma(void __iomem *acp_base) +{ + u32 pdm_enable; + u32 pdm_dma_enable; + int timeout; + + pdm_enable = 0x01; + pdm_dma_enable = 0x01; + + enable_pdm_clock(acp_base); + rn_writel(pdm_enable, acp_base + ACP_WOV_PDM_ENABLE); + rn_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE); + pdm_dma_enable = 0x00; + timeout = 0; + while (++timeout < ACP_COUNTER) { + pdm_dma_enable = rn_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 stop_pdm_dma(void __iomem *acp_base) +{ + u32 pdm_enable, pdm_dma_enable, pdm_fifo_flush; + int timeout; + + pdm_enable = 0x00; + pdm_dma_enable = 0x00; + pdm_fifo_flush = 0x00; + + pdm_enable = rn_readl(acp_base + ACP_WOV_PDM_ENABLE); + pdm_dma_enable = rn_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); + if (pdm_dma_enable & 0x01) { + pdm_dma_enable = 0x02; + rn_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE); + pdm_dma_enable = 0x00; + timeout = 0; + while (++timeout < ACP_COUNTER) { + pdm_dma_enable = rn_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; + rn_writel(pdm_enable, acp_base + ACP_WOV_PDM_ENABLE); + } + rn_writel(0x01, acp_base + ACP_WOV_PDM_FIFO_FLUSH); + return 0; +} + static void config_acp_dma(struct pdm_stream_instance *rtd, int direction) { u16 page_idx; @@ -230,6 +322,62 @@ static int acp_pdm_dma_close(struct snd_soc_component *component, return 0; } +static int acp_pdm_dai_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params, + struct snd_soc_dai *dai) +{ + struct pdm_stream_instance *rtd; + unsigned int ch_mask; + + rtd = substream->runtime->private_data; + switch (params_channels(params)) { + case TWO_CH: + default: + ch_mask = 0x00; + break; + } + config_pdm_stream_params(ch_mask, rtd->acp_base); + return 0; +} + +static int acp_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; + + rtd = substream->runtime->private_data; + ret = 0; + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + rtd->bytescount = acp_pdm_get_byte_count(rtd, + substream->stream); + pdm_status = check_pdm_dma_status(rtd->acp_base); + if (!pdm_status) + ret = start_pdm_dma(rtd->acp_base); + break; + case SNDRV_PCM_TRIGGER_STOP: + case SNDRV_PCM_TRIGGER_SUSPEND: + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + pdm_status = check_pdm_dma_status(rtd->acp_base); + if (pdm_status) + ret = stop_pdm_dma(rtd->acp_base); + break; + default: + ret = -EINVAL; + break; + } + return ret; +} + +static struct snd_soc_dai_ops acp_pdm_dai_ops = { + .hw_params = acp_pdm_dai_hw_params, + .trigger = acp_pdm_dai_trigger, +}; + static struct snd_soc_dai_driver acp_pdm_dai_driver = { .capture = { .rates = SNDRV_PCM_RATE_48000, @@ -240,6 +388,7 @@ static struct snd_soc_dai_driver acp_pdm_dai_driver = { .rate_min = 48000, .rate_max = 48000, }, + .ops = &acp_pdm_dai_ops, }; static const struct snd_soc_component_driver acp_pdm_component = { diff --git a/sound/soc/amd/renoir/rn_acp3x.h b/sound/soc/amd/renoir/rn_acp3x.h index 3536d24374f3..a4f654cf2df0 100644 --- a/sound/soc/amd/renoir/rn_acp3x.h +++ b/sound/soc/amd/renoir/rn_acp3x.h @@ -31,6 +31,15 @@ #define PDM_DMA_STAT 0x10 #define PDM_DMA_INTR_MASK 0x10000 #define ACP_ERROR_STAT 29 +#define PDM_DECIMATION_FACTOR 0x2 +#define ACP_PDM_CLK_FREQ_MASK 0x07 +#define ACP_WOV_MISC_CTRL_MASK 0x10 +#define ACP_PDM_ENABLE 0x01 +#define ACP_PDM_DISABLE 0x00 +#define ACP_PDM_DMA_EN_STATUS 0x02 +#define TWO_CH 0x02 +#define DELAY_US 5 +#define ACP_COUNTER 20000 #define ACP_SRAM_PTE_OFFSET 0x02050000 #define PAGE_SIZE_4K_ENABLE 0x2 From patchwork Mon May 18 17:17:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 192665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9610C433E0 for ; Mon, 18 May 2020 17:24:34 +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 45ECB204EC for ; Mon, 18 May 2020 17:24:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="dXD8lxND"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="RLVhUgeH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 45ECB204EC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AD4B8176F; Mon, 18 May 2020 19:23:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AD4B8176F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589822672; bh=DPvZrGBTB6IAT9WKoSAMy5aoWDHpozchXWb09jbxzfw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dXD8lxNDabEHwnFAakxunJuFQB9KfZhit7npNQOmfyu/V19L4bDaaTu1Gs83h2q6W at/SbEI8q3Rh4cdTl/O5hVhg0Ehv2ADpj8EJkfxFYlnXb12/YiYBKWarmR3hR4hyMf JoDIQKZObEFb+awTq5/p9CTZrN6iwggmwtQFO8G0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BF8A7F80315; Mon, 18 May 2020 19:17:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DE649F802E0; Mon, 18 May 2020 19:17:39 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2089.outbound.protection.outlook.com [40.107.92.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9F764F8027D for ; Mon, 18 May 2020 19:17:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9F764F8027D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="RLVhUgeH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mj/HCNby7Hq8VUBOmTcu019HOGksp7UxTH/FuKLJU0ZxGlgBRnWOzbMptHF/7musS8YJwBcAgeb6M7Wpqs2xYqbQ92zbM+6McUFnPO5aBdsW0eHZwBt0uQSPoyEV/0e598lM4R9Jc40cDuajDFc1v/+Fh2aHYVATbjDFfF8oicBjT9YQsva5NEDI0vYVbb6VUZ7W8STs8PxV13EEegUaM8CWIS6Y6djdWHsdz+DMyl4gOOsrq8U9OYNtkQsZEebSE5dG2GMY4Et37dtS99DmUyS//Dl9tqKwnk1iORF0KkV36ZS/audEYSYxFnX3oVKNvA8Lvyn15XBUDgbGVOrRag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=22QX6ldWD2jma9fdVRfyTiExDnNEo8zKwEyMrX3O/64=; b=ggIf2zFaopKf6eP2ZEffd532smQbFpXZB2Z6HlQnCeKAXcFC34bULh828ruJZWM1AgAMrANjSJNkYgFoItAd9W5h5InAohVjpBB8TCG2s/X+QooaTl7b2cq84b0MLNLKgmMsJ/Ydm6yayjLKWIs+A1KEfmxu4GiWsXhCjh59VtkUAPlp8HBdfYwoHvw3OSi5PLyZlRRS9NZfaXwiToDqIarts9icVHVptI4x8HBC3xgHXggqT4rpa44AGn5XL/y9bvWCkSuokgj1vnXX+BcbDY2ln7ythMTmKgcZJ6s/HOMgKWmHG6rLKEQ7EPoFiCTwiNyMihQJBL1FP8YSp2iqdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=22QX6ldWD2jma9fdVRfyTiExDnNEo8zKwEyMrX3O/64=; b=RLVhUgeHvE5pWMkTCcugK4VrixSMOr2meDTI4GUoDOMJKlBgL1i4eRjlf4cfJBYUf/YvLWY9gm66QLIfttIUXW6fhrFhaec2JHEVIWdt8tn3j/XtzAMgF5b4vofN3gK5w9d6by764iMp/5bgeLNuy3ofVFCUpP+AYIi9JDWpL38= Received: from DM5PR20CA0023.namprd20.prod.outlook.com (2603:10b6:3:93::33) by DM6PR12MB3644.namprd12.prod.outlook.com (2603:10b6:5:118::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20; Mon, 18 May 2020 17:17:29 +0000 Received: from DM6NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:3:93:cafe::1f) by DM5PR20CA0023.outlook.office365.com (2603:10b6:3:93::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.24 via Frontend Transport; Mon, 18 May 2020 17:17:28 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB01.amd.com (165.204.84.17) by DM6NAM11FT058.mail.protection.outlook.com (10.13.172.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3000.19 via Frontend Transport; Mon, 18 May 2020 17:17:28 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 18 May 2020 12:17:27 -0500 Received: from SATLEXMB02.amd.com (10.181.40.143) 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.1713.5; Mon, 18 May 2020 12:17:27 -0500 Received: from atgasia02.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 18 May 2020 12:17:26 -0500 From: Vijendar Mukunda To: , , Subject: [PATCH v3 11/14] ASoC: amd: enable Renoir acp3x drivers build Date: Tue, 19 May 2020 01:17:01 +0800 Message-ID: <20200518171704.24999-12-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> References: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB01.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(46966005)(4326008)(26005)(86362001)(186003)(54906003)(110136005)(336012)(316002)(7696005)(6666004)(5660300002)(2616005)(70586007)(70206006)(8676002)(8936002)(356005)(82740400003)(47076004)(2906002)(36756003)(478600001)(426003)(81166007)(82310400002)(1076003)(42413003)(32563001); DIR:OUT; SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e22d13b-5544-4b3e-fd8f-08d7fb4f576a X-MS-TrafficTypeDiagnostic: DM6PR12MB3644: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-Forefront-PRVS: 04073E895A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8rITekX7SxBBzosjWnwyV1wlDzHRQEYvm4qbl32GK+da2s5tx/uJitySKaF4C0uBq4Tt9Z1zRmveWSLe8VRpvwG8XtxHpxCm+9D9bjGRAlbzslA1OpN5gQWUCfKQvSVFdHX9XoTUQTVXDz5TYNiS/9wSoED0Bh57ShiX4xkB9w7yruNX0wRiE3bYS/hGxESXjteYWexiLyJuFVnYc9nofeyiJG6HHZgFbfltpzLiylojn/VS0fkqxIL5j/vDmGBSUnUF9pu5OvG+ueI/9ENT8m/xc1a18o1sINb/Q8jWEqCdGv/7NEzIhBROM1Mh38wkwovDSt3Qu3CjyasMcNv3aVjz8o3btlwWfbo8RnQLqQYI3YrFc+DTgVWdGhmIjMhso1Shbdg5kVENlkvC1m2FDppwpeJJxnpT9rmnnjZlduAFWCeXyfIc3dnHIRjlfoUSMBNUJ0dotLseDSDDNNKDu8j42nZuZ19yyJt1FbVHxskafzOhQdz/1dhxnTn6CyudJ0/uMX8bGAca+c0JUu1OyH4oi0UcPD31DWRjuglGb/w600vU0pWHJB0/O6OBnvdB X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2020 17:17:28.2912 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e22d13b-5544-4b3e-fd8f-08d7fb4f576a 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3644 Cc: Alexander.Deucher@amd.com, Vijendar Mukunda 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" Renoir ACP3x 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/renoir/Makefile | 6 ++++++ 3 files changed, 13 insertions(+) create mode 100644 sound/soc/amd/renoir/Makefile diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index bce4cee5cb54..5f57a47382b4 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -36,3 +36,9 @@ config SND_SOC_AMD_RV_RT5682_MACH depends on SND_SOC_AMD_ACP3x && I2C && CROS_EC help This option enables machine driver for RT5682 and MAX9835. + +config SND_SOC_AMD_RENOIR + tristate "AMD Audio Coprocessor - Renoir support" + depends on X86 && PCI + help + This option enables ACP support for Renoir platform diff --git a/sound/soc/amd/Makefile b/sound/soc/amd/Makefile index e6f3d9b469f3..e6df2f72a2a1 100644 --- a/sound/soc/amd/Makefile +++ b/sound/soc/amd/Makefile @@ -9,3 +9,4 @@ obj-$(CONFIG_SND_SOC_AMD_CZ_DA7219MX98357_MACH) += snd-soc-acp-da7219mx98357-mac obj-$(CONFIG_SND_SOC_AMD_CZ_RT5645_MACH) += snd-soc-acp-rt5645-mach.o 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/ diff --git a/sound/soc/amd/renoir/Makefile b/sound/soc/amd/renoir/Makefile new file mode 100644 index 000000000000..43100515c7db --- /dev/null +++ b/sound/soc/amd/renoir/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Renoir platform Support +snd-rn-pci-acp3x-objs := rn-pci-acp3x.o +snd-acp3x-pdm-dma-objs := acp3x-pdm-dma.o +obj-$(CONFIG_SND_SOC_AMD_RENOIR) += snd-rn-pci-acp3x.o +obj-$(CONFIG_SND_SOC_AMD_RENOIR) += snd-acp3x-pdm-dma.o From patchwork Mon May 18 17:17:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 192663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2814DC433DF for ; Mon, 18 May 2020 17:27:06 +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 9EBFA20715 for ; Mon, 18 May 2020 17:27:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="mlBwcwSf"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="P8BV3vWy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EBFA20715 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0AF52171F; Mon, 18 May 2020 19:26:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0AF52171F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589822824; bh=vPHcBjWx5jCYCSZlKeoRREhR0Lh72r/mEPfCYNMUMTI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mlBwcwSf5eV7KKMPBKIP5SZuGnFjueq4bzfOGibECS8iiBixy/wgBSu0ByrNYzPba 8sO9Z4ib9+pqyZmAPGg3W+4J0Bhk9XECmoqionCPINxDmW/RBhB8/jCsHx+cn7QwW5 LyC3ItanFnqjbfRSapsFXDQNjNvOvqGRBBryXMWw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E3D06F80348; Mon, 18 May 2020 19:17:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9D13CF80305; Mon, 18 May 2020 19:17:48 +0200 (CEST) Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700082.outbound.protection.outlook.com [40.107.70.82]) (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 D3A15F802F7 for ; Mon, 18 May 2020 19:17:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D3A15F802F7 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="P8BV3vWy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZoElOcIWypVGeEOjJS4fwZq2XqRNwm0vNtnsBKzmmjMCskZRiyOEp95W+aQLft+i15zJtka+SsqUYtRT+J6QWyJgGGiXg5kxXEDSSGg5vDoYgDn1/nySzi/ibBUMHR/6+yXRNc63zIeS/T6dCCHTGhfjaVi0uZPlSK/VwobNsAuvZtz8Owr8wlHc/NNva7GTuwcTDoFFvlumHhtKbhP0d3FlqR4NIu5REKKNqsMnRY+p6WInUDD/dK0ZJvK38cW/Q2We4RPh0HCYhW9+5mzcWF/rdhcTZzhHrkfJbOWFZlI6jtjZhPplX9RUxpHirqM8dbrsPWHgVQ92Un/9zdaCHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rTTcCFfbezOXrUqZP6U2nn2C0Ry/t/Y0qP0a+k5bXT8=; b=fXq4k6NZ7G6K+g9Lnw8Mo/vumph9HJlPBpvUwGjig+7T2UGnkxvKSDqiOgGF0rBArLfuLaEHs3kD0izUV642hppQllADk9esbe3fHzstHe+Yvxpfohk9cDz62vFc1ZmwLVjiR+5aZyksyHXRj3M5sQ5Sa4VZOzpkjkcWd/K+N2dyGptauNgwkn2PeH4DJFRRQyI1iZz3rHazUt61Ex6rzLJWkMT6ZT5PKGYBsEBAatDtwEMUTZDiL0Bv6MmUiZRw/c+im1k9Fyd3VtvnCcjbcsURiQWw6KyaI0XamUdUwY0uwU+4r71LqQTlADxGaK7PSb+WgxU222bLaCQamIXvuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rTTcCFfbezOXrUqZP6U2nn2C0Ry/t/Y0qP0a+k5bXT8=; b=P8BV3vWy1B16pWaLZKuD43451Tb+qq7Z7gL198YKQabiu/8N8aBk2NOTsbAIlcWEgUZYLdSbvXMpNvwZsIR8o9qrJkwFUvPwR+N68Xu9wnJ3MeyofcS3GjPNYRDFZO79hpftP8acZD5reAftXAkSHUUSVLwiYqv+dpq9vvvDHxA= Received: from MWHPR15CA0048.namprd15.prod.outlook.com (2603:10b6:300:ad::34) by MWHPR12MB1823.namprd12.prod.outlook.com (2603:10b6:300:112::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.26; Mon, 18 May 2020 17:17:34 +0000 Received: from CO1NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:300:ad:cafe::56) by MWHPR15CA0048.outlook.office365.com (2603:10b6:300:ad::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Mon, 18 May 2020 17:17:34 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by CO1NAM11FT032.mail.protection.outlook.com (10.13.174.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3000.19 via Frontend Transport; Mon, 18 May 2020 17:17:32 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 18 May 2020 12:17:31 -0500 Received: from SATLEXMB02.amd.com (10.181.40.143) 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.1713.5; Mon, 18 May 2020 12:17:31 -0500 Received: from atgasia02.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 18 May 2020 12:17:29 -0500 From: Vijendar Mukunda To: , , Subject: [PATCH v3 13/14] ASoC: amd: RN machine driver using dmic Date: Tue, 19 May 2020 01:17:03 +0800 Message-ID: <20200518171704.24999-14-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> References: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB02.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(396003)(39860400002)(136003)(346002)(376002)(46966005)(478600001)(36756003)(110136005)(336012)(316002)(47076004)(6666004)(4326008)(2616005)(426003)(8936002)(70206006)(70586007)(2906002)(186003)(26005)(7696005)(356005)(81166007)(86362001)(54906003)(5660300002)(8676002)(82740400003)(82310400002)(1076003); DIR:OUT; SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc7a7b2b-1384-4dbe-1537-08d7fb4f59d1 X-MS-TrafficTypeDiagnostic: MWHPR12MB1823: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-Forefront-PRVS: 04073E895A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xPL0/jChMEx1oCC0Vwk70XB0/IpMBKNNgWhTQ7Bi2NKCECCbXYeKG1qUy+JatlIGhQaxcymaNUvQrjFskuzQONRcmDBQQudM7nfwE/SJ8Z/dIyxVU7UynrFg78xPLu9RHPNKE+iMEYasI5Ixw+mlD1PAv7WzEsUDcJm/avUSNJTDgNSzRGDqyLslD5hj9Eip5UgQCPYHGN26qSy4Rc9RQE/DR7uGV+O6NGNFkdPtT3459eFsKgFHPPT5uRM0BUAmkV46eYRcaFqZHIzMmoIj/pApmtnzIJ8YOGxYqPmDqEutzGcViJMSTdzV2F7Q7YPhI0KK9lF17B2nb02NMHm6wp9MIQRVd3KnRwi01MfDmRCaHpt+8yEMjfHHa+DeBkbXqbvulhra/B7+QC5RxHget9Y47pORHuv9Qbv45wwF30tL4xQHnbcQnXl8g+e4nfWxkxVE+t4uvZiaJJll/35o7Ep6lV/iLbFIdDKVKC4N32zfTh+MDQmsOaelrj3eIwW87yzane22tsLZq7WmHQ+8Ng== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2020 17:17:32.2448 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc7a7b2b-1384-4dbe-1537-08d7fb4f59d1 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=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1823 Cc: Alexander.Deucher@amd.com, Vijendar Mukunda 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 Renoir Machine driver for dmic support. Signed-off-by: Vijendar Mukunda --- Removed redundant code. sound/soc/amd/renoir/acp3x-rn.c | 77 +++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sound/soc/amd/renoir/acp3x-rn.c diff --git a/sound/soc/amd/renoir/acp3x-rn.c b/sound/soc/amd/renoir/acp3x-rn.c new file mode 100644 index 000000000000..306134b89a82 --- /dev/null +++ b/sound/soc/amd/renoir/acp3x-rn.c @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: GPL-2.0+ +// +// Machine driver for AMD Renoir platform using DMIC +// +//Copyright 2020 Advanced Micro Devices, Inc. + +#include +#include +#include +#include +#include +#include + +#include "rn_acp3x.h" + +#define DRV_NAME "acp_pdm_mach" + +SND_SOC_DAILINK_DEF(acp_pdm, + DAILINK_COMP_ARRAY(COMP_CPU("acp_rn_pdm_dma.0"))); + +SND_SOC_DAILINK_DEF(dmic_codec, + DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec.0", + "dmic-hifi"))); + +SND_SOC_DAILINK_DEF(platform, + DAILINK_COMP_ARRAY(COMP_PLATFORM("acp_rn_pdm_dma.0"))); + +static struct snd_soc_dai_link acp_dai_pdm[] = { + { + .name = "acp3x-dmic-capture", + .stream_name = "DMIC capture", + .capture_only = 1, + SND_SOC_DAILINK_REG(acp_pdm, dmic_codec, platform), + }, +}; + +static struct snd_soc_card acp_card = { + .name = "acp", + .owner = THIS_MODULE, + .dai_link = acp_dai_pdm, + .num_links = 1, +}; + +static int acp_probe(struct platform_device *pdev) +{ + int ret; + struct acp_pdm *machine = NULL; + struct snd_soc_card *card; + + card = &acp_card; + acp_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) { + dev_err(&pdev->dev, + "snd_soc_register_card(%s) failed: %d\n", + acp_card.name, ret); + return ret; + } + return 0; +} + +static struct platform_driver acp_mach_driver = { + .driver = { + .name = "acp_pdm_mach", + .pm = &snd_soc_pm_ops, + }, + .probe = acp_probe, +}; + +module_platform_driver(acp_mach_driver); + +MODULE_AUTHOR("Vijendar.Mukunda@amd.com"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); From patchwork Mon May 18 17:17:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 192664 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34C5FC433DF for ; Mon, 18 May 2020 17:25:45 +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 B57CD20674 for ; Mon, 18 May 2020 17:25:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="RPN+oBU8"; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="GDFuRb1N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B57CD20674 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0EFB61776; Mon, 18 May 2020 19:24:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0EFB61776 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1589822743; bh=WjaZtelEbjALlN5+S6imYkzMnNM/t5G/jQK3RbpMMFk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=RPN+oBU8/N3A9oRi9SSM3+Bq0c2WLnz1TUcYVHGNwNriKGfhkMGI3Vt4CW7WYq8dY 7EPMPfdsua0YFjhzCLwBo9+st2IdUI+SaO5e1bIQSO9LYceU26V5xVdU0UBkgwhsf1 Rw5fUQC/kZypiPw0jCDHvWJpmXlxY5TzJ/9lHW9Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 833DEF80334; Mon, 18 May 2020 19:17:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5FD33F802E2; Mon, 18 May 2020 19:17:43 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2054.outbound.protection.outlook.com [40.107.243.54]) (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 67018F80299 for ; Mon, 18 May 2020 19:17:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 67018F80299 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="GDFuRb1N" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fVYuEOD+mCAXDLOKsmEzaIW5qlHHc5yudmqFcFr7SOwrIBtBaHT6NgPFOTKyOXGKcvsEQfg3pvgmn1vgBdPyLmv87YPl9AfVSBwf/WTFUsQSFfUcod67kWYj98q3mRcR894ZFAX42SNYC+2eiUiwG+nJh4Qdxqmz8B+lLGZ54JcqK1c2gOHT+XES6w/HSe2x0AYM+SZHDRlEL/CiEyQECiioxnzCqWEAlIZ7A2895FRJyCY47nGZEvQF5ju61kUhqsRy78YPJ7AKBEzGbVDpDIv+pGFywW4Chbi7AA5EGw0w6T+XeXX8dZK7mViCFNfdRfpciJyD76tLTQFGQN+KzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bNxJqwpnt8Ux3YayoEw17Lz5syPZ1gkWLYK5/CyH2bQ=; b=CyU9Ae7Ayx+vMQjaKwKbaljW2kPnrIDrDiXsXbYNY2Hh0G4sj5AVDuyy60OpTHAKeaSJuFRc0ZWxm9vEYndCsQqbVXkvNTK+Y2OLxUtQtRES9zCK00Roc85vEYPJQggOXzVTTZFOeP54aFzvq3v/tfiDcDwaLfC3b8bijv29CeJijNqSbcIN0zjAiIHIl6kzDvNQ8w28qkRCoqlUTEftI1wYoYZ0JLYVKoW0ATRlsZaB/p5d+J5BtGNf7Jjyhq53QkUVABc6EVmxWL2Mx+Jz5bjJMK2txM8q0KSSjxzyJ/GsX/a31CIf6ZKFrIKzDDmK04r24yhSTIcTQ69ANqAXuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bNxJqwpnt8Ux3YayoEw17Lz5syPZ1gkWLYK5/CyH2bQ=; b=GDFuRb1NT/YSBwXkjFqeCqbwfOTHTRkfnI+2T653jWaYIj1O3hr7R5PeewNSztNZBEMSQEVB6P65Qi0G5pYgiQ03HBY3WNy6qOE/ixL2KDCpAwRU8RU/a0GmPir9civQHmcQ9fUo3sm74L9RV1TJbNbqClaEgAXs8R9nP/xi//g= Received: from DM6PR08CA0035.namprd08.prod.outlook.com (2603:10b6:5:80::48) by MN2PR12MB3918.namprd12.prod.outlook.com (2603:10b6:208:162::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.26; Mon, 18 May 2020 17:17:35 +0000 Received: from DM6NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:5:80:cafe::3c) by DM6PR08CA0035.outlook.office365.com (2603:10b6:5:80::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.25 via Frontend Transport; Mon, 18 May 2020 17:17:34 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB01.amd.com (165.204.84.17) by DM6NAM11FT065.mail.protection.outlook.com (10.13.172.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3000.19 via Frontend Transport; Mon, 18 May 2020 17:17:33 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 18 May 2020 12:17:33 -0500 Received: from SATLEXMB02.amd.com (10.181.40.143) 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.1713.5; Mon, 18 May 2020 12:17:33 -0500 Received: from atgasia02.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 18 May 2020 12:17:31 -0500 From: Vijendar Mukunda To: , , Subject: [PATCH v3 14/14] ASoC: amd: enable build for RN machine driver Date: Tue, 19 May 2020 01:17:04 +0800 Message-ID: <20200518171704.24999-15-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> References: <20200518171704.24999-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SATLEXMB01.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(376002)(396003)(39860400002)(136003)(346002)(46966005)(478600001)(36756003)(110136005)(336012)(316002)(47076004)(6666004)(4326008)(2616005)(8936002)(426003)(70586007)(70206006)(2906002)(186003)(26005)(7696005)(8676002)(81166007)(356005)(86362001)(82310400002)(82740400003)(54906003)(5660300002)(1076003); DIR:OUT; SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 30ff6ac0-e174-4f4b-4f0e-08d7fb4f5aaf X-MS-TrafficTypeDiagnostic: MN2PR12MB3918: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1227; X-Forefront-PRVS: 04073E895A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aNT7yfzsYwzr+dGKwod49DDKp0IcbnoP7Fx26ReLR5/MEts5leZ2MOglLpyk2rtMfcFmT9+x82Vh3TsyfJI3oO/BdcqY9OGvQ6RMxW5HSbwnp+gRQdLoeUky8M6lM8CWUXBynBxVNwPQs4YAOdjMsUzC93BOaHrIKyPwip6lmWNWyvEFwrRLAW+9RJOvbYDxQzXrkOmPu8g8F1nMnOsMFYjx9uyWNTcA9l2BicWzgJC/ChCsUSjOwyqlT30Gz67Q9f1zNFe3VHl6RP58Q2xPpxXUixsUd1J4zLKmnHsVXf3XgIuoTe1ZMaXAWXonntC33FFEFo4lJSRn0HPs7OWFAZnZCw5TErmF43FTQHDSz82Ec4YCxUUtGAU59uCRESHHbDWamNKLZlb8e1DNTu3100pw0eEE8M7Si0xf/WnF0GPgy9wZ3f0mZ9hYxsbw65JkxwcKwr/PGPiVHsgaT6GcGh0Eb0igqtlz+QXcwASgIaHbiurUvVP7MclXeLWKoExMeT3v3Sy/p54/TRzcGhgwxA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2020 17:17:33.7731 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 30ff6ac0-e174-4f4b-4f0e-08d7fb4f5aaf 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=[SATLEXMB01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3918 Cc: Alexander.Deucher@amd.com, Vijendar Mukunda 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 enables build for RN machine driver. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/Kconfig | 7 +++++++ sound/soc/amd/renoir/Makefile | 1 + 2 files changed, 8 insertions(+) diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig index 5f57a47382b4..77ffdb41bee5 100644 --- a/sound/soc/amd/Kconfig +++ b/sound/soc/amd/Kconfig @@ -42,3 +42,10 @@ config SND_SOC_AMD_RENOIR depends on X86 && PCI help This option enables ACP support for Renoir platform + +config SND_SOC_AMD_RENOIR_MACH + tristate "AMD Renoir support for DMIC" + select SND_SOC_DMIC + depends on SND_SOC_AMD_RENOIR + help + This option enables machine driver for DMIC diff --git a/sound/soc/amd/renoir/Makefile b/sound/soc/amd/renoir/Makefile index 43100515c7db..e4371932a55a 100644 --- a/sound/soc/amd/renoir/Makefile +++ b/sound/soc/amd/renoir/Makefile @@ -4,3 +4,4 @@ snd-rn-pci-acp3x-objs := rn-pci-acp3x.o snd-acp3x-pdm-dma-objs := acp3x-pdm-dma.o obj-$(CONFIG_SND_SOC_AMD_RENOIR) += snd-rn-pci-acp3x.o obj-$(CONFIG_SND_SOC_AMD_RENOIR) += snd-acp3x-pdm-dma.o +obj-$(CONFIG_SND_SOC_AMD_RENOIR_MACH) += acp3x-rn.o