From patchwork Thu Jan 13 16:33:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Kumar Pandey X-Patchwork-Id: 12712911 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5F5C9C433FE for ; Thu, 13 Jan 2022 16:36:02 +0000 (UTC) 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 5F1C61FDB; Thu, 13 Jan 2022 17:35:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5F1C61FDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642091760; bh=u+JD4TmrDhqGZRdfcw6d4b+A+pt6SXP67Jkf2l92Q08=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Zaorij93SuzGgHoKlA601Fv12/JYW9+2hj8EpmdLmolOUHdDRa2sgEKq7dLURAOgW 2TBV0KpyjPQr+CH4FCep/qxi58fvgCdQ7kmOBX26LerROOqKsMJV+noIsmd9D7DiSp +ypUJaPZ5R51Y9gd4xaUSqhdhrWoXXYwN93JkNNk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AEAD4F8019B; Thu, 13 Jan 2022 17:35:03 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C3E96F8028D; Thu, 13 Jan 2022 17:35:01 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2077.outbound.protection.outlook.com [40.107.243.77]) (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 78A9DF80088 for ; Thu, 13 Jan 2022 17:34:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 78A9DF80088 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="HdENYGU2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GZ5GEwo2JWJUCM1PHM8dzt5Zeg4JKZO18dsil8b5Z9VcmyL9M2ury6yDm+lkmIxf5f22vPTQMt91Zaf0cwP3aJ9wb4vm863eENPu8hOgP8HyQYA55dnwVBEyunLADpvPwL4HArjifnZ6l/IzAP6w/v6hB0ewAIUxmKvWAkhx0p34eLvuhmb5dY3Qaz56eX3//mmEB5c/V/ICYatpXy6Dx89TVenanNCJj2t1Kbd/KpsEQxi3lIpCgrFY7UR1mqlZ4PPXg3U4forbbaxQO5FQ+CxGrjsB4eVhJQd38Ixl+6O1Dz04whWw0NyM+RCCO55lAQi0BAktRnvx6rhOIyCZyQ== 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=wLiAmrUjqXbine4/4G+vGheCp7mbn2rY0hch9rU2BXk=; b=Sdgqo5rgXrm+e7bJtqjwDZeFCPL0MP2CWjDC49Thb/ufpH08QBsJbWEx+hHfDqmpvxjtdNv1GhK8Iyl/rV/rwm+J9qNCIIVAtpUbvIkvv/Dnd0oRvhfUgyT7Lq+PA5XnCJqQrUg7CEVkKglkvKFLVvbS4q6Bqcq4rBfoeSpXLR1zA/fekEBCv85JoaHEqwRjdiwmLYOqUYe4E5rtv7adpVWXeh2Cn3IPlrJ8AI79Wf2ECvUMRSZfAtF1TGH/eLbdbQ5yEmcYHM/0qFP9xpLZaEssOMAf3qJ0EfUkxs9ktAOBuumWGreaDNUtO2HBw9nhKhpQSveeDz5VYRv6zFpmWA== 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=wLiAmrUjqXbine4/4G+vGheCp7mbn2rY0hch9rU2BXk=; b=HdENYGU2INqF/HE3z2rYObLXanrKDLDm4kckU9IkmYnB4tRs2x4qhmEv9FPpgTRz7ipwj7pH/aGnmazgoXho/G9GYLYE52+1zUwEbCL7XvBCVySf0nO8Y25j635kNvIm9kHui0Wj0Wmu/WXE50On/qnVBWtkOmnUS1F1FdI/9l4= Received: from CO2PR04CA0124.namprd04.prod.outlook.com (2603:10b6:104:7::26) by BL0PR12MB2529.namprd12.prod.outlook.com (2603:10b6:207:4e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Thu, 13 Jan 2022 16:34:50 +0000 Received: from CO1NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:104:7:cafe::fb) by CO2PR04CA0124.outlook.office365.com (2603:10b6:104:7::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9 via Frontend Transport; Thu, 13 Jan 2022 16:34:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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 CO1NAM11FT048.mail.protection.outlook.com (10.13.175.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4888.9 via Frontend Transport; Thu, 13 Jan 2022 16:34:49 +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.2375.17; Thu, 13 Jan 2022 10:34:46 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) 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.2375.17; Thu, 13 Jan 2022 08:34:46 -0800 Received: from chrome.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 13 Jan 2022 10:34:42 -0600 From: Ajit Kumar Pandey To: , Subject: [PATCH v2 1/6] ASoC: amd: acp: Add generic support for PDM controller on ACP Date: Thu, 13 Jan 2022 22:03:43 +0530 Message-ID: <20220113163348.434108-2-AjitKumar.Pandey@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> References: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1def48e9-5d5b-4c80-eba8-08d9d6b29e22 X-MS-TrafficTypeDiagnostic: BL0PR12MB2529:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hcyFLPHNS9bDVGgeymSLWsK+IbIL6mJMvSGXnTCeJRM5zpENfqpEUaB6Ae7Hdl/F4em44xwHDg2+bZ1vbgbXQOKmJ5uIPGGo58FwhWZjbCabJlYkPWug/sb3hYJFT4QqrxUT50ElMLglUUjUbsmjQD9opyMqy2pikyclWvpFpQLCm6jgKrR32QoDj2pMfg2faX1kZNV7h8AZyHisrDzTCPDIywewt/gYee8MKPPSnclgaQwWSsrXaTXnYGaY2Jx0cgEgnz4uyUKa/4ArdULhkJ5Pm9mvukP4TceZVDRRH8aLr0HRVLHidfnBGxAjPKnkmPCuJ56tZ2XRAWQlxMSSGjTepJBJeUOi6xx/AW6CTChFubYKpme/1UOusJZyZEoaAT1xnui8z6hLvO35tVwI9/IJSV792cc4HDyMEMIlr1KH3uAK/RFu895SHhn05epKVQTVo3S0i0x8pyV6mDjYk5LlYHkp1s1JIJUGfuMtbHlmMhIOBjYoWpAsMjYaXK3ZtoEtd5AB79/tOWIq/hC8pJJXjwG+SuohAbic5tzxjic7jPnQYl7WvIWXhfuzLGc2uTiULA2KmevE0bqcDEERkYtterOE8YaiZ8PH0i4FYBPWYeOmZ/AdDENVFT269JsPQpnuZ78c0czwMaQbcjchSFmzJhSoH2eIpFaqIQBKJQt31tih8zelvZmx+Ll2y/kFsqVy6Z6yOJwRuv6DDxmwT2qt8Mq0Z6ex0s2JDMxkuri7WbuShwdFjRkiFg7NmfAmltopzwDfa7xS0sbVtcwisVLS23/QOjCH/VfLjcyMhIylaSehkU8yxFNVYHiJB7fK 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)(40470700002)(86362001)(356005)(316002)(1076003)(36756003)(83380400001)(508600001)(54906003)(7696005)(81166007)(4326008)(82310400004)(426003)(2906002)(70586007)(70206006)(110136005)(47076005)(26005)(186003)(40460700001)(36860700001)(336012)(2616005)(5660300002)(8936002)(8676002)(41533002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2022 16:34:49.3684 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1def48e9-5d5b-4c80-eba8-08d9d6b29e22 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: CO1NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB2529 Cc: Sunil-kumar.Dommati@amd.com, Geert Uytterhoeven , Ajit Kumar Pandey , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , V sujith kumar Reddy , Arnd Bergmann , Vijendar.Mukunda@amd.com, Alexander.Deucher@amd.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add driver module for PDM controller on ACP IP block. Expose dai ops to configure ACP_WOV_PDM_BLOCK registers on ACP. Such dai ops will be used by platform specific driver module to register dmic related dai with ASoC. Signed-off-by: Ajit Kumar Pandey --- sound/soc/amd/acp/Kconfig | 3 + sound/soc/amd/acp/Makefile | 2 + sound/soc/amd/acp/acp-pdm.c | 181 +++++++++++++++++++++++++++ sound/soc/amd/acp/amd.h | 9 +- sound/soc/amd/acp/chip_offset_byte.h | 20 +++ 5 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 sound/soc/amd/acp/acp-pdm.c diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig index d5838df3064b..2e6d0259f2e9 100644 --- a/sound/soc/amd/acp/Kconfig +++ b/sound/soc/amd/acp/Kconfig @@ -15,6 +15,9 @@ config SND_SOC_AMD_ACP_COMMON if SND_SOC_AMD_ACP_COMMON +config SND_SOC_AMD_ACP_PDM + tristate + config SND_SOC_AMD_ACP_I2S tristate diff --git a/sound/soc/amd/acp/Makefile b/sound/soc/amd/acp/Makefile index 16c144c2965c..66cac95432f6 100644 --- a/sound/soc/amd/acp/Makefile +++ b/sound/soc/amd/acp/Makefile @@ -7,6 +7,7 @@ #common acp driver snd-acp-pcm-objs := acp-platform.o snd-acp-i2s-objs := acp-i2s.o +snd-acp-pdm-objs := acp-pdm.o #platform specific driver snd-acp-renoir-objs := acp-renoir.o @@ -18,6 +19,7 @@ snd-acp-sof-mach-objs := acp-sof-mach.o obj-$(CONFIG_SND_SOC_AMD_ACP_PCM) += snd-acp-pcm.o obj-$(CONFIG_SND_SOC_AMD_ACP_I2S) += snd-acp-i2s.o +obj-$(CONFIG_SND_SOC_AMD_ACP_PDM) += snd-acp-pdm.o obj-$(CONFIG_SND_AMD_ASOC_RENOIR) += snd-acp-renoir.o diff --git a/sound/soc/amd/acp/acp-pdm.c b/sound/soc/amd/acp/acp-pdm.c new file mode 100644 index 000000000000..cb9bbd795eee --- /dev/null +++ b/sound/soc/amd/acp/acp-pdm.c @@ -0,0 +1,181 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +// +// This file is provided under a dual BSD/GPLv2 license. When using or +// redistributing this file, you may do so under either license. +// +// Copyright(c) 2021 Advanced Micro Devices, Inc. +// +// Authors: Ajit Kumar Pandey +// Vijendar Mukunda +// + +/* + * Generic Hardware interface for ACP Audio PDM controller + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "amd.h" + +#define DRV_NAME "acp-pdm" + +#define PDM_DMA_STAT 0x10 +#define PDM_DMA_INTR_MASK 0x10000 +#define PDM_DEC_64 0x2 +#define PDM_CLK_FREQ_MASK 0x07 +#define PDM_MISC_CTRL_MASK 0x10 +#define PDM_ENABLE 0x01 +#define PDM_DISABLE 0x00 +#define DMA_EN_MASK 0x02 +#define DELAY_US 5 +#define PDM_TIMEOUT 1000 + +static int acp_dmic_dai_trigger(struct snd_pcm_substream *substream, + int cmd, struct snd_soc_dai *dai) +{ + struct acp_stream *stream = substream->runtime->private_data; + struct device *dev = dai->component->dev; + struct acp_dev_data *adata = dev_get_drvdata(dev); + u32 physical_addr, size_dmic, period_bytes; + unsigned int dma_enable; + int ret = 0; + + period_bytes = frames_to_bytes(substream->runtime, + substream->runtime->period_size); + size_dmic = frames_to_bytes(substream->runtime, + substream->runtime->buffer_size); + + physical_addr = stream->reg_offset + MEM_WINDOW_START; + + /* Init DMIC Ring buffer */ + writel(physical_addr, adata->acp_base + ACP_WOV_RX_RINGBUFADDR); + writel(size_dmic, adata->acp_base + ACP_WOV_RX_RINGBUFSIZE); + writel(period_bytes, adata->acp_base + ACP_WOV_RX_INTR_WATERMARK_SIZE); + writel(0x01, adata->acp_base + ACPAXI2AXI_ATU_CTRL); + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + dma_enable = readl(adata->acp_base + ACP_WOV_PDM_DMA_ENABLE); + if (!(dma_enable & DMA_EN_MASK)) { + writel(PDM_ENABLE, adata->acp_base + ACP_WOV_PDM_ENABLE); + writel(PDM_ENABLE, adata->acp_base + ACP_WOV_PDM_DMA_ENABLE); + } + + ret = readl_poll_timeout_atomic(adata->acp_base + ACP_WOV_PDM_DMA_ENABLE, + dma_enable, (dma_enable & DMA_EN_MASK), + DELAY_US, PDM_TIMEOUT); + break; + case SNDRV_PCM_TRIGGER_STOP: + case SNDRV_PCM_TRIGGER_SUSPEND: + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + dma_enable = readl(adata->acp_base + ACP_WOV_PDM_DMA_ENABLE); + if ((dma_enable & DMA_EN_MASK)) { + writel(PDM_DISABLE, adata->acp_base + ACP_WOV_PDM_ENABLE); + writel(PDM_DISABLE, adata->acp_base + ACP_WOV_PDM_DMA_ENABLE); + + } + + ret = readl_poll_timeout_atomic(adata->acp_base + ACP_WOV_PDM_DMA_ENABLE, + dma_enable, !(dma_enable & DMA_EN_MASK), + DELAY_US, PDM_TIMEOUT); + break; + default: + ret = -EINVAL; + break; + } + + return ret; +} + +static int acp_dmic_hwparams(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hwparams, struct snd_soc_dai *dai) +{ + struct device *dev = dai->component->dev; + struct acp_dev_data *adata = dev_get_drvdata(dev); + unsigned int dmic_ctrl, channels, ch_mask; + + /* Enable default DMIC clk */ + writel(PDM_CLK_FREQ_MASK, adata->acp_base + ACP_WOV_CLK_CTRL); + dmic_ctrl = readl(adata->acp_base + ACP_WOV_MISC_CTRL); + dmic_ctrl |= PDM_MISC_CTRL_MASK; + writel(dmic_ctrl, adata->acp_base + ACP_WOV_MISC_CTRL); + + channels = params_channels(hwparams); + switch (channels) { + case 2: + ch_mask = 0; + break; + case 4: + ch_mask = 1; + break; + case 6: + ch_mask = 2; + break; + default: + dev_err(dev, "Invalid channels %d\n", channels); + return -EINVAL; + } + + if (params_format(hwparams) != SNDRV_PCM_FORMAT_S32_LE) { + dev_err(dai->dev, "Invalid format:%d\n", params_format(hwparams)); + return -EINVAL; + } + + writel(ch_mask, adata->acp_base + ACP_WOV_PDM_NO_OF_CHANNELS); + writel(PDM_DEC_64, adata->acp_base + ACP_WOV_PDM_DECIMATION_FACTOR); + + return 0; +} + +static int acp_dmic_dai_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct acp_stream *stream = substream->runtime->private_data; + struct device *dev = dai->component->dev; + struct acp_dev_data *adata = dev_get_drvdata(dev); + u32 ext_int_ctrl; + + stream->dai_id = DMIC_INSTANCE; + stream->irq_bit = BIT(PDM_DMA_STAT); + stream->pte_offset = ACP_SRAM_PDM_PTE_OFFSET; + + /* Enable DMIC Interrupts */ + ext_int_ctrl = readl(adata->acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_int_ctrl |= PDM_DMA_INTR_MASK; + writel(ext_int_ctrl, adata->acp_base + ACP_EXTERNAL_INTR_CNTL); + + return 0; +} + +static void acp_dmic_dai_shutdown(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct device *dev = dai->component->dev; + struct acp_dev_data *adata = dev_get_drvdata(dev); + u32 ext_int_ctrl; + + /* Disable DMIC interrrupts */ + ext_int_ctrl = readl(adata->acp_base + ACP_EXTERNAL_INTR_CNTL); + ext_int_ctrl |= ~PDM_DMA_INTR_MASK; + writel(ext_int_ctrl, adata->acp_base + ACP_EXTERNAL_INTR_CNTL); +} + +const struct snd_soc_dai_ops acp_dmic_dai_ops = { + .hw_params = acp_dmic_hwparams, + .trigger = acp_dmic_dai_trigger, + .startup = acp_dmic_dai_startup, + .shutdown = acp_dmic_dai_shutdown, +}; +EXPORT_SYMBOL_NS_GPL(acp_dmic_dai_ops, SND_SOC_ACP_COMMON); + +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:"DRV_NAME); diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 8eee3d34774b..567355209a5c 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -17,8 +17,9 @@ #define I2S_SP_INSTANCE 0x00 #define I2S_BT_INSTANCE 0x01 +#define DMIC_INSTANCE 0x02 -#define MEM_WINDOW_START 0x4000000 +#define MEM_WINDOW_START 0x4080000 #define ACP_I2S_REG_START 0x1242400 #define ACP_I2S_REG_END 0x1242810 @@ -38,6 +39,7 @@ #define ACP_SRAM_SP_CP_PTE_OFFSET 0x100 #define ACP_SRAM_BT_PB_PTE_OFFSET 0x200 #define ACP_SRAM_BT_CP_PTE_OFFSET 0x300 +#define ACP_SRAM_PDM_PTE_OFFSET 0x400 #define PAGE_SIZE_4K_ENABLE 0x2 #define I2S_SP_TX_MEM_WINDOW_START 0x4000000 @@ -96,6 +98,7 @@ struct acp_dev_data { }; extern const struct snd_soc_dai_ops asoc_acp_cpu_dai_ops; +extern const struct snd_soc_dai_ops acp_dmic_dai_ops; int asoc_acp_i2s_probe(struct snd_soc_dai *dai); int acp_platform_register(struct device *dev); @@ -131,6 +134,10 @@ static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int high = readl(adata->acp_base + ACP_I2S_RX_LINEARPOSITIONCNTR_HIGH); low = readl(adata->acp_base + ACP_I2S_RX_LINEARPOSITIONCNTR_LOW); break; + case DMIC_INSTANCE: + high = readl(adata->acp_base + ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH); + low = readl(adata->acp_base + ACP_WOV_RX_LINEARPOSITIONCNTR_LOW); + break; default: dev_err(adata->dev, "Invalid dai id %x\n", dai_id); return -EINVAL; diff --git a/sound/soc/amd/acp/chip_offset_byte.h b/sound/soc/amd/acp/chip_offset_byte.h index c7f77e975dc7..e38589a142e9 100644 --- a/sound/soc/amd/acp/chip_offset_byte.h +++ b/sound/soc/amd/acp/chip_offset_byte.h @@ -73,4 +73,24 @@ #define ACP_BTTDM_ITER 0x280C #define ACP_BTTDM_TXFRMT 0x2810 +/* Registers from ACP_WOV_PDM block */ + +#define ACP_WOV_PDM_ENABLE 0x2C04 +#define ACP_WOV_PDM_DMA_ENABLE 0x2C08 +#define ACP_WOV_RX_RINGBUFADDR 0x2C0C +#define ACP_WOV_RX_RINGBUFSIZE 0x2C10 +#define ACP_WOV_RX_LINKPOSITIONCNTR 0x2C14 +#define ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH 0x2C18 +#define ACP_WOV_RX_LINEARPOSITIONCNTR_LOW 0x2C1C +#define ACP_WOV_RX_INTR_WATERMARK_SIZE 0x2C20 +#define ACP_WOV_PDM_FIFO_FLUSH 0x2C24 +#define ACP_WOV_PDM_NO_OF_CHANNELS 0x2C28 +#define ACP_WOV_PDM_DECIMATION_FACTOR 0x2C2C +#define ACP_WOV_PDM_VAD_CTRL 0x2C30 +#define ACP_WOV_BUFFER_STATUS 0x2C58 +#define ACP_WOV_MISC_CTRL 0x2C5C +#define ACP_WOV_CLK_CTRL 0x2C60 +#define ACP_PDM_VAD_DYNAMIC_CLK_GATING_EN 0x2C64 +#define ACP_WOV_ERROR_STATUS_REGISTER 0x2C68 + #endif From patchwork Thu Jan 13 16:33:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Kumar Pandey X-Patchwork-Id: 12712912 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 80935C433F5 for ; Thu, 13 Jan 2022 16:36:20 +0000 (UTC) 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 9B3481FE9; Thu, 13 Jan 2022 17:35:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9B3481FE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642091778; bh=33h2PEdJ01sNA0ETJVSY3RAO1uf2hfF7MSaDGWq7ZMc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=i3nHBv5ZCG1GVNnR7wpNxLw1Ow4CbV2c2dv2CUfw+2sgXT3AoBBIrjGn42ANDbryw y0j5to7vY4yeqjz7S5dskoo0emowZB1ow/USOEKLm8/Gm/44pWCZwdzddNhPIcY4HT frKRjo6aGhC8s8ZtZBGXGyyx0MOhZn7ewedG2n4A= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BD035F80511; Thu, 13 Jan 2022 17:35:07 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5BC82F80515; Thu, 13 Jan 2022 17:35:06 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20603.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::603]) (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 D695DF804FE for ; Thu, 13 Jan 2022 17:35:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D695DF804FE Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ApkoBGBY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fqjPc768St8ex+ETnJ9MfOm8rpF24S6dUXi+f890cSwTtHpWj4qyIZbofkucSlekIcG5yJRgHZl7OfZO7DY1AQzv4YH3PTP52xYdID1V97CmIsdBBkmjor6jzQrMqpLD15sDvIEHROpgmHShCvH9oVsZY7qmex5yy80QlgpzLEuTU6REo3CYUToAm4+V0KHhCZdm3Ivo2gBoGfcg6zlSZF+vlySYuzzyFrJFdgOHXS5uEt0b29DtTKC90AZOpPGqG1AVzIMLhR3Mii6t942076Bgm2xeiZPy6M0sTaz4umLDFja1aXNxOpIAeO8JcLzbAF3unJUCPOu84H2RgM7S1Q== 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=2m1RzSnqEB7lEjWdke8awBRfdhrc7YeH/cC/s43plRo=; b=EMRFZgAn3Z9bEVpSEGkq6pGZj5QIlhcSTncahEaBr4XpP7FgtSW13PpkPEYGmuF1iIjrqQjlWMc5RTwHRCbp05x4QeTVseX8hss8h7WSHQNkyNmJui6Sdxdy7bKRQr5sQNgy0ZeAuWhoQLOQwZr4ZFkFYeqn0LQf84JhLBcPCuLY3sKQWXHuTMG0F6eR/TLw8crdzoTpQE5yu3MpE+asyCQzP/00XBsDfJSy6hS/S5FQlU/Km5La2ZCBsVpMOA9Fule2FMlVzrv3X1IhojAWqFyvNVcvhCydyWYEJesiXFlJMdgCaeTjYiUHHrX//kk1zkQsnQRQrHB2lJROqiVoSw== 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=2m1RzSnqEB7lEjWdke8awBRfdhrc7YeH/cC/s43plRo=; b=ApkoBGBYk7M2ShfpFUMOVrrFgJiOoWLawyKWMohWDjy8hVx/I9L0ye0rpwQ7VvvNWidWrx3I3e3xFTwsdFjfCwgD3Y9zvOGckJPcyRrgwviIrZe4RmbWsmz911XV1nhSvUfmzJKt5SEB4j8Q3o++m+h2o/IjVKQBa+SMa3ehQaE= Received: from BN8PR07CA0034.namprd07.prod.outlook.com (2603:10b6:408:ac::47) by BY5PR12MB3860.namprd12.prod.outlook.com (2603:10b6:a03:1ac::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9; Thu, 13 Jan 2022 16:34:57 +0000 Received: from BN8NAM11FT060.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ac:cafe::ae) by BN8PR07CA0034.outlook.office365.com (2603:10b6:408:ac::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.10 via Frontend Transport; Thu, 13 Jan 2022 16:34:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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 BN8NAM11FT060.mail.protection.outlook.com (10.13.177.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4888.9 via Frontend Transport; Thu, 13 Jan 2022 16:34:57 +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.2375.17; Thu, 13 Jan 2022 10:34:56 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 13 Jan 2022 10:34:56 -0600 Received: from chrome.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 13 Jan 2022 10:34:52 -0600 From: Ajit Kumar Pandey To: , Subject: [PATCH v2 2/6] ASoC: amd: acp: Add PDM controller based dmic dai for Renoir Date: Thu, 13 Jan 2022 22:03:44 +0530 Message-ID: <20220113163348.434108-3-AjitKumar.Pandey@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> References: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c9b0a65-cd72-487c-a359-08d9d6b2a2cb X-MS-TrafficTypeDiagnostic: BY5PR12MB3860:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:901; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Oe4MJ+V2PvG0MoKGVisfa5WOe9UxG8T/nbQcULJshiNT3+vzZIouosHiKgJ1MvjQq7vSkoJQP/IZYbMXVCBTVezt406SCTlc+18AKz84PuPA2Y/sCjCgSug+at0p1yHyhFLAiz9DWPAr2LuQmCVotb3ShRT/3NOst5nsBd7ismqTN1F4sxNf6NWZQJ5IpIUm2j9V6cUiWqyAO4ILLm6r1kBR1ZyqMnK0cRm08QMbKY3aE2RDPOGWdVi0nrxZpq683XBNBNq72/EkFI1eOwJx5wbY+ju9xwdwsz0WubPgsnPd/d3CIvadX0b7TwqFjhzCJ+rNR6wJDjXbvNGMMpiTMEdJLUWUkFskXZfHum708xxg7pGygsASKHukgDDfu/Y1WAkPn+gSS/Vanx3shtmn9Em9sNaWI6XPlNVKrSuZCLMvxwUOxMcGnuIMUSsn8MpJRorLc7FZz86E3rrcPieuH48VdT+lBdtPA9haGfGxtWWUnItxLxFjKDE8FEbhtU4XnRh1bA3rX5s70BdFEWhLxjYWM/JmZrNgK4PESbDlJt3Dbjb8L/4RZ0pvs7myooPLOSURiboTbQCnNxUbQ2iskEvaZhAamyqguZH5sUIbAv50CclsHiwbHQ/bjynkCyxU0f65uDb1nkLLMKJ5X5+tNEqyCQ6AXm+cnhisXYXLYqZaEBipZFHM9F8ZMKqyehuc6eXCH/9lPSeAnxifIrSVk+xIylaqwuw4VPHQqZF1g3QNk4+I8+NAaZ7Hg7XKGjO+wgjzjK9OL/Xsmvs2Lh8Gce0kv7VbAZHfkhb7EMf7Y8c= 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)(40470700002)(110136005)(47076005)(40460700001)(336012)(81166007)(426003)(54906003)(4326008)(5660300002)(356005)(316002)(82310400004)(26005)(36860700001)(36756003)(6666004)(1076003)(186003)(7696005)(8676002)(86362001)(8936002)(83380400001)(70586007)(508600001)(70206006)(2906002)(2616005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2022 16:34:57.2944 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c9b0a65-cd72-487c-a359-08d9d6b2a2cb 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: BN8NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3860 Cc: Sunil-kumar.Dommati@amd.com, Geert Uytterhoeven , Ajit Kumar Pandey , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , V sujith kumar Reddy , Arnd Bergmann , Vijendar.Mukunda@amd.com, Alexander.Deucher@amd.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Renoir ACP IP has a PDM controller block. Add DMIC dai instance in dai_driver struct to enable dmic capture support on Renoir platform. Signed-off-by: Ajit Kumar Pandey --- sound/soc/amd/acp/Kconfig | 1 + sound/soc/amd/acp/acp-renoir.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig index 2e6d0259f2e9..f4ca7843391b 100644 --- a/sound/soc/amd/acp/Kconfig +++ b/sound/soc/amd/acp/Kconfig @@ -29,6 +29,7 @@ config SND_AMD_ASOC_RENOIR tristate "AMD ACP ASOC Renoir Support" select SND_SOC_AMD_ACP_PCM select SND_SOC_AMD_ACP_I2S + select SND_SOC_AMD_ACP_PDM depends on X86 && PCI help This option enables Renoir I2S support on AMD platform. diff --git a/sound/soc/amd/acp/acp-renoir.c b/sound/soc/amd/acp/acp-renoir.c index 9b321a055b52..770a57a0677b 100644 --- a/sound/soc/amd/acp/acp-renoir.c +++ b/sound/soc/amd/acp/acp-renoir.c @@ -97,6 +97,19 @@ static struct snd_soc_dai_driver acp_renoir_dai[] = { .ops = &asoc_acp_cpu_dai_ops, .probe = &asoc_acp_i2s_probe, }, +{ + .name = "acp-pdm-dmic", + .id = DMIC_INSTANCE, + .capture = { + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &acp_dmic_dai_ops, +}, }; static int renoir_audio_probe(struct platform_device *pdev) From patchwork Thu Jan 13 16:33:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Kumar Pandey X-Patchwork-Id: 12712913 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9BA7CC433F5 for ; Thu, 13 Jan 2022 16:36:27 +0000 (UTC) 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 D432A1FF7; Thu, 13 Jan 2022 17:35:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D432A1FF7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642091785; bh=ISIWu59uFs6zoR98OI9maZWfwRlk7auIAct7g8tmO88=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WpAiKTkJkrhnR7zmELZpHYFUtknpTl+bFE6rNdN98f+CnUGSWjYLUaa2nBll82vV4 AQJMlub3egR/M88kl7KnwdMtIhRj6E+p8TiASrBxCUi2qHaH50giUoj9oatE6QwFWV m74FEE5mUvwVB9kf5ydWv/zT6KA/GU8AzsyDW2OQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 976BEF80141; Thu, 13 Jan 2022 17:35:32 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2DA01F80515; Thu, 13 Jan 2022 17:35:26 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2082.outbound.protection.outlook.com [40.107.223.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 BE26FF80088 for ; Thu, 13 Jan 2022 17:35:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BE26FF80088 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="CvYMegMb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sz5JRA2eWFg/tOdbjXD5O9ZETiNqFeL897qYWuZ+JknySmC0uMg03/yxAN9snGP1PqC9ylKLaSfWtwR4MADbM490vko3AqNLq38t0ktV6goNUiOcYVOGtFOh4KwnzoVnahSganFH+ad8U7jxJKkuWbpibnWVRVynDYcdlzTjOQgwpBl/b2AHNAvXBZnLNnEw2ON2PT/mkRiZ2SudVzaKFNHbGH7T5b33JAzw0WDt9U4u4EbhQ/sz+gSU9Bd1anMCz3XkR2Uj/yrd4lcz8zKbdRk3mcWfwyJtV0snHBBg9n5DV8ZyY5L5v9TdEUuObm3Cm9TqjgPxPhzSqoj3iGPfgg== 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=ncvFO67k+u1YwrIXZVC/C42wVfltGT6uVef5TwD5Ugw=; b=BGCdFOnq1ZxmpJt575MrhuzqZsLVcLRsv8pSZeC8y57CMPdYDVkUALnk6Px8MPjMlc++R4eHvQaErwJnzRcAiOfnRpVK/1YZbQaGXerWW3tqa60L+QuRvh2MkKi0TlutWrVST2rzDxs+Pi1//ntuNafQudxS/AAVmUktdAOJOt/9vIBUl2eLmEfWFyDx7SLFlLTp6VKpuOpr0NUdcRDzn/RCroVOwurFiyxor1uzNa2rxoazNCYGC3kz8hDthkuX/c9lCueYid2ZBS0zBKsiDGrhkf43nnHNOgZAciKk93dnKNtGY3367quQ1ezbMsdDthVUSIU0v0BdJNJ8tnbRWw== 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=ncvFO67k+u1YwrIXZVC/C42wVfltGT6uVef5TwD5Ugw=; b=CvYMegMbzTjQuAi7qJY6hga/7F5q7olQ+VCi1tVceMYd3PINBjoarQ0nbCDlQAM73G//oqP1qxge8QOA9tmzlDNlP3N7iUMhRQMcf54wlYwvUvNuBPiBOU7W21Zo4C1S7oqLkCvWzNtSUho+82yotW1Ov2fq5J7Ai9cG0vxXBC4= Received: from BN9PR03CA0968.namprd03.prod.outlook.com (2603:10b6:408:109::13) by CY4PR12MB1927.namprd12.prod.outlook.com (2603:10b6:903:127::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.11; Thu, 13 Jan 2022 16:35:16 +0000 Received: from BN8NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:408:109:cafe::6f) by BN9PR03CA0968.outlook.office365.com (2603:10b6:408:109::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9 via Frontend Transport; Thu, 13 Jan 2022 16:35:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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 BN8NAM11FT008.mail.protection.outlook.com (10.13.177.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4888.9 via Frontend Transport; Thu, 13 Jan 2022 16:35:15 +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.2375.17; Thu, 13 Jan 2022 10:35:15 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 13 Jan 2022 10:35:15 -0600 Received: from chrome.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 13 Jan 2022 10:35:10 -0600 From: Ajit Kumar Pandey To: , Subject: [PATCH v2 3/6] ASoC: amd: acp: Add generic PCI driver module for ACP device Date: Thu, 13 Jan 2022 22:03:45 +0530 Message-ID: <20220113163348.434108-4-AjitKumar.Pandey@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> References: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 993a38e7-1c9f-4ab0-bd60-08d9d6b2aded X-MS-TrafficTypeDiagnostic: CY4PR12MB1927:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:227; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wVOK2VJsFaRaoiBCGPTOMbG55WXw2g/30KMM3JgfNuLp4n6B9NozeJathJtQWOI8qa37TpoGHmq6XfE1QCv0DRm5+Uq1KMMl/B8imlXF25loT7U3aSTJ4foSA3+L9kgXdlX0oTt7UDwLco5M/Z6JrWb54Y4HZNj2SH9cmkK5ah3WUas0gdxkLg1e9YrMz/jsW5e+Z117Q9mmrG44uhxsBOq5lNpJVX6h8wP5QpTw5QgDjeQSOzN8FkzzWXqwwsLI0Den8dvqe5H9aSXmsjpg4jVpwKnYP/8Fuw7BZOuQtJCAhzCm2YWDK4cFHVCxTJcqg+C4IkT/KdP3bSwIc0poc3O4QeRV2imH828xr+qnyUtXyJB+aKWTL63Tu0tMDRln2aguJ3Z0DRuj9dkJhZ4nAsGNeSwO44Y9qeXDN1CKURt0JYg/G33JJ32Pxs5mBQgsB6PFiiXai+oF4oozlYU69ehH6dUAmyfQP4xNg0phEiAGyA7Z+axyPF53m4SNcwel6P5Z7lXNO+h0GSQQHbPvz3UEeCEaE2emkbx3yHL8b0ysHfDJ0VIThSymoeZSRAzRBKGIppFVwFDV9xs3tf57YURtHhi3l8WtQT8CZsPycx0UHwOvJRWj7PZJ/jml0VbZHslFoBfenhIhMke66H6jhfmlrQbd/bz8OehHyHiIQsgG5LWZmDub5GUAiX8UcjW6EzBElpEzYJcaGEh4oFQnpwcRc/5Ld6cSAeD0oBBEcSwt8sCYMqKzNJ82axMF1yyQMZsdk9IZp7enwWkwzIGhwHFDSBAYtA9YG/7nOubmgj6QBRuXw6WIKDp2wVMLLKDdBLFV4BURzT4jmjHHNBVRoA== 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)(40470700002)(36840700001)(8936002)(36756003)(36860700001)(336012)(82310400004)(5660300002)(1076003)(47076005)(70206006)(86362001)(4326008)(40460700001)(426003)(70586007)(2616005)(26005)(508600001)(8676002)(83380400001)(186003)(81166007)(316002)(2906002)(6666004)(110136005)(7696005)(7416002)(54906003)(356005)(41533002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2022 16:35:15.9728 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 993a38e7-1c9f-4ab0-bd60-08d9d6b2aded 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: BN8NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1927 Cc: Sunil-kumar.Dommati@amd.com, Geert Uytterhoeven , Ajit Kumar Pandey , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , V sujith kumar Reddy , Arnd Bergmann , Ranjani Sridharan , Vijendar.Mukunda@amd.com, Alexander.Deucher@amd.com, Daniel Baluta , Bard Liao 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" Audio Co-processor or ACP IP block on AMD's SOC is connected via PCI bus interface, hence needs to be register as a PCI device. We have same PCI device ID across multiple SOC's but with different revision id for PCI hw. Add a generic PCI driver module for ACP that registers ACP as a PCI device and also register a platform device based on pci revision id. Any SOC's specific configuration for ACP block will be done in platform driver probe. We have added an initial support for ACP revision id 3 or ACP3X device. Signed-off-by: Ajit Kumar Pandey --- sound/soc/amd/acp/Kconfig | 6 ++ sound/soc/amd/acp/Makefile | 2 + sound/soc/amd/acp/acp-pci.c | 160 ++++++++++++++++++++++++++++++++++++ sound/soc/amd/acp/amd.h | 14 ++++ sound/soc/amd/mach-config.h | 1 + 5 files changed, 183 insertions(+) create mode 100644 sound/soc/amd/acp/acp-pci.c diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig index f4ca7843391b..626e4a5cb06a 100644 --- a/sound/soc/amd/acp/Kconfig +++ b/sound/soc/amd/acp/Kconfig @@ -25,6 +25,12 @@ config SND_SOC_AMD_ACP_PCM tristate select SND_SOC_ACPI if ACPI +config SND_SOC_AMD_ACP_PCI + tristate "AMD ACP PCI Driver Support" + depends on X86 && PCI + help + This options enables generic PCI driver for ACP device. + config SND_AMD_ASOC_RENOIR tristate "AMD ACP ASOC Renoir Support" select SND_SOC_AMD_ACP_PCM diff --git a/sound/soc/amd/acp/Makefile b/sound/soc/amd/acp/Makefile index 66cac95432f6..657ddfadf0bb 100644 --- a/sound/soc/amd/acp/Makefile +++ b/sound/soc/amd/acp/Makefile @@ -8,6 +8,7 @@ snd-acp-pcm-objs := acp-platform.o snd-acp-i2s-objs := acp-i2s.o snd-acp-pdm-objs := acp-pdm.o +snd-acp-pci-objs := acp-pci.o #platform specific driver snd-acp-renoir-objs := acp-renoir.o @@ -20,6 +21,7 @@ snd-acp-sof-mach-objs := acp-sof-mach.o obj-$(CONFIG_SND_SOC_AMD_ACP_PCM) += snd-acp-pcm.o obj-$(CONFIG_SND_SOC_AMD_ACP_I2S) += snd-acp-i2s.o obj-$(CONFIG_SND_SOC_AMD_ACP_PDM) += snd-acp-pdm.o +obj-$(CONFIG_SND_SOC_AMD_ACP_PCI) += snd-acp-pci.o obj-$(CONFIG_SND_AMD_ASOC_RENOIR) += snd-acp-renoir.o diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c new file mode 100644 index 000000000000..3a0511fd1de2 --- /dev/null +++ b/sound/soc/amd/acp/acp-pci.c @@ -0,0 +1,160 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +// +// This file is provided under a dual BSD/GPLv2 license. When using or +// redistributing this file, you may do so under either license. +// +// Copyright(c) 2021 Advanced Micro Devices, Inc. All rights reserved. +// +// Authors: Ajit Kumar Pandey + +/* + * Generic PCI interface for ACP device + */ + +#include +#include +#include +#include +#include + +#include "amd.h" +#include "../mach-config.h" + +#define DRV_NAME "acp_pci" + +#define ACP3x_REG_START 0x1240000 +#define ACP3x_REG_END 0x125C000 + +static struct platform_device *dmic_dev; +static struct platform_device *pdev; + +static const struct resource acp3x_res[] = { + { + .start = 0, + .end = ACP3x_REG_END - ACP3x_REG_START, + .name = "acp_mem", + .flags = IORESOURCE_MEM, + }, + { + .start = 0, + .end = 0, + .name = "acp_dai_irq", + .flags = IORESOURCE_IRQ, + }, +}; + +static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) +{ + struct platform_device_info pdevinfo; + struct device *dev = &pci->dev; + const struct resource *res_acp; + struct acp_chip_info *chip; + struct resource *res; + unsigned int flag, addr, num_res, i; + int ret; + + flag = snd_amd_acp_find_config(pci); + if (flag != FLAG_AMD_LEGACY) + return -ENODEV; + + chip = devm_kzalloc(&pci->dev, sizeof(*chip), GFP_KERNEL); + if (!chip) + return -ENOMEM; + + 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"); + return -ENOMEM; + } + + pci_set_master(pci); + + switch (pci->revision) { + case 0x01: + res_acp = acp3x_res; + num_res = ARRAY_SIZE(acp3x_res); + chip->name = "acp_asoc_renoir"; + chip->acp_rev = ACP3X_DEV; + break; + default: + dev_err(dev, "Unsupported device revision:0x%x\n", pci->revision); + return -EINVAL; + } + + dmic_dev = platform_device_register_data(dev, "dmic-codec", PLATFORM_DEVID_NONE, NULL, 0); + if (IS_ERR(dmic_dev)) { + dev_err(dev, "failed to create DMIC device\n"); + return PTR_ERR(dmic_dev); + } + + addr = pci_resource_start(pci, 0); + chip->base = devm_ioremap(&pci->dev, addr, pci_resource_len(pci, 0)); + + res = devm_kzalloc(&pci->dev, sizeof(struct resource) * num_res, GFP_KERNEL); + if (!res) { + platform_device_unregister(dmic_dev); + return -ENOMEM; + } + + for (i = 0; i < num_res; i++, res_acp++) { + res[i].name = res_acp->name; + res[i].flags = res_acp->flags; + res[i].start = addr + res_acp->start; + res[i].end = addr + res_acp->end; + if (res_acp->flags == IORESOURCE_IRQ) { + res[i].start = pci->irq; + res[i].end = res[i].start; + } + } + + memset(&pdevinfo, 0, sizeof(pdevinfo)); + + pdevinfo.name = chip->name; + pdevinfo.id = 0; + pdevinfo.parent = &pci->dev; + pdevinfo.num_res = num_res; + pdevinfo.res = &res[0]; + pdevinfo.data = chip; + pdevinfo.size_data = sizeof(*chip); + + pdev = platform_device_register_full(&pdevinfo); + if (IS_ERR(pdev)) { + dev_err(&pci->dev, "cannot register %s device\n", pdevinfo.name); + platform_device_unregister(dmic_dev); + ret = PTR_ERR(pdev); + } + + return ret; +}; + +static void acp_pci_remove(struct pci_dev *pci) +{ + if (dmic_dev) + platform_device_unregister(dmic_dev); + if (pdev) + platform_device_unregister(pdev); +} + +/* PCI IDs */ +static const struct pci_device_id acp_pci_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_AMD, ACP_PCI_DEV_ID)}, + { 0, } +}; +MODULE_DEVICE_TABLE(pci, acp_pci_ids); + +/* pci_driver definition */ +static struct pci_driver snd_amd_acp_pci_driver = { + .name = KBUILD_MODNAME, + .id_table = acp_pci_ids, + .probe = acp_pci_probe, + .remove = acp_pci_remove, +}; +module_pci_driver(snd_amd_acp_pci_driver); + +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_ALIAS(DRV_NAME); diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 567355209a5c..8fd38bf4d3bd 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -12,9 +12,14 @@ #define __AMD_ACP_H #include +#include #include +#include + #include "chip_offset_byte.h" +#define ACP3X_DEV 3 + #define I2S_SP_INSTANCE 0x00 #define I2S_BT_INSTANCE 0x01 #define DMIC_INSTANCE 0x02 @@ -70,6 +75,12 @@ #define ACP_MAX_STREAM 6 +struct acp_chip_info { + char *name; /* Platform name */ + unsigned int acp_rev; /* ACP Revision id */ + void __iomem *base; /* ACP memory PCI base */ +}; + struct acp_stream { struct snd_pcm_substream *substream; int irq_bit; @@ -106,6 +117,9 @@ int acp_platform_unregister(struct device *dev); int acp_machine_select(struct acp_dev_data *adata); +/* Machine configuration */ +int snd_amd_acp_find_config(struct pci_dev *pci); + static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int direction) { u64 byte_count, low = 0, high = 0; diff --git a/sound/soc/amd/mach-config.h b/sound/soc/amd/mach-config.h index feb3756d9ac4..0a54567a2841 100644 --- a/sound/soc/amd/mach-config.h +++ b/sound/soc/amd/mach-config.h @@ -14,6 +14,7 @@ #define FLAG_AMD_SOF BIT(1) #define FLAG_AMD_SOF_ONLY_DMIC BIT(2) +#define FLAG_AMD_LEGACY BIT(3) #define ACP_PCI_DEV_ID 0x15E2 From patchwork Thu Jan 13 16:33:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Kumar Pandey X-Patchwork-Id: 12712914 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 16D08C433F5 for ; Thu, 13 Jan 2022 16:36:54 +0000 (UTC) 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 4866E1FD7; Thu, 13 Jan 2022 17:36:02 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4866E1FD7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642091812; bh=8Nmw3VHzRpbYBwIkX8RCTSa6Yb17j1mEMUD9A9+2mmA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YCy5HFu6mYj9FjXkctIITVDVwv4y1dAsQ8UBOq9tfY4lOR0o988adx8kTtyNPYcx8 hnBISR2zbJmuQ+WlIyl3IDtcO9uuxlu1AbN9RCv+aYB7mFBGT9HJZjBb/g0HA5RwyH wjkLCaAKtBsawTcxRcsjxOB4mfXm3NE9xt4tx4eA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3666EF80510; Thu, 13 Jan 2022 17:35:38 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A6910F80510; Thu, 13 Jan 2022 17:35:36 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2088.outbound.protection.outlook.com [40.107.223.88]) (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 B1375F80510 for ; Thu, 13 Jan 2022 17:35:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B1375F80510 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="UNXbfKRd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FOF6F8fsX37+lmaR6pPJI6ApgspgsIgcw8yv0eRtR2pAV6vZ5cp2VASEd1Kh446vO0kS9IBFzVhvT9enju0zYjNWWZvWbjbtHhLo+ioMqCGZVPRTW+jEP4q5tZLltLNnLR0JeCBJUJWYgctS/zHVyZ+vB9rJcfi1TJ9s7LF4oFG/JcapooNeZR5Ad9YRhHSd3UW2klZonDd9qfBpqmApZEr9by1R7P0jaLjSs/2SYgq5NldpeTUJfNNUAT9Qffq+vYCuwHMV0BuhY+g9XFaFD40mkDd3NZRdFkJhX6rf7Sjly2stlw7Hn9KZLogQwdJBSiChBbx5+kdAm8JuQmVACA== 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=7QsjnhVQQdJ6icA/lVkJK190jwIitICsAqVkpGc5wYU=; b=THadA3jNEyNwKYro/YldYROEMqotzQRvQKkz/g50/MK0+zpxf2jOPCfMrP9/94DwKtyX68DnhXRSsF6XV4s4t20SelMCnty3zvgLwG6CZGaojlQaB8cU5xn4m/V0epFctcNZBPFt1kh820S5+gztjHeMNttjRItrYe+mHzH77/bsz+DLMFcK4h6XME9GxLHnP+GMkqvZTrq2e/3GsevmGTv4qeUoNGCxC99tfJX/y0uG3lBpZ95miE4y3zbrpRAQeG+pf/49WabceoIIEjnKtlA2TcGD1VH2SPebUFNdmHypVrYYXXqop4SXQaAmSFylrM3sIgjxZIzmlR8lKU/Jcg== 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=7QsjnhVQQdJ6icA/lVkJK190jwIitICsAqVkpGc5wYU=; b=UNXbfKRdz+a2TxPrwYrv1MSUUe/0mmxDs3IawIBHJlltkISDdfQzrnmgoMwRNIbC/PAJsEknLdt630Zw5oH5cK0xqll8Xxt0DOzO9cAGGQOIkhnV6M7ujdasJrYcKLFZvwS0L+hfuuZlDOf5XTbsSRfOy5Sbe8YpYn20Qy/KNPo= Received: from MWHPR15CA0042.namprd15.prod.outlook.com (2603:10b6:300:ad::28) by BN8PR12MB4595.namprd12.prod.outlook.com (2603:10b6:408:72::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9; Thu, 13 Jan 2022 16:35:28 +0000 Received: from CO1NAM11FT061.eop-nam11.prod.protection.outlook.com (2603:10b6:300:ad:cafe::ab) by MWHPR15CA0042.outlook.office365.com (2603:10b6:300:ad::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9 via Frontend Transport; Thu, 13 Jan 2022 16:35:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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 CO1NAM11FT061.mail.protection.outlook.com (10.13.175.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4888.9 via Frontend Transport; Thu, 13 Jan 2022 16:35:27 +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.2375.17; Thu, 13 Jan 2022 10:35:26 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 13 Jan 2022 10:35:26 -0600 Received: from chrome.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 13 Jan 2022 10:35:22 -0600 From: Ajit Kumar Pandey To: , Subject: [PATCH v2 4/6] ASoC: amd: acp: Add ACP init()/deinit() callback for Renoir. Date: Thu, 13 Jan 2022 22:03:46 +0530 Message-ID: <20220113163348.434108-5-AjitKumar.Pandey@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> References: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f517c5d1-484b-4d9f-db4a-08d9d6b2b4ee X-MS-TrafficTypeDiagnostic: BN8PR12MB4595:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1388; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x1F15wBlEvrZ3AEUISfUmrgg4wGm+7N/BJAlb/YTtQYmSqjo0EnzrXvp3OmKpxMlbUgKwrntbKk2q3YD19rLeOOsOieZwaRALmq2gQFEjSd+6wnVO+yqwM+9eZ+oZdUmK0SLFcwsUaBdI6Mb5jKqYhoezPIdNqeygEblsmNUim3qodVOZBCoqnVENLPK2hZTd6W9inqkU4lLyL9HzksM50NCwRXb2JWZmYoNKECwGJXK1+FL2LRqke5lppQs6VBpgPwiEJji1rhyj2XvnOVOXbFly0Y4EDStADCl2cDq9S35hj0oQ1NXbB3OWvViOSQT9/LOWAbXknbTNt1qfJyJU1Xx5BpatLo74l2f7AMyb84jtPbO9wkuTY9pK+9ronG4fGWrOxUZuO5uJ7vjGyz2PUEhLcsEuAGwocGR9a7DUZovMBbxu/H7Z+BUu9J1jd8kXHHb4qK70aBrEED+XHLzhV1sINtRCDzsX2/Cqsevo1Y1WD7aniVAoCblVn1gMzynSoyjrP9xmtYdrh4y2Ef1fOLj82rQP67oLaA0gdSop268/FSFrt0DrR8+S0vnKzIEH8jM+7hJtKZJcGOMZdu2kZoNyTpgqlj7tG7Nbbg0OHY9Aixw9kWwmFdkAQVV1S+SUo7eyHJYkANxhMXm3fdcRcBuWTtVAVETqfc5BxLXRrxYRj3MQkVYddCsRT3WgtkDQIisBXnYMJEnKeSOlApngkEWF62OnY3gDU1QslUSLAkHXMoBHNZ3n5PSgPpIEXTaXnzjoZf/bRRw6kTcxp0R7s1ZJuu/ZLVLw87OAnTicNI= 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)(40470700002)(46966006)(70586007)(86362001)(47076005)(82310400004)(316002)(81166007)(40460700001)(70206006)(26005)(36860700001)(186003)(36756003)(83380400001)(6666004)(8676002)(336012)(8936002)(2906002)(426003)(110136005)(2616005)(508600001)(356005)(54906003)(7696005)(4326008)(1076003)(5660300002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2022 16:35:27.6148 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f517c5d1-484b-4d9f-db4a-08d9d6b2b4ee 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: CO1NAM11FT061.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB4595 Cc: Sunil-kumar.Dommati@amd.com, Ajit Kumar Pandey , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Vijendar.Mukunda@amd.com, Alexander.Deucher@amd.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" ACP hardware has PGFSM control registers that can be configured to power On/Off the ACP IP block. Add acp init()/de_init() callbacks in renoir platform driver probe()/remove() respectively to power on and off ACP IP block on ACP3X device. Signed-off-by: Ajit Kumar Pandey --- sound/soc/amd/acp/acp-renoir.c | 170 +++++++++++++++++++++++++++ sound/soc/amd/acp/chip_offset_byte.h | 6 + 2 files changed, 176 insertions(+) diff --git a/sound/soc/amd/acp/acp-renoir.c b/sound/soc/amd/acp/acp-renoir.c index 770a57a0677b..a29f910f25d1 100644 --- a/sound/soc/amd/acp/acp-renoir.c +++ b/sound/soc/amd/acp/acp-renoir.c @@ -25,6 +25,19 @@ #define DRV_NAME "acp_asoc_renoir" +#define ACP_SOFT_RST_DONE_MASK 0x00010001 + +#define ACP_PWR_ON_MASK 0x01 +#define ACP_PWR_OFF_MASK 0x00 +#define ACP_PGFSM_STAT_MASK 0x03 +#define ACP_POWERED_ON 0x00 +#define ACP_PWR_ON_IN_PROGRESS 0x01 +#define ACP_POWERED_OFF 0x02 + + +#define ACP_ERROR_MASK 0x20000000 +#define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF + static struct snd_soc_acpi_codecs amp_rt1019 = { .num_codecs = 1, .codecs = {"10EC1019"} @@ -112,11 +125,154 @@ static struct snd_soc_dai_driver acp_renoir_dai[] = { }, }; +static int acp3x_power_on(void __iomem *base) +{ + u32 val; + int timeout = 0; + + val = readl(base + ACP_PGFSM_STATUS); + + if (val == ACP_POWERED_ON) + return 0; + + if ((val & ACP_PGFSM_STAT_MASK) != ACP_PWR_ON_IN_PROGRESS) + writel(ACP_PWR_ON_MASK, base + ACP_PGFSM_CONTROL); + + while (++timeout < 500) { + val = readl(base + ACP_PGFSM_STATUS); + if (!val) + return 0; + udelay(1); + } + + return -ETIMEDOUT; +} + +static int acp3x_power_off(void __iomem *base) +{ + u32 val; + int timeout = 0; + + writel(ACP_PWR_OFF_MASK, base + ACP_PGFSM_CONTROL); + + while (++timeout < 500) { + val = readl(base + ACP_PGFSM_STATUS); + if ((val & ACP_PGFSM_STAT_MASK) == ACP_POWERED_OFF) + return 0; + udelay(1); + } + + return -ETIMEDOUT; +} + +static int acp3x_reset(void __iomem *base) +{ + u32 val; + int timeout = 0; + + writel(1, base + ACP_SOFT_RESET); + + while (++timeout < 500) { + val = readl(base + ACP_SOFT_RESET); + if (val & ACP_SOFT_RST_DONE_MASK) + break; + cpu_relax(); + } + + writel(0, base + ACP_SOFT_RESET); + + timeout = 0; + while (++timeout < 500) { + val = readl(base + ACP_SOFT_RESET); + if (!val) + return 0; + cpu_relax(); + } + + return -ETIMEDOUT; +} + +static void acp3x_enable_interrupts(void __iomem *base) +{ + u32 ext_intr_ctrl; + + writel(0x01, base + ACP_EXTERNAL_INTR_ENB); + ext_intr_ctrl = readl(base + ACP_EXTERNAL_INTR_CNTL); + ext_intr_ctrl |= ACP_ERROR_MASK; + writel(ext_intr_ctrl, base + ACP_EXTERNAL_INTR_CNTL); +} + +static void acp3x_disable_interrupts(void __iomem *base) +{ + writel(ACP_EXT_INTR_STAT_CLEAR_MASK, base + ACP_EXTERNAL_INTR_STAT); + writel(0x00, base + ACP_EXTERNAL_INTR_ENB); +} + +static int rn_acp_init(void __iomem *base) +{ + int ret; + + /* power on */ + ret = acp3x_power_on(base); + if (ret) + return ret; + + writel(0x01, base + ACP_CONTROL); + + /* Reset */ + ret = acp3x_reset(base); + if (ret) + return ret; + + acp3x_enable_interrupts(base); + + return 0; +} + +static int rn_acp_deinit(void __iomem *base) +{ + int ret = 0; + + acp3x_disable_interrupts(base); + + /* Reset */ + ret = acp3x_reset(base); + if (ret) + return ret; + + writel(0x00, base + ACP_CONTROL); + + /* power off */ + ret = acp3x_power_off(base); + if (ret) + return ret; + + return 0; +} static int renoir_audio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + struct acp_chip_info *chip; struct acp_dev_data *adata; struct resource *res; + int ret; + + chip = dev_get_platdata(&pdev->dev); + if (!chip || !chip->base) { + dev_err(&pdev->dev, "ACP chip data is NULL\n"); + return -ENODEV; + } + + if (chip->acp_rev != ACP3X_DEV) { + dev_err(&pdev->dev, "Un-supported ACP Revision %d\n", chip->acp_rev); + return -ENODEV; + } + + ret = rn_acp_init(chip->base); + if (ret) { + dev_err(&pdev->dev, "ACP Init failed\n"); + return -EINVAL; + } adata = devm_kzalloc(dev, sizeof(struct acp_dev_data), GFP_KERNEL); if (!adata) @@ -155,6 +311,20 @@ static int renoir_audio_probe(struct platform_device *pdev) static int renoir_audio_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; + struct acp_chip_info *chip; + int ret; + + chip = dev_get_platdata(&pdev->dev); + if (!chip || !chip->base) { + dev_err(&pdev->dev, "ACP chip data is NULL\n"); + return -ENODEV; + } + + ret = rn_acp_deinit(chip->base); + if (ret) { + dev_err(&pdev->dev, "ACP de-init Failed\n"); + return -EINVAL; + } acp_platform_unregister(dev); return 0; diff --git a/sound/soc/amd/acp/chip_offset_byte.h b/sound/soc/amd/acp/chip_offset_byte.h index e38589a142e9..88f6fa597cd6 100644 --- a/sound/soc/amd/acp/chip_offset_byte.h +++ b/sound/soc/amd/acp/chip_offset_byte.h @@ -14,6 +14,12 @@ #define ACPAXI2AXI_ATU_CTRL 0xC40 #define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_5 0xC20 #define ACPAXI2AXI_ATU_BASE_ADDR_GRP_5 0xC24 + +#define ACP_PGFSM_CONTROL 0x141C +#define ACP_PGFSM_STATUS 0x1420 +#define ACP_SOFT_RESET 0x1000 +#define ACP_CONTROL 0x1004 + #define ACP_EXTERNAL_INTR_ENB 0x1800 #define ACP_EXTERNAL_INTR_CNTL 0x1804 #define ACP_EXTERNAL_INTR_STAT 0x1808 From patchwork Thu Jan 13 16:33:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Kumar Pandey X-Patchwork-Id: 12712915 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EDD2CC433EF for ; Thu, 13 Jan 2022 16:37:13 +0000 (UTC) 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 22F572007; Thu, 13 Jan 2022 17:36:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 22F572007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642091832; bh=6zUsG9qYtYMH6LtbgM+EGV5W/jbeFrJEFB6JIxKaUuc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JYBHugBvhP7jhv5tEFjKagT2yC1oFOmweYdyYV+DNkv3MSKBnfIbo1HkwzCuCmbyH RU9fMsZd0b1FMkqPGbGBTgDv3RL9hvk0xWFEEfdN9uZkXbBuIGe2UdIW2SJw8KIAgj eAt6C3wqQDrnUMdo9Lk+PTj09xDy+EzO8XgDpEa8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 185B9F80519; Thu, 13 Jan 2022 17:35:52 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 94D19F8051C; Thu, 13 Jan 2022 17:35:50 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2047.outbound.protection.outlook.com [40.107.94.47]) (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 212D9F804F2 for ; Thu, 13 Jan 2022 17:35:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 212D9F804F2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="hLA8+6RF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U/HWsp8cmLngxaHlw9HKpjDrDiZix4MLLXSm1UhnP9Itidg1FZ+4TjNgigd99JISsB5j0L6GJcWPsBwgFgtQ2iI/27zQt1ptj5yFwhlDEK3hBFPvFDzw/9Or5dUyAgqNp+edZQrd/eHTVUDTnRfqNsiXx2/i7P1t0ttuxer6IZxbhhmmlIdTy9Lk2eIe3B7uicAcYLfjSJT2DL4ipwzKF1WmwMDGK0kta9XWBk3cbYBNJf+7wg4NriVmJH+P2ZL/Wz3dEm783WS1BhE5P7ucQeeq2YykHATIzCUvurX6pB3uCtPQI2YtQ+6XgcJ0YjKUBmIexMG9D0Qwys/27kaXYQ== 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=J0zrcuPd4mY9R/L4Zs9eqA5JLpYh4Qq+f12LdA0fmIE=; b=DBaROG2tF+QmzhRCFv3voz3+7HpY7/3nsTVx2FmwXMX4vjjpjJbKhIPjYFPSl43XqETQhf+yh2oLQt8fCddm/om2x7afR6noDtObZzyY8hFOcAwW6V8mVvYij8rdw4wLSMC77n6u3zxekBmbsZjhePwj0LtjKcuW7XqLRc7dSlFhpGbe0rrMtrtzB4V347NEsylVfM06LccPpy+eak/mR13mMPEmldjYVDizQgV4svWImee7hRXRxba82e39+BRC48S1E/nKMaRZvp5uDvLApSGlU3E8M1o61Bcl1SHdsZY+XXElTzYyF5BUXXCvSiX8NIXeouYFtXxE7l/xOTz8MA== 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=J0zrcuPd4mY9R/L4Zs9eqA5JLpYh4Qq+f12LdA0fmIE=; b=hLA8+6RF6m7Lx8NvbZ7mnRpFBI6BQI/Ev4J0g64VwNxPpsPow3TceoQqCHu/TpuQByCLEQC//3g0BzNZwHX3AdqnWqIUBE7lhDWfIBOZZkB1BQVnMzslCRP/Eg8bTiFP8B08kd9kSoDkIGZZ7qRQcBcu8f9LAy1ZR0jxT1Sp1es= Received: from DM6PR13CA0040.namprd13.prod.outlook.com (2603:10b6:5:134::17) by DM4PR12MB5181.namprd12.prod.outlook.com (2603:10b6:5:394::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Thu, 13 Jan 2022 16:35:38 +0000 Received: from DM6NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:5:134:cafe::c2) by DM6PR13CA0040.outlook.office365.com (2603:10b6:5:134::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.2 via Frontend Transport; Thu, 13 Jan 2022 16:35:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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 DM6NAM11FT029.mail.protection.outlook.com (10.13.173.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4888.9 via Frontend Transport; Thu, 13 Jan 2022 16:35:38 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 13 Jan 2022 10:35:38 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 13 Jan 2022 10:35:37 -0600 Received: from chrome.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 13 Jan 2022 10:35:34 -0600 From: Ajit Kumar Pandey To: , Subject: [PATCH v2 5/6] ASoC: amd: acp: acp-legacy: Add DMIC dai link support for Renoir Date: Thu, 13 Jan 2022 22:03:47 +0530 Message-ID: <20220113163348.434108-6-AjitKumar.Pandey@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> References: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cb4d5506-3fc6-4fdf-4c87-08d9d6b2bb75 X-MS-TrafficTypeDiagnostic: DM4PR12MB5181:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1169; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EJow5ApciIzL9vjd8dIJj0xMmZCAbvwiE0RkWnoQhDtsfT4FJ/auJcVV4zZbZKevVYGyyEUo11ED/IZVwc1HLwOfZ0DO93bTlg96r9QHLxeZKnFBzQknumTKMoBU62nK7pij1qao1B+CGFgIwSH+Yfz9kOKcAkjoH7W985V3Ds3bFDnI02Le6cRRPxRN/wwUPGGV7Fc/OcgNPekA3crU7Ik82wEognBTKy0SR7Z9NAvIDehA7sh90s7l0H/twmz89YCQwrdQbF1YNhSRehzvNCioTU+pi0BIbfugEC/9Wa2c57bbz/VT5fPuj/z58pqo2zbe24oZtt/6kUy3gVFPI83UGj9ikgFJCHK2370786mXwkyQPrHFMHhulcYueHLjcwco/9YhVgCxD8WQ6I5dZhb7TtY41Nt+sa0ylPQwDaJKu4ExOEr9TbGPsbH43vxDISIzcH/SlBCiNS9pgbSbzKYXL1U/zfMHXdieCyzlz5/djLg465GNCvZWGHnQIgkVQB17k2Fb4ibCY+wWaK0HBwBf8lZElxPGbbJYK+ovfV9RhrzxlPvd0TSac4vZ0ptDAzZX+OPEld2APAsNePrl2dDOaZ3N8Vqgx39KXHm0jsbOMLjQ1SEbsxawbzQymbwebsW6Wn6gjVJv6ELj68tZx0KsRkPOokDcWPiwRJsjsZowM6xmSHfO69khBlvn/u3+brORRHg/BrlIHBP4Lp3bdQ8i5Njqpg7IarDJtB+pmkyVtUT5rsx7/vOAteGu2YT/+nY6TPwFJC2Fa31P8ApMEEsOOKz4Wj15K2z2JG9o5+0= 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)(40470700002)(36840700001)(46966006)(36860700001)(5660300002)(508600001)(4326008)(70586007)(36756003)(81166007)(2616005)(6666004)(336012)(47076005)(356005)(426003)(70206006)(110136005)(54906003)(186003)(40460700001)(26005)(83380400001)(2906002)(8936002)(8676002)(7696005)(86362001)(1076003)(316002)(82310400004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2022 16:35:38.6560 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb4d5506-3fc6-4fdf-4c87-08d9d6b2bb75 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: DM6NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5181 Cc: Sunil-kumar.Dommati@amd.com, Ajit Kumar Pandey , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , V sujith kumar Reddy , Vijendar.Mukunda@amd.com, Alexander.Deucher@amd.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add DMIC related dai link for pdm-dmic dai on Renoir platform with generic dmic codec dai. Signed-off-by: Ajit Kumar Pandey --- sound/soc/amd/acp/acp-legacy-mach.c | 4 ++-- sound/soc/amd/acp/acp-mach-common.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/acp/acp-legacy-mach.c b/sound/soc/amd/acp/acp-legacy-mach.c index 0ad1cf41b308..91140d15691b 100644 --- a/sound/soc/amd/acp/acp-legacy-mach.c +++ b/sound/soc/amd/acp/acp-legacy-mach.c @@ -23,10 +23,10 @@ static struct acp_card_drvdata rt5682_rt1019_data = { .hs_cpu_id = I2S_SP, .amp_cpu_id = I2S_SP, - .dmic_cpu_id = NONE, + .dmic_cpu_id = DMIC, .hs_codec_id = RT5682, .amp_codec_id = RT1019, - .dmic_codec_id = NONE, + .dmic_codec_id = DMIC, .gpio_spkr_en = EN_SPKR_GPIO_GB, }; diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index c9caade5cb74..b163e3a68166 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -438,6 +438,8 @@ SND_SOC_DAILINK_DEF(sof_sp, DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-sp"))); SND_SOC_DAILINK_DEF(sof_dmic, DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-dmic"))); +SND_SOC_DAILINK_DEF(pdm_dmic, + DAILINK_COMP_ARRAY(COMP_CPU("acp-pdm-dmic"))); int acp_sofdsp_dai_links_create(struct snd_soc_card *card) { @@ -613,6 +615,19 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card) links[i].ops = &acp_card_maxim_ops; links[i].init = acp_card_maxim_init; } + i++; + } + + if (drv_data->dmic_cpu_id == DMIC) { + links[i].name = "acp-dmic-codec"; + links[i].id = DMIC_BE_ID; + links[i].codecs = dmic_codec; + links[i].num_codecs = ARRAY_SIZE(dmic_codec); + links[i].cpus = pdm_dmic; + links[i].num_cpus = ARRAY_SIZE(pdm_dmic); + links[i].platforms = platform_component; + links[i].num_platforms = ARRAY_SIZE(platform_component); + links[i].dpcm_capture = 1; } card->dai_link = links; From patchwork Thu Jan 13 16:33:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Kumar Pandey X-Patchwork-Id: 12712916 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9419AC433EF for ; Thu, 13 Jan 2022 16:37:24 +0000 (UTC) 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 CD45C1FE7; Thu, 13 Jan 2022 17:36:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CD45C1FE7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642091842; bh=xNr9Uwot3B4ZCiOQ3YlgQ6ktffPcXuoKWFJkNUUkniE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=s4UEyPEp3p4Gk4kpnz4dNVK9C5Mw99qQTyZTx54xogHzLyB1mGGMsYASoxb1zDHFg whUaDZhrSJkn4vGLFn0JDMJNWiggxp+MWl4bpWAKtmrWoEzywYhL/d6Ap9u1UxuE17 UTqLe1F43/PsB443YUlLRTG45EFKylL8IMGF4EfI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9F5AFF8051E; Thu, 13 Jan 2022 17:35:59 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 090C9F80524; Thu, 13 Jan 2022 17:35:59 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2053.outbound.protection.outlook.com [40.107.243.53]) (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 97D8CF80520 for ; Thu, 13 Jan 2022 17:35:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 97D8CF80520 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="uE678U5F" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kRlkvRX+7CCRov8v7NSVmp0qOEFSESkeX9u+/6rgxv69IPME1Djvl9xXLT9gYkJ0YQyGOB5cRWTI0CzMl3zP6ybBLXbun8PYrMIizIV+hGA2dSgOnUKpFKkqOgYPtwP7pqiM+9x9mC6JOBgZ8+6ltbD8tB8SFvqbiAnC1YBkzA6kg7ojTzKM9p2kWj1ktGcsA7+Aj+/hHmYOkjdCJIU2UmXac3gni6tJcFehlxdXpqUeaMcw1va6iMkdRDSdMG4DOR9etWfaRScu95t7rksqyqYhHbl3Cwvmv08KsN6nqPymAFdgd1Pw7iKjNLDRfoKEECYFsFMio2AlxcCXM4+Q5A== 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=RMthq7As3IApvnsSwEpDVZShNtIoE5+Th3bp3BWlFsw=; b=jLjVJ34NaMfZgoMCF/SmU7iXrqZKru6YlKbjMO0NwOnnhZSexl2RuptTuiObmRWw5deNZfeWZw464aqHkm6skZhBKbltPAZ0OzttPhgQHXfQ26mDkCrKW9aJGDMFQwaZLWzWTCFJlUcwTv4Bp58iF0YoUbAGOC5QHajMIfjcHqnDmr9QHvjH4f/CMHA76bGeatTYR6ygUAhJ8dEFD7JaQhqqORc+p70seJStrcnYkahY4VAqOYIhpZdXgfur1nYeb08tT9LQEbV6ZSpob1CG+uy2pxDJcM7q0LkgVGZpL9MinNNN+77b5ofHTq3ifqlj5VqIDZhpOhpMmNpRA9cwLA== 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=RMthq7As3IApvnsSwEpDVZShNtIoE5+Th3bp3BWlFsw=; b=uE678U5FaESVY/j87WyKVTjIDl724nBj6dpY320g0DSj1Cy81tlNKejvoMlvsqxoD8jHTzM57J5yjkSGIB3oY3hXBGqOmhoaH0hvp/hENPdBtFGltdZ4hjPOkb3VICYzDhptAV/jTipFHVv/HLaeAaA8SUQTiLT1QSC8gmXs7HE= Received: from MW4PR03CA0292.namprd03.prod.outlook.com (2603:10b6:303:b5::27) by BYAPR12MB2679.namprd12.prod.outlook.com (2603:10b6:a03:72::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.11; Thu, 13 Jan 2022 16:35:47 +0000 Received: from CO1NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b5:cafe::39) by MW4PR03CA0292.outlook.office365.com (2603:10b6:303:b5::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.10 via Frontend Transport; Thu, 13 Jan 2022 16:35:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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 CO1NAM11FT052.mail.protection.outlook.com (10.13.174.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4888.9 via Frontend Transport; Thu, 13 Jan 2022 16:35:47 +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.2375.17; Thu, 13 Jan 2022 10:35:46 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 13 Jan 2022 10:35:45 -0600 Received: from chrome.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 13 Jan 2022 10:35:42 -0600 From: Ajit Kumar Pandey To: , Subject: [PATCH v2 6/6] ASoC: amd: renoir: Add check for acp configuration flags. Date: Thu, 13 Jan 2022 22:03:48 +0530 Message-ID: <20220113163348.434108-7-AjitKumar.Pandey@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> References: <20220113163348.434108-1-AjitKumar.Pandey@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c5a4568a-2141-4ff0-612a-08d9d6b2c08c X-MS-TrafficTypeDiagnostic: BYAPR12MB2679:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Tw6ArkgHRVw6B7Z5rILIcqpDHWQhahFUNxIEgEifo6B+y8C1272k1vSoVJ5dPG3+j2zgiP1KswaRM4qTE5/7lJSJ34RodKtkw0VkIcOpPgruRlxNTPqdrsnKDsOhaqc6XpR90qO3pWXbi24OcbqqszJqvKlVS9LClZjSmZzBCcnbeQaPOmyo1X+fi76KbrNK9zJNOUytubmOJfOVHHXD8K6+Ptfb+5iHvb/Ie8xaKVJ1BMqrMkk9ATshjCX6B9c9l0eTt9Mp/Vq8rSComXMajS3YzF101pFJ/Fgx5BROVkoqYaIGDazB+2J87yP0mYLOUX/RKIDaDIpQT54QSr12KN0UXR+NiJCA2Yi5gQed28cG/8/sFq2HvtoihPM1+PYutUZNR+BhR6QTiTqg8SG8cNdlONa6cCq8Ubpb/vTuxJDV4tS8MCiF9tSGQI9BVjWJV+DnuPFZk9nrOieuEvJQPlrWMhU0fvA+G9Ch8xqYJtFv96qR43E/bn0QZ9Mz8IR0iLWQfBoTr9fen2Xf7xs3GLbb37IpcB1I4NQ2CRahkdf9218SCXSRPR333w60Dj/TQ7R4PWlMrBn4V6D60+BTHL5lcTCEjce+0Qhe3glmtDSKavs93VDLO7otW/7et6QFFuIxKT8D1H3q6ab1hoeciKq/jjPmRcC5tdqlpQ6ElOQc633rqCRRKxEX8kitY9NqiHqVMjNziExYJqFr3pyRp/TLnsSRPm3tmvJbiSIDTjqR4sPmWd3zduWNpK7XzYMf6BCLPcdiO6ZbtlcOFfh4qOGxrPzyY4DcZHQOPHirBPs= 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)(40470700002)(508600001)(70586007)(70206006)(86362001)(8676002)(7696005)(2906002)(4326008)(83380400001)(36860700001)(2616005)(336012)(47076005)(426003)(40460700001)(36756003)(81166007)(82310400004)(186003)(26005)(54906003)(316002)(5660300002)(8936002)(1076003)(110136005)(356005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2022 16:35:47.0865 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5a4568a-2141-4ff0-612a-08d9d6b2c08c 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: CO1NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2679 Cc: Pierre-Louis Bossart , Sunil-kumar.Dommati@amd.com, Ajit Kumar Pandey , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Mario Limonciello , Vijendar.Mukunda@amd.com, Alexander.Deucher@amd.com, Mark Pearson 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" We have SOF and generic ACP support enabled for Renoir platforms on some machines. Since we have same PCI id used for probing, add check for machine configuration flag to avoid conflict with newer pci drivers. Such machine flag has been initialized via dmi match on few Chrome machines. If no flag is specified probe and register older platform device. Signed-off-by: Ajit Kumar Pandey --- sound/soc/amd/renoir/rn-pci-acp3x.c | 7 ++++++- sound/soc/amd/renoir/rn_acp3x.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/renoir/rn-pci-acp3x.c b/sound/soc/amd/renoir/rn-pci-acp3x.c index 7b8040e812a1..b3812b70f5f9 100644 --- a/sound/soc/amd/renoir/rn-pci-acp3x.c +++ b/sound/soc/amd/renoir/rn-pci-acp3x.c @@ -212,10 +212,15 @@ static int snd_rn_acp_probe(struct pci_dev *pci, acpi_integer dmic_status; #endif const struct dmi_system_id *dmi_id; - unsigned int irqflags; + unsigned int irqflags, flag; int ret, index; u32 addr; + /* Return if acp config flag is defined */ + flag = snd_amd_acp_find_config(pci); + if (flag) + return -ENODEV; + /* Renoir device check */ if (pci->revision != 0x01) return -ENODEV; diff --git a/sound/soc/amd/renoir/rn_acp3x.h b/sound/soc/amd/renoir/rn_acp3x.h index 14620399d766..ca586603d720 100644 --- a/sound/soc/amd/renoir/rn_acp3x.h +++ b/sound/soc/amd/renoir/rn_acp3x.h @@ -88,3 +88,6 @@ static inline void rn_writel(u32 val, void __iomem *base_addr) { writel(val, base_addr - ACP_PHY_BASE_ADDRESS); } + +/* Machine configuration */ +int snd_amd_acp_find_config(struct pci_dev *pci);