From patchwork Sat Oct 21 14:50:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 736704 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 3C394C001E0 for ; Sat, 21 Oct 2023 14:55:22 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DB35A868; Sat, 21 Oct 2023 16:54:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DB35A868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697900120; bh=HfhjjUo0MVccO6QlkMycTt7kDuIEvwx3AsZKmb6FW/w=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=W6w7s8i+nKdDSNJgi48HqZFMdXFENQgjpf5RDF8EpupgZ4DIdBBFSCpJghobwUhqq G1jH0IctOUAJVFykBaDNv7dkyo3TiYrTtzgeTWOY7Jh2+JbK8Z0EKD0ZY+4WYBbKr8 gBCP61CClmFL/utlb8myMgKR3wMrMHk8ETSGnzkI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id F377CF800C9; Sat, 21 Oct 2023 16:54:28 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 7F763F80166; Sat, 21 Oct 2023 16:54:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 99AB8F8027B; Sat, 21 Oct 2023 16:51:50 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on20603.outbound.protection.outlook.com [IPv6:2a01:111:f400:7ea9::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 71995F800C9 for ; Sat, 21 Oct 2023 16:51:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 71995F800C9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=vaHD8GF8 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TYHZtXNd1FMcVgTOT3o+YnSdV0hmIVFlEpPoPDM2dMrhLKkrPt6TeNPQsF0tjt1OpCtjVl8jQMFpK8zmh6fJ0r2aB7ZwkCt44I/kaEyOVxlcNK2Ail1yweRMuM4P1N28qPFaibxpiFi+Znp9rZXhEw9JBhy5jn08tf7A1r/oUa/2Mmkq42IuAkZlhyk/NWv8tQY8VGHyChkFMo5d6WCgrjLmi4bfGHwm+mkArg7LOLAkI0G+zcgT8tcaKim5fmzje3LIyDJ9ivHKlnJiCyWOwqXVTLtJNKEpsO7Ql3mItKhu9OacfPFzabCSAmBVcuefn/R9O0uGcscrbiUqF+rGKQ== 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=UUnWxhcW9fsKAipB7r/6RJXMLdyxK+qyIEVB8dgzAZY=; b=klpKNq0Bqm1wSWUf44Z75nxY3ROf4tcPwy6jJUTQXwZSJRhNudTMbbDs9kZZF9V4uZV5M5FrdFF1uJYaB2FgXw9o+kz2MZp3eIxXEdJ2/RAQJXMCrCaBkYkWAdWqun5x14hpsuOLfvDdzoYb5W0q/ri0Xm4F3iW1IuGynGVDEpydgz6HPIgH8Eis2heEAmVsKtf3TzKZNBAk9uR+D3c80wgBFARM5CLG8Jth+ak+bZP5HjBFRA9EyFjmn3g6ioni19EQh8BmCumkhuqs80PEXOSMHYu1ZJ5w+3hGhqkq09FTxbI7noF3H+U4B7fixtnNoBr3DotYJMY3NONRg7+hDg== 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=UUnWxhcW9fsKAipB7r/6RJXMLdyxK+qyIEVB8dgzAZY=; b=vaHD8GF8j6Mmg/p08J0BJpztpczEgcUw3Of1FR9deRFZXkmzr/ePxySX8qbEwbHxITTFDQMSIKds81m5GX/s6lOfwqkGSj3PGtYCJSxewcqDmInEm4AhGgM6wPdU4Uf+a1qORMUZ3ntPPKLxxXMDwIcvrFg01udFnMGHMNGtgFk= Received: from DM6PR03CA0073.namprd03.prod.outlook.com (2603:10b6:5:333::6) by BL1PR12MB5031.namprd12.prod.outlook.com (2603:10b6:208:31a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sat, 21 Oct 2023 14:51:30 +0000 Received: from DS2PEPF00003443.namprd04.prod.outlook.com (2603:10b6:5:333:cafe::a) by DM6PR03CA0073.outlook.office365.com (2603:10b6:5:333::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26 via Frontend Transport; Sat, 21 Oct 2023 14:51:30 +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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF00003443.mail.protection.outlook.com (10.167.17.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:51:30 +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.2507.27; Sat, 21 Oct 2023 09:51:30 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 21 Oct 2023 09:51:30 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:51:25 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Kuninori Morimoto , V Sujith Kumar Reddy , open list Subject: [PATCH 02/13] ASoC: amd: acp: refactor acp i2s clock generation code Date: Sat, 21 Oct 2023 20:20:43 +0530 Message-ID: <20231021145110.478744-2-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003443:EE_|BL1PR12MB5031:EE_ X-MS-Office365-Filtering-Correlation-Id: d773b436-e494-4a72-24f3-08dbd2453646 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C7JQNv2LoWF60lNlnwGM0EBUI9fTFXKMSHpP9NJizSYpHaFTDg0ONf0a2W4Quw96dNkHIwaqo4/sND9lRkfScIDQCPqoC+MvbMVbovV2iJOzG1BGSzIJRpcXjZo7CqXPMuiVKLKBQQu9O7XQF/xEUtLhJDCTSJ49n6WuTy8z65HKsdPe8Owkn/weqW3F3ZrIoxQM80hSsg+jU0RdmI2y7Ya/fOFtZKFosrN9S1fwIqLuB7nTFMHMWqSlaSJk+FZ2I9oPciQyMN+yT5ZrRBH3Ww22zTDGIaNp2CsE8/TL7wUFpSNU+thWaKdZSVEzNOGQZ6YwsjsY3P3gA6SHRgOhq4bA9mYKOPs9uIiT47mqYVNqaPWC5zTQTvYGSt29hZRf/slmnJHOJnY2UF7svoCrRQynZp/UlnCbLFAzZs8+K5NofzASKBgFPdkXAQgnsuMNUAHXzz6LtmO4m41GJtiG7t9C47ffs3miGyddyMvU3AwVRu3R9M1ehHn54O+IRHghJOZFT7yc490NGqEf7/gAr3Pgl7VlXQX7z1xU1J4gzfPeO+FNZ8sA7tOH4USPsVUROmgpY75ZY8ZYFlz4yl5aG7id+v3TJahcEethT62h70bN7PIKas5TDwPO8S5X9ZC9mFnbgsYTjzUSGWNkqwUrN5zcqV26tXwp8UO6XippUAAfGcKoxzyueQrADhBTb1GAj6uVKI/6MelLNwy/7n2eCtYk3X3YpSa6P+WA75WvvZCJnXZnGYVBwi09ldNTnpTtFrUU9gH0x0/+GnOjQe04Fg== 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:(13230031)(4636009)(396003)(346002)(376002)(136003)(39860400002)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(82310400011)(36840700001)(46966006)(40470700004)(26005)(1076003)(81166007)(2616005)(356005)(82740400003)(336012)(426003)(478600001)(6666004)(47076005)(83380400001)(54906003)(110136005)(70206006)(70586007)(316002)(7696005)(41300700001)(36860700001)(4326008)(8936002)(8676002)(5660300002)(2906002)(40480700001)(36756003)(40460700003)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:51:30.7418 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d773b436-e494-4a72-24f3-08dbd2453646 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: DS2PEPF00003443.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5031 Message-ID-Hash: NVYY62J7I6A2OMHJ7DKANYVNXHLSLBJA X-Message-ID-Hash: NVYY62J7I6A2OMHJ7DKANYVNXHLSLBJA X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Refactor acp i2s LRCLK,BCLK generation code and move to commnon file. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-i2s.c | 32 ++++++++++++++++++++++++++++++ sound/soc/amd/acp/amd.h | 39 ------------------------------------- 2 files changed, 32 insertions(+), 39 deletions(-) diff --git a/sound/soc/amd/acp/acp-i2s.c b/sound/soc/amd/acp/acp-i2s.c index df350014966a..59d3a499771a 100644 --- a/sound/soc/amd/acp/acp-i2s.c +++ b/sound/soc/amd/acp/acp-i2s.c @@ -20,10 +20,42 @@ #include #include #include +#include #include "amd.h" #define DRV_NAME "acp_i2s_playcap" +#define I2S_MASTER_MODE_ENABLE 1 +#define I2S_MODE_ENABLE 0 +#define I2S_FORMAT_MODE GENMASK(1, 1) +#define LRCLK_DIV_FIELD GENMASK(10, 2) +#define BCLK_DIV_FIELD GENMASK(23, 11) + +static inline void acp_set_i2s_clk(struct acp_dev_data *adata, int dai_id) +{ + u32 i2s_clk_reg, val; + + switch (dai_id) { + case I2S_SP_INSTANCE: + i2s_clk_reg = ACP_I2STDM0_MSTRCLKGEN; + break; + case I2S_BT_INSTANCE: + i2s_clk_reg = ACP_I2STDM1_MSTRCLKGEN; + break; + case I2S_HS_INSTANCE: + i2s_clk_reg = ACP_I2STDM2_MSTRCLKGEN; + break; + default: + i2s_clk_reg = ACP_I2STDM0_MSTRCLKGEN; + break; + } + + val = I2S_MASTER_MODE_ENABLE; + val |= I2S_MODE_ENABLE & BIT(1); + val |= FIELD_PREP(LRCLK_DIV_FIELD, adata->lrclk_div); + val |= FIELD_PREP(BCLK_DIV_FIELD, adata->bclk_div); + writel(val, adata->acp_base + i2s_clk_reg); +} static int acp_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 487eefa5985f..87d1e1f7d6b6 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -188,17 +188,6 @@ struct acp_dev_data { u32 xfer_rx_resolution[3]; }; -union acp_i2stdm_mstrclkgen { - struct { - u32 i2stdm_master_mode : 1; - u32 i2stdm_format_mode : 1; - u32 i2stdm_lrclk_div_val : 9; - u32 i2stdm_bclk_div_val : 11; - u32:10; - } bitfields, bits; - u32 u32_all; -}; - extern const struct snd_soc_dai_ops asoc_acp_cpu_dai_ops; extern const struct snd_soc_dai_ops acp_dmic_dai_ops; @@ -276,32 +265,4 @@ static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int POINTER_RETURN_BYTES: return byte_count; } - -static inline void acp_set_i2s_clk(struct acp_dev_data *adata, int dai_id) -{ - union acp_i2stdm_mstrclkgen mclkgen; - u32 master_reg; - - switch (dai_id) { - case I2S_SP_INSTANCE: - master_reg = ACP_I2STDM0_MSTRCLKGEN; - break; - case I2S_BT_INSTANCE: - master_reg = ACP_I2STDM1_MSTRCLKGEN; - break; - case I2S_HS_INSTANCE: - master_reg = ACP_I2STDM2_MSTRCLKGEN; - break; - default: - master_reg = ACP_I2STDM0_MSTRCLKGEN; - break; - } - - mclkgen.bits.i2stdm_master_mode = 0x1; - mclkgen.bits.i2stdm_format_mode = 0x00; - - mclkgen.bits.i2stdm_bclk_div_val = adata->bclk_div; - mclkgen.bits.i2stdm_lrclk_div_val = adata->lrclk_div; - writel(mclkgen.u32_all, adata->acp_base + master_reg); -} #endif From patchwork Sat Oct 21 14:50:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 736703 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 A75FBC001E0 for ; Sat, 21 Oct 2023 14:56:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BF2A0BC0; Sat, 21 Oct 2023 16:55:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BF2A0BC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697900161; bh=A+X+grLWv324sCfSNPrLZFNxqQD5dESV+sbHmJDIp1M=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=mD5z2X+lQxHkie0mj63vnQKcUtc/lps9FlxrOhb0XYoxkOx/ujBA3CN8C86IUUMe4 YGw0UvyQx4Y8EV4r9evlX83cejj8/Q98D4ycaFTNhbdJZKH3pxSejfBbRmFW4C4Lro bpWO0wZ1SV3xU9t0dj6ZQ/XXm3WQlxp0zigwxXzg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4949EF8057F; Sat, 21 Oct 2023 16:54:33 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C62CAF8056F; Sat, 21 Oct 2023 16:54:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D6D74F8055B; Sat, 21 Oct 2023 16:51:56 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on20607.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eb2::607]) (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 586BFF80166 for ; Sat, 21 Oct 2023 16:51:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 586BFF80166 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=YdfhmYLv ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BdRGiIn6g3c8t8jvCp1pRzHWN7U0nAESiI0/uizwUz0XyKQbcu5zN5H0me/xzk2Dvx7iTpZdIXnx8fVgbfaifh/x6lo1NDhwJM1bBtzt+q1n8YMa0MrD9CUckUFgr0Zc+CSGvUGD7O9mLmuecw4e1GwCbGSmXjRRVd6NhTgMSal/J1Ud7VCtAucvk6sgxxstg6m/daoTxx2yNPczTJCK1b/wRJKMnstXD6nzx9K5AZgQCQIKKKqGtgL4LkAZrXttzCv8InBKsNKXlGTVDArrMGddMct+Etghodlv3OE/qDTmvOYbDb4zF68hb8bHcr10cU8ueFq3Pt3w35nwvO3FAQ== 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=bAG39eZ1BVdDuYUo95xzfJdqnqe77LBQtVNF2w05y5o=; b=UOrqbhqYh+l7kvHz4R6RFfRMzLeh1pkRK3J+x2XaKnVrJQdKMP5lkRb5Q8jnA26dsa91iB9NSvtMyc2jQdZhgDtCr3Td0Hs6+Vd94mhHJU5mp/UnAjDhXWW57PZgsTWkI1iQ4Q+MvM2hBM48tvHJyVtGmiqOs9bE7Jf99gYOLZPSaXjJg9QhXCNe89rkSaoYWtI3+s2TYt67vix9GxmYywLQwUkECOoJ7pseh9sEWEnPVuw1oD7UcrSrcIjzczThRvrmMB4fxfDNEvcm7UqPEhMdkcESJVyH8MJ3NXDnSX5/ZuvV+krjqZIw/R41wJsYNzepItbVkpD+ijEWLKKpdw== 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=bAG39eZ1BVdDuYUo95xzfJdqnqe77LBQtVNF2w05y5o=; b=YdfhmYLv2B6AcHZhi4bXMLuU/1N+DA4CdcJFXwrRtIFV0jTYv/SIWSyRQZu9bZmqEki6oQp5CpBJIxfpnLagf/2A+ivIDF+ffN8OV54vdTHIcyxxE7V5gLkApr+/qYCIpgIvf9u3c2OVRKAb9OvUzsGZSjFndPK9jB+poaPv+O8= Received: from SA0PR11CA0168.namprd11.prod.outlook.com (2603:10b6:806:1bb::23) by SN7PR12MB7024.namprd12.prod.outlook.com (2603:10b6:806:26e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Sat, 21 Oct 2023 14:51:45 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:806:1bb:cafe::a4) by SA0PR11CA0168.outlook.office365.com (2603:10b6:806:1bb::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31 via Frontend Transport; Sat, 21 Oct 2023 14:51:45 +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; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6933.15 via Frontend Transport; Sat, 21 Oct 2023 14:51:44 +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.2507.27; Sat, 21 Oct 2023 09:51:44 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 21 Oct 2023 09:51:44 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:51:39 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Alper Nebi Yasak , Kuninori Morimoto , Marian Postevca , open list Subject: [PATCH 04/13] ASoC: amd: acp: add machine driver support for acp6.3 platform Date: Sat, 21 Oct 2023 20:20:45 +0530 Message-ID: <20231021145110.478744-4-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|SN7PR12MB7024:EE_ X-MS-Office365-Filtering-Correlation-Id: c9552501-e94c-43b1-0091-08dbd2453ea4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qie3VoTBsrbFjpKOsjl55hi8DqczYHTYp2q7dpX1vej0WakSHQQa4w0rtICww4gUEoSInzY+DscDOKZv+GenEbJVHNN6ZLhJuQcyXF8athG6E08/pLt5Nv8yBzTuXosez/9WbY2iSVNlK6fK98pn8e/AZebL2NBSB8CS7mtsvyXNW+cKIc2s66kbkFZo2HKbN9UFIDSRDVh1YXf6a/14J0n5pkFCWS8SsmyCn9ZsHGnIzQGYy0V5VYEXXTB2Ptq/R/lyXc3xt1IzqNju3JaD5Rqq3yWLe/ijOiq8NkwFRjBs3fMhwopt83MGu7Oz6lF3ioQdndVI5lO2KAZAUTmPd1u5o1ZGhzWmCyHyCGW3PwQmGXciJlL/Z1ckehf105KO4ksGNacqlTBxVEzD80g7JGX8D8E8kLrM5HTcA/HuSbcbELEScggHXGi4vCkOh1zpAGx/P/Q55r6MyWeWG1qEup6i/lwM09vs52bIInu+9pDPfOs6fmflcwLQBduMExlO7pDdR7x1S0TJTpYQnvlBkBXb3TgTQnL0TSbO350eTS6s9PLsDI50G3WbO/DAnVlGaVBGVGf8vBs3rdLPkqa0g2SdEYinhzMV89z2MOKrjTWZH6874BRJecpHnDhUK+cObKSdziQuhpd1m5glkSkkASSDhS2oBOWf/vWXMGJCosW9ygiEGCYNXV7SdT6w/BxrVN1yxm6aNKpqjLxysu/rR2OAfxQ0/wgeatjKx9u3NINJhFb3vvrApVx8xki2txKYba6u2dSRNaK6osC1ZZ6M7A== 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:(13230031)(4636009)(396003)(346002)(39860400002)(376002)(136003)(230922051799003)(1800799009)(186009)(451199024)(82310400011)(64100799003)(40470700004)(46966006)(36840700001)(81166007)(356005)(82740400003)(1076003)(2616005)(6666004)(26005)(70586007)(54906003)(316002)(70206006)(336012)(426003)(7696005)(478600001)(36860700001)(4326008)(8936002)(5660300002)(86362001)(41300700001)(40460700003)(47076005)(110136005)(40480700001)(8676002)(2906002)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:51:44.7943 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9552501-e94c-43b1-0091-08dbd2453ea4 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: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7024 Message-ID-Hash: NCY3MSJ46M347LT36C4STFNYUBTJSLDT X-Message-ID-Hash: NCY3MSJ46M347LT36C4STFNYUBTJSLDT X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: add legacy machine driver support for acp6.3 based platform. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-mach-common.c | 15 +++++++++++++++ sound/soc/amd/acp/acp-mach.h | 1 + 2 files changed, 16 insertions(+) diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index 9def77bfc608..88e91af47532 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -1260,6 +1260,12 @@ static struct snd_soc_dai_link_component platform_rmb_component[] = { } }; +static struct snd_soc_dai_link_component platform_acp63_component[] = { + { + .name = "acp_asoc_acp63.0", + } +}; + static struct snd_soc_dai_link_component sof_component[] = { { .name = "0000:04:00.5", @@ -1570,6 +1576,9 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card) if (drv_data->platform == REMBRANDT) { links[i].platforms = platform_rmb_component; links[i].num_platforms = ARRAY_SIZE(platform_rmb_component); + } else if (drv_data->platform == ACP63) { + links[i].platforms = platform_acp63_component; + links[i].num_platforms = ARRAY_SIZE(platform_acp63_component); } else { links[i].platforms = platform_component; links[i].num_platforms = ARRAY_SIZE(platform_component); @@ -1634,6 +1643,9 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card) if (drv_data->platform == REMBRANDT) { links[i].platforms = platform_rmb_component; links[i].num_platforms = ARRAY_SIZE(platform_rmb_component); + } else if (drv_data->platform == ACP63) { + links[i].platforms = platform_acp63_component; + links[i].num_platforms = ARRAY_SIZE(platform_acp63_component); } else { links[i].platforms = platform_component; links[i].num_platforms = ARRAY_SIZE(platform_component); @@ -1677,6 +1689,9 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card) if (drv_data->platform == REMBRANDT) { links[i].platforms = platform_rmb_component; links[i].num_platforms = ARRAY_SIZE(platform_rmb_component); + } else if (drv_data->platform == ACP63) { + links[i].platforms = platform_acp63_component; + links[i].num_platforms = ARRAY_SIZE(platform_acp63_component); } else { links[i].platforms = platform_component; links[i].num_platforms = ARRAY_SIZE(platform_component); diff --git a/sound/soc/amd/acp/acp-mach.h b/sound/soc/amd/acp/acp-mach.h index b0a3f6bd172f..69db61f12eca 100644 --- a/sound/soc/amd/acp/acp-mach.h +++ b/sound/soc/amd/acp/acp-mach.h @@ -53,6 +53,7 @@ enum codec_endpoints { enum platform_end_point { RENOIR = 0, REMBRANDT, + ACP63, }; struct acp_mach_ops { From patchwork Sat Oct 21 14:50:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 736702 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 1A0FEC004C0 for ; Sat, 21 Oct 2023 14:56:33 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3A786AE8; Sat, 21 Oct 2023 16:55:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3A786AE8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697900191; bh=SPYFAtyE4ZcFadfL1EsciIDpVGfjZg/s9IyIeVDKZ3Y=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=oXPmjftL+iYpuyrBW4a8KjH1NRc3tUtKAPjm1wJDYPMmRGDFb6dkobpOvi78GE5EM luB0ZWN81CEOQNAX6c3qnZYZUTIAjAEh9vVx6iXOMQtayBainQfobVqBrREdUcpXiQ LULU+1MNP3ZRh560TVzV3/zfUJ20REMreOSjtC08= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 68C9FF805A9; Sat, 21 Oct 2023 16:54:37 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id BE402F805A9; Sat, 21 Oct 2023 16:54:36 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F2565F8055A; Sat, 21 Oct 2023 16:52:23 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::601]) (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 2BE15F800C9 for ; Sat, 21 Oct 2023 16:52:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2BE15F800C9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=t8VOTDZZ ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YC8nGSgsNeAnZMhVn6MVuZ+tSil2xet8Mc8yyZHnQyDQ5hhpAAF6BnEysuwIgc2C/SLiS1uVaTM+iQCWQroTKJbMtGMs9hETPFnhkaQkntgBwmvatB8dszWVB4IOoD82sVAcIPVoHYj+Bl6HCFDqucya+8D98wbTUmoewaMoFDWH/06N9zHt1avLMw3uXfM2GyD/Tps0ECB9eIA1WsmL1p2hI5xIBm+noMvsfFS07TK8/PFSj6Q67lgDV0Jq9nXIpW/h9P7dsAASY/AiVDc2Pa7Jte6U9nbGu1QaMzECiXPnL36ud1Qc9NJ1Yx+7MYXy8N9UjFu34V3jLsHHrTDF8Q== 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=7h/y0H64UH3ieCAT4vktmaqn7AZKS+4IvoIzH5wPbb4=; b=K5XOb1mpqBekxGTcTta+bbGVnbXXG6jdL44A3SE/o27P0KmyRG6kVW3kqLffKpy2m6/Rblpflfu2bV1OTWJwvqiXFJyvlHhSTCdZhBo0JxSjLoyYWSVrCOQ+rHHWk21d6xTyzgk48uae4qRSE41oPBrf30nmIlXl6+95IOGdzr76d8FUgww0PWbLG2wJCuwhoFSGKZcLYrFa09Evr+t56mXGSem3rr/Jvc8J4v15OZXBHKN6rRUZqM0iLQASaNW5Ne6ec/3ov67rXZP9Yy0gMTjJ+2WGudJH7qr41y5QFNKY4jOBwQ6mbCbbI8eXdFU+2cFLwxt0PMoiSAnHukZroA== 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=7h/y0H64UH3ieCAT4vktmaqn7AZKS+4IvoIzH5wPbb4=; b=t8VOTDZZnUBNzhq7Q6tN4e+WqrimpLZNV3bJL6QS/WaEDxyYUlp+Gi4Z+viN1uZaZi3Vcuy4dAJS1DT/uqRk+kQPbNRmHh49BnFuxmD5GXK+I0soFrSqBxIy0Ouro/gRDZiMFsR8s8qauCiticETtrUyfmIFubRA7n6pUCQyyNk= Received: from DM6PR13CA0064.namprd13.prod.outlook.com (2603:10b6:5:134::41) by PH7PR12MB8427.namprd12.prod.outlook.com (2603:10b6:510:242::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sat, 21 Oct 2023 14:52:05 +0000 Received: from DS2PEPF00003448.namprd04.prod.outlook.com (2603:10b6:5:134:cafe::16) by DM6PR13CA0064.outlook.office365.com (2603:10b6:5:134::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.7 via Frontend Transport; Sat, 21 Oct 2023 14:52:05 +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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF00003448.mail.protection.outlook.com (10.167.17.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:52:05 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 21 Oct 2023 09:52:04 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:51:59 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , V Sujith Kumar Reddy , Kuninori Morimoto , Claudiu Beznea , Jarkko Nikula , open list Subject: [PATCH 06/13] ASoC: amd: acp: add code for scanning acp pdm controller Date: Sat, 21 Oct 2023 20:20:47 +0530 Message-ID: <20231021145110.478744-6-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003448:EE_|PH7PR12MB8427:EE_ X-MS-Office365-Filtering-Correlation-Id: 95a7c156-7fd0-4526-2407-08dbd2454b05 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5e49GLamlP4bbvIaYfbISnprH3Y7ZaSTsYAoAd1cDK5DLX85Ncdi2x3/0ObHZeus+Ko+kHOb14VIN4p+/diMHSunNtlK37X2zbJiY/L9JW9HOpN768ckeCShIjUqQ1fGv8i4GS8acfbdNgREogwXVnAIgRxmC+2lq/4Ew8eYPVWfYfODJ/i2iVbDk77vBIHdeKzuiCG3VTKoVmvPzrtceXK4B0Z19ckxmHZy3dt0oA73WUf/ISc+XLAzF0j55WyBB4S1Xxhq1AG5GGXSFfJOIyWpzmjlk9U2twVWROgZx2YmtJ53vZ4d3/u8AZwmoWeYITd8f7h/qxw9xzcbMdgJemBSDX4ricBDjZmxYJuMU2NpNsbDHP8Phkg5IqbEbVTmIohGwEb5OSNjcYm9uqcD4lgs4CNwB2N12Qbt3Ij9c6FmISqIoxxt7m7Ex/VZauVRLrBM0Wbggj6paGdknjyP8o1ps/2299GvRugO22q8bQFJ0wq2mYzbuU3T8I0XA2FaE7vIXHDK5N/6MJUWu6M79vRuAq1Xbes5Jmn4rvc2hxGVC4YGWPfYxBa7a3Sqz3I/s3jixX6CCrMVCGSm53eF1D0yfeRzN/5GUxIZHYvCZ/6VXtJBGpqtvyVNMZ1XhqN+KXUoWdzRvTuDZbxFFTC33uBdmIXNtN+eDf0lWN5QHAU3Z3HXIYAPhl5lN97GBDntYAettt/Y+AqQALU2JcUZfSLUslsoWGFFDD7pdOlnnyQWR9C2tYEMV0famcTwdssUqCI1MLsqO55XD/Eru4RIrg== 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:(13230031)(4636009)(39860400002)(396003)(136003)(346002)(376002)(230922051799003)(64100799003)(82310400011)(186009)(1800799009)(451199024)(46966006)(36840700001)(40470700004)(83380400001)(36860700001)(47076005)(336012)(1076003)(426003)(26005)(2616005)(7696005)(6666004)(356005)(86362001)(36756003)(82740400003)(81166007)(40460700003)(41300700001)(4326008)(8936002)(8676002)(478600001)(5660300002)(40480700001)(2906002)(70206006)(54906003)(110136005)(70586007)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:52:05.5480 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95a7c156-7fd0-4526-2407-08dbd2454b05 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: DS2PEPF00003448.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8427 Message-ID-Hash: USBBQ4KXAN6BYZTT6YFLIMUHWXRGJDOL X-Message-ID-Hash: USBBQ4KXAN6BYZTT6YFLIMUHWXRGJDOL X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add common code for scanning acp pdm controller and create platform device for the same. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-legacy-common.c | 52 +++++++++++++++++++++++++++ sound/soc/amd/acp/acp-pci.c | 11 +++++- sound/soc/amd/acp/amd.h | 22 ++++++++++++ sound/soc/amd/acp/chip_offset_byte.h | 1 + sound/soc/amd/mach-config.h | 1 + 5 files changed, 86 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index e16ef94e6336..af85a153a770 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -16,6 +16,10 @@ #include #include +#define ACP_RENOIR_PDM_ADDR 0x02 +#define ACP_REMBRANDT_PDM_ADDR 0x03 +#define ACP63_PDM_ADDR 0x02 + void acp_enable_interrupts(struct acp_dev_data *adata) { struct acp_resource *rsrc = adata->rsrc; @@ -348,4 +352,52 @@ int smn_read(struct pci_dev *dev, u32 smn_addr) } EXPORT_SYMBOL_NS_GPL(smn_read, SND_SOC_ACP_COMMON); +int check_acp_pdm(struct pci_dev *pci, struct acp_chip_info *chip) +{ + struct acpi_device *pdm_dev; + const union acpi_object *obj; + u32 pdm_addr, val; + + val = readl(chip->base + ACP_PIN_CONFIG); + switch (val) { + case ACP_CONFIG_4: + case ACP_CONFIG_5: + case ACP_CONFIG_6: + case ACP_CONFIG_7: + case ACP_CONFIG_8: + case ACP_CONFIG_10: + case ACP_CONFIG_11: + case ACP_CONFIG_12: + case ACP_CONFIG_13: + case ACP_CONFIG_14: + break; + default: + return -EINVAL; + } + + switch (chip->acp_rev) { + case ACP3X_DEV: + pdm_addr = ACP_RENOIR_PDM_ADDR; + break; + case ACP6X_DEV: + pdm_addr = ACP_REMBRANDT_PDM_ADDR; + break; + case ACP63_DEV: + pdm_addr = ACP63_PDM_ADDR; + break; + default: + return -EINVAL; + } + + pdm_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), pdm_addr, 0); + if (pdm_dev) { + if (!acpi_dev_get_property(pdm_dev, "acp-audio-device-type", + ACPI_TYPE_INTEGER, &obj) && + obj->integer.value == pdm_addr) + return 0; + } + return -ENODEV; +} +EXPORT_SYMBOL_NS_GPL(check_acp_pdm, SND_SOC_ACP_COMMON); + MODULE_LICENSE("Dual BSD/GPL"); diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index d7fc4a0e9245..bbf079d47dc4 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -55,7 +55,7 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id int ret; flag = snd_amd_acp_find_config(pci); - if (flag != FLAG_AMD_LEGACY) + if (flag != FLAG_AMD_LEGACY && flag != FLAG_AMD_LEGACY_ONLY_DMIC) return -ENODEV; chip = devm_kzalloc(&pci->dev, sizeof(*chip), GFP_KERNEL); @@ -129,6 +129,13 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id } } + if (flag == FLAG_AMD_LEGACY_ONLY_DMIC) { + ret = check_acp_pdm(pci, chip); + if (ret < 0) + goto skip_pdev_creation; + } + + chip->flag = flag; memset(&pdevinfo, 0, sizeof(pdevinfo)); pdevinfo.name = chip->name; @@ -145,6 +152,8 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id ret = PTR_ERR(pdev); goto unregister_dmic_dev; } + +skip_pdev_creation: chip->chip_pdev = pdev; dev_set_drvdata(&pci->dev, chip); pm_runtime_set_autosuspend_delay(&pci->dev, 2000); diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 87d1e1f7d6b6..2ffe1effc6b5 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -133,6 +133,7 @@ struct acp_chip_info { unsigned int acp_rev; /* ACP Revision id */ void __iomem *base; /* ACP memory PCI base */ struct platform_device *chip_pdev; + unsigned int flag; /* Distinguish b/w Legacy or Only PDM */ }; struct acp_stream { @@ -188,6 +189,25 @@ struct acp_dev_data { u32 xfer_rx_resolution[3]; }; +enum acp_config { + ACP_CONFIG_0 = 0, + ACP_CONFIG_1, + ACP_CONFIG_2, + ACP_CONFIG_3, + ACP_CONFIG_4, + ACP_CONFIG_5, + ACP_CONFIG_6, + ACP_CONFIG_7, + ACP_CONFIG_8, + ACP_CONFIG_9, + ACP_CONFIG_10, + ACP_CONFIG_11, + ACP_CONFIG_12, + ACP_CONFIG_13, + ACP_CONFIG_14, + ACP_CONFIG_15, +}; + extern const struct snd_soc_dai_ops asoc_acp_cpu_dai_ops; extern const struct snd_soc_dai_ops acp_dmic_dai_ops; @@ -214,6 +234,8 @@ void restore_acp_pdm_params(struct snd_pcm_substream *substream, int restore_acp_i2s_params(struct snd_pcm_substream *substream, struct acp_dev_data *adata, struct acp_stream *stream); +int check_acp_pdm(struct pci_dev *pci, struct acp_chip_info *chip); + static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int direction) { u64 byte_count = 0, low = 0, high = 0; diff --git a/sound/soc/amd/acp/chip_offset_byte.h b/sound/soc/amd/acp/chip_offset_byte.h index ce3948e0679c..cfd6c4d07594 100644 --- a/sound/soc/amd/acp/chip_offset_byte.h +++ b/sound/soc/amd/acp/chip_offset_byte.h @@ -19,6 +19,7 @@ #define ACP_PGFSM_STATUS 0x1420 #define ACP_SOFT_RESET 0x1000 #define ACP_CONTROL 0x1004 +#define ACP_PIN_CONFIG 0x1440 #define ACP_EXTERNAL_INTR_REG_ADDR(adata, offset, ctrl) \ (adata->acp_base + adata->rsrc->irq_reg_offset + offset + (ctrl * 0x04)) diff --git a/sound/soc/amd/mach-config.h b/sound/soc/amd/mach-config.h index d392e6d6e6e1..e6b520459164 100644 --- a/sound/soc/amd/mach-config.h +++ b/sound/soc/amd/mach-config.h @@ -15,6 +15,7 @@ #define FLAG_AMD_SOF BIT(1) #define FLAG_AMD_SOF_ONLY_DMIC BIT(2) #define FLAG_AMD_LEGACY BIT(3) +#define FLAG_AMD_LEGACY_ONLY_DMIC BIT(4) #define ACP_PCI_DEV_ID 0x15E2 From patchwork Sat Oct 21 14:50:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 736701 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 DB581C004C0 for ; Sat, 21 Oct 2023 14:56:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1A930E0E; Sat, 21 Oct 2023 16:56:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1A930E0E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697900218; bh=eAsNThPHjNWeY7hljaaLWiqK7xGAPMjwoeIYssgEKkM=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=rpRBLytKw3zDU7lfx6MvwgbA13pIVO1aI8XvxZ0u9orPHKFc7RVPQZHSpP2cVZiRy zdtREHvauu44R0vjRj8FAl99RhouDdXfWkgJrUag+HH553KyHLhf1HLnAw10vlb3Qs J4kQhq5oIK/nbhKylEOup7A4RsigL3/cWRhVKlA8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 16B07F805BD; Sat, 21 Oct 2023 16:54:41 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 997CFF805BF; Sat, 21 Oct 2023 16:54:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E19EFF8027B; Sat, 21 Oct 2023 16:52:42 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on20607.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e83::607]) (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 20020F80166 for ; Sat, 21 Oct 2023 16:52:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 20020F80166 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=mF+CYNEI ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kcSYF1ZrH+DA7PT6LDQEnXIaffmKWK5k9jUgSHyHxQRrBKR8axraHICwJY/FqbB8F8XlGTLDkyKgdv6qUgcSBrVbuDE9IHkm+6pRQhJz61XoEWJb7HagwxcDOuIoMI26kzIUTsccIP8p9Y6jCjIXy3WCZBT5HutAzPlSUC6vpedqE5DRL3jXevuKR6V3pt5DJWU8vnCGxY07z6IEfOODEsgo78KyM6ZZ+DzDatpyqmr8U7SwtXevXWyfhzPMKWrUfHZYlcLYNgSieXS033dmG2EjDydp6Jop1bIPLA3sqi7Sw9pzhVJEo8Sli9N5k7zxXCOonBd79r4IRtV2bFZtTw== 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=lCfG35GUU9rE7pOjCv/q44Xh+EfGOT7Kukj6QeTuhCQ=; b=MSQZVG+3jOlvfhUT4UsbYdSg5jCAYzwuJyMTlF3P9jUZfKynh4+xeKZORQDLvfkYK0lf3eJ9dcruAKS8zVPeKFxqgJ+FntHPO9G8U1WpY4SnczVs+iD4QqIqp9s1sL/rUItwMUrE28FXTT9KZq1qlZobvpJxnWRJkwrk9D56I13Aw/XcowA962k8RHIRyTv0RgseYOcMVDJHBANbDNPSt0374fsfBCvNcrgex+MjwFv9kOlOT6VnTzYwbmqF5/P/NQSwtxXRKtXpPTF/W9Egavgo/sgrQ8LETEDZ2mcWbJs4OrVIuu84qXv8/dmmRasvISGVLR3nMFKtMXDeUCSb1Q== 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=lCfG35GUU9rE7pOjCv/q44Xh+EfGOT7Kukj6QeTuhCQ=; b=mF+CYNEI2s7TD3yBNaES6lOEpb8WzkY1ApqaJRY1t+dKsjsKYbqofp9fNKgA+8MI4TsFggGdJqEAdJa3EYIHS1vUyB0l/KhqNAFoIyn42lmNVbM3Zr5DF13jeK3IaLfi6Jq5Rhld7LXiK+4sBxk/DL/rMQ2AdCPKPnS9EdMO+Sg= Received: from CH2PR08CA0003.namprd08.prod.outlook.com (2603:10b6:610:5a::13) by BL1PR12MB5239.namprd12.prod.outlook.com (2603:10b6:208:315::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sat, 21 Oct 2023 14:52:31 +0000 Received: from DS2PEPF00003442.namprd04.prod.outlook.com (2603:10b6:610:5a:cafe::b8) by CH2PR08CA0003.outlook.office365.com (2603:10b6:610:5a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29 via Frontend Transport; Sat, 21 Oct 2023 14:52:31 +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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF00003442.mail.protection.outlook.com (10.167.17.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.21 via Frontend Transport; Sat, 21 Oct 2023 14:52:31 +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.2507.27; Sat, 21 Oct 2023 09:52:30 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 21 Oct 2023 09:52:30 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:52:25 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Nicolas Ferre , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Kuninori Morimoto , Yang Li , Dan Carpenter , open list Subject: [PATCH 08/13] ASoC: amd: acp: add condition check for i2s clock generation Date: Sat, 21 Oct 2023 20:20:49 +0530 Message-ID: <20231021145110.478744-8-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003442:EE_|BL1PR12MB5239:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a61db00-820a-401c-7498-08dbd2455a50 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BaCvimpujZ496Hclyw7s/yfRYHEIYKw4m+N88pa5qicIkhYF5f/yRuQ97wBJVt/oaUsGnZehu8sMDug/l4vft19txBEPvOBttah5Qia9YU9dnlje4a3nZfgcPJn9PDxPvCsXu+fHnjWI8DxSH9Ra08bqToHRLDKNuus4GwCU1k7winnPZNAjhS4YU5SaXGj7+BSzADXMjhROJ3Dm7MmIPsd51j3/WoZKTgrSQ6AWIO36YxIdQdFcRV6EJSeYRnX2+F2rNRqNqjtbgPqiF0dPn+dynBZZtRI4eiN8aWcus0N5/TXc0d8INn6R935TYS2HOvQDcFXqV4Uo4859su2LA1lxg4ys7tUkjvEQVtKphtfeLDC57iWahjbgY2kqKOE69G9U4jfhtQPrVWkMOe60oBF8ykbhtLD4ZMEEaLvXVuzvegC3tIDDezRPUg3OHjzxCcJLrJWagnETcsWPB728thG1Nz9Swzs7ZLOPIdtDPLT0IlM3k8wmDx+/Sl3YSibFpE1BTDekl52nOUgkrd1xkir/4SZ5BovoCe6vXYgdCB6ErNHJxymwiUOJMkV9q5bvp8vAQ2j1SHWIrsM1Ni0RzF31w4xz+Moplp/91BPMHqS2d/NSMs0ccwiM39hPBjZ6rD1OirTGq7fq9XxtMGHlYrsOJfFo/G4PACDYqT0gspcLGW4yCoughigdPKgaDEgeYdjDZb8JwZXGclu50LFk1SczMWMJb1YCraDKWMqttUAQ0vLHX65x6EGf4IIX9NhTw9mXRzLLtH7gbctCDUJ0Yg== 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:(13230031)(4636009)(346002)(396003)(376002)(39860400002)(136003)(230922051799003)(451199024)(186009)(82310400011)(64100799003)(1800799009)(40470700004)(46966006)(36840700001)(40480700001)(36756003)(40460700003)(316002)(110136005)(70206006)(54906003)(70586007)(86362001)(356005)(81166007)(82740400003)(36860700001)(83380400001)(2616005)(26005)(426003)(1076003)(336012)(7696005)(6666004)(2906002)(478600001)(41300700001)(5660300002)(8936002)(47076005)(4326008)(8676002)(7416002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:52:31.2074 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a61db00-820a-401c-7498-08dbd2455a50 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: DS2PEPF00003442.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5239 Message-ID-Hash: 2PZIGD2462QS73NOLPB64G5TOY7LS67G X-Message-ID-Hash: 2PZIGD2462QS73NOLPB64G5TOY7LS67G X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: for only PDM endpoint i2s master clock is not required. Add a condition check for the same based on chip flag value. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-rembrandt.c | 12 ++++++++++-- sound/soc/amd/acp/acp63.c | 12 ++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c index ef5fe6438efd..158f819f8da4 100644 --- a/sound/soc/amd/acp/acp-rembrandt.c +++ b/sound/soc/amd/acp/acp-rembrandt.c @@ -191,6 +191,7 @@ static int rembrandt_audio_probe(struct platform_device *pdev) struct acp_chip_info *chip; struct acp_dev_data *adata; struct resource *res; + u32 ret; chip = dev_get_platdata(&pdev->dev); if (!chip || !chip->base) { @@ -234,7 +235,12 @@ static int rembrandt_audio_probe(struct platform_device *pdev) acp_machine_select(adata); dev_set_drvdata(dev, adata); - acp6x_master_clock_generate(dev); + + if (chip->flag != FLAG_AMD_LEGACY_ONLY_DMIC) { + ret = acp6x_master_clock_generate(dev); + if (ret) + return ret; + } acp_enable_interrupts(adata); acp_platform_register(dev); pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); @@ -263,7 +269,9 @@ static int __maybe_unused rmb_pcm_resume(struct device *dev) snd_pcm_uframes_t buf_in_frames; u64 buf_size; - acp6x_master_clock_generate(dev); + if (adata->flag != FLAG_AMD_LEGACY_ONLY_DMIC) + acp6x_master_clock_generate(dev); + spin_lock(&adata->acp_lock); list_for_each_entry(stream, &adata->stream_list, list) { substream = stream->substream; diff --git a/sound/soc/amd/acp/acp63.c b/sound/soc/amd/acp/acp63.c index 0cec6ecaadfa..b871a216a6af 100644 --- a/sound/soc/amd/acp/acp63.c +++ b/sound/soc/amd/acp/acp63.c @@ -244,10 +244,12 @@ static int acp63_audio_probe(struct platform_device *pdev) adata->machines = snd_soc_acpi_amd_acp63_acp_machines; acp_machine_select(adata); dev_set_drvdata(dev, adata); - ret = acp63_i2s_master_clock_generate(adata); - if (ret) - return ret; + if (chip->flag != FLAG_AMD_LEGACY_ONLY_DMIC) { + ret = acp63_i2s_master_clock_generate(adata); + if (ret) + return ret; + } acp_enable_interrupts(adata); acp_platform_register(dev); pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); @@ -276,7 +278,9 @@ static int __maybe_unused acp63_pcm_resume(struct device *dev) snd_pcm_uframes_t buf_in_frames; u64 buf_size; - acp63_i2s_master_clock_generate(adata); + if (adata->flag != FLAG_AMD_LEGACY_ONLY_DMIC) + acp63_i2s_master_clock_generate(adata); + spin_lock(&adata->acp_lock); list_for_each_entry(stream, &adata->stream_list, list) { if (stream) { From patchwork Sat Oct 21 14:50:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 736700 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 67BA7C004C0 for ; Sat, 21 Oct 2023 14:57:38 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 69118AEA; Sat, 21 Oct 2023 16:56:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 69118AEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697900256; bh=LnmERgavyVdVMQGQoWrTXTC/UPaXHpz5wb8k7N6xIh0=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fDFW3DyMz5Y/ZDL6TcxF5sQfVtU26SAKN963n37bxkX4CwbS29091eV3ET+usfOCv tKiwyCfywQrCZNlBON5b/5A6AacIQul8Pmax3NFOkUtw27yTSDuaN6ixUXVqsJ80m3 6xtl98l0Yn5d+FQXigMiISN3MxOop8ITKUNB2CtM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B9CCCF805D7; Sat, 21 Oct 2023 16:54:46 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 4F9B0F805D4; Sat, 21 Oct 2023 16:54:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 42D9DF8027B; Sat, 21 Oct 2023 16:53:03 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2061c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::61c]) (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 DC7FDF80166 for ; Sat, 21 Oct 2023 16:52:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DC7FDF80166 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=pdskug/h ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GMotHABrSIQV+4eTLjmWfvLnOdpk1CuybAmQexcGcrqghVTlh3CUOIb/5awXTeFXuU5Fsgs5a7V4pVseQfs5d23M7RKWjLjMaxUhs8812cZhR0b//Xq69HEynZmeSN0/tUAg5fJDe0VQ1IEUOryWhA1hxJn975calIA/wgIWKPToSbMGe3Dx5mbVUvtsyLhSsviiQJ7/5E5e6lZdzMgll2M5ZoOk+BTpt/GURFoVGYbHcY4qsyQGImmPlKuaG+/5eeJ0quoRssQF/B7k9hNcfJrTE44wdkL4PGlZt6l2bd7/K821W3waEgZJfiMuGAkmtiz0LxwBuXmMFPwBSYjmpA== 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=dAp94MXbWlUHOFFPRdpY09OJ6JFayAk1JST2qWf3c/U=; b=BthZKqbtRyhkQHIL8VJ24AQtdmoNGI3FCUBtg6hQuNWLimBb3NS9QlJyaZWykxzFsNX34LCEoNcrfCJchnmlA9aPKS8tli0H6W7S1CSiWKhoUdoOL+599GHlz+H5uywj+XaULWUonWVnLqbO73I5nwj9gDAX9ZGVXoY3gDoJvP9ZA9zTKA+LWVEYH5J+g01pnpnrwIYve0MBNko/AJvXGepJ0j8dKbB3PYegtjMAnH0VBsflayjovtT063MC4qdjAsuq2z6FlF2YLduK1GvvQ39qfaZLQHVPqMOtnmiM1UhBHszpB9kK985SFDIwVoH6ahICYHn9Sd/ApGoYaXMKrw== 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=dAp94MXbWlUHOFFPRdpY09OJ6JFayAk1JST2qWf3c/U=; b=pdskug/hSprUnCdft+OnpI1EJnq54gwz4Eu/4PBe/mPR+cFENEJ7qWC7iNWqUmYFxT4F285IbS8rknStLmG9Da0dCfrrku9ZBJuvtvqrR3DebsJLnR6CwlvHUytgeJ5CYGQhXZ2iTfYJw2dwfHckjgUVK3ctRtxXfKJL2jLgZaY= Received: from SN6PR16CA0045.namprd16.prod.outlook.com (2603:10b6:805:ca::22) by SN7PR12MB7129.namprd12.prod.outlook.com (2603:10b6:806:2a1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.24; Sat, 21 Oct 2023 14:52:50 +0000 Received: from SN1PEPF000252A4.namprd05.prod.outlook.com (2603:10b6:805:ca:cafe::81) by SN6PR16CA0045.outlook.office365.com (2603:10b6:805:ca::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26 via Frontend Transport; Sat, 21 Oct 2023 14:52:50 +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; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF000252A4.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:52:50 +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.2507.27; Sat, 21 Oct 2023 09:52:49 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 21 Oct 2023 09:52:49 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:52:44 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , V Sujith Kumar Reddy , Kuninori Morimoto , Claudiu Beznea , Jarkko Nikula , open list Subject: [PATCH 10/13] ASoC: amd: acp: change acp-deinit function arguments Date: Sat, 21 Oct 2023 20:20:51 +0530 Message-ID: <20231021145110.478744-10-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A4:EE_|SN7PR12MB7129:EE_ X-MS-Office365-Filtering-Correlation-Id: 5189fa8e-f78d-43bc-5186-08dbd24565a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C9cA/QHcBpaFyAOTSD/hlJpgjTlRWdpHMRmZrD9AA1Zz5kYY4Rm9IWSC/2Dfj3/FZ8GxNpJ4mJELSt0+PzvpxNCH16nFQ4TAch5tAb2xIfU11a9pP4fhsZw0PVZdu+YUXUc5bMYLADZlZA4jdhWG7rRlfWthkx0I+FG11qpUR2jJyx9c/V1+s/oyDKoC3y2a6qQdiQ4egp3fXaw5WYmLQczVJOerC6W5PSukJUNZTI1EIP5Ai4NFzfqQOGlb5TWa1U4a59xijZ6191HmIGqd0X7NORObrkbEhOeDz0oH//Krgu9t3s4KKScPr4Cd8dGZUQC6bO5+8bZSfykMGgSsr+HfqCPbDftOL818V7HkHHaJeAtbUOv/gVt0p1dvVdO8uWjXjMYzya1Yn4gEKbHs/bGu0YMPD2cwxKX5lVNjIdV+o9b8XFI/Ko1Xy0Uj5V+qyOjdz6vvyOCTbRjDIhdizhnm9sKe7A2QexLd+GCpwusCAmpqlCaz73E1KJyFMx6a4PNHieHoSBGc7z1fXEqECLXXySDUuWwgZEasmFYL/ruqz5Ud8X77ja5lKbAtZthOuVe84KJp22c6Pktc5ohtT8cQh/tgqUP0N5OGtoOs1VLPGmE6UoIORtObLNCKKIoTiUiShC5KG2LTEQtrvQhYijEVqmJ/FRbVT2dNkZizhRKdahGRGIQYTXCJNd4rwvwKbxUpI313wdBTx/Q97e0fW8CISsmGSaNHZnLqMogY5mp894LAAWavJp1NPEkstMlyoVJbYeuJdA+FuLXd/CKjag== 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:(13230031)(4636009)(136003)(346002)(376002)(396003)(39860400002)(230922051799003)(82310400011)(1800799009)(64100799003)(451199024)(186009)(40470700004)(46966006)(36840700001)(1076003)(26005)(40460700003)(36756003)(86362001)(40480700001)(356005)(81166007)(82740400003)(36860700001)(336012)(83380400001)(2906002)(478600001)(7696005)(6666004)(2616005)(426003)(47076005)(8936002)(8676002)(54906003)(4326008)(316002)(70586007)(5660300002)(41300700001)(70206006)(110136005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:52:50.2145 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5189fa8e-f78d-43bc-5186-08dbd24565a2 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: SN1PEPF000252A4.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7129 Message-ID-Hash: 4SUMK7A6RK3QZVPRCUWXAGH2KLKONILZ X-Message-ID-Hash: 4SUMK7A6RK3QZVPRCUWXAGH2KLKONILZ X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: acp-deinit function will not be same for all platforms. To make platform specific changes in acp-deinit function, instead of passing base address pass chip structure which contains acp_rev feild. chip->acp_rev will be used to add platform specific code in acp-deinit(). Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-legacy-common.c | 6 +++--- sound/soc/amd/acp/acp-pci.c | 4 ++-- sound/soc/amd/acp/amd.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index af85a153a770..cba0aabefb34 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -320,16 +320,16 @@ int acp_init(struct acp_chip_info *chip) } EXPORT_SYMBOL_NS_GPL(acp_init, SND_SOC_ACP_COMMON); -int acp_deinit(void __iomem *base) +int acp_deinit(struct acp_chip_info *chip) { int ret; /* Reset */ - ret = acp_reset(base); + ret = acp_reset(chip->base); if (ret) return ret; - writel(0, base + ACP_CONTROL); + writel(0, chip->base + ACP_CONTROL); return 0; } EXPORT_SYMBOL_NS_GPL(acp_deinit, SND_SOC_ACP_COMMON); diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index bbf079d47dc4..696c9ee6786f 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -178,7 +178,7 @@ static int __maybe_unused snd_acp_suspend(struct device *dev) int ret; chip = dev_get_drvdata(dev); - ret = acp_deinit(chip->base); + ret = acp_deinit(chip); if (ret) dev_err(dev, "ACP de-init failed\n"); return ret; @@ -219,7 +219,7 @@ static void acp_pci_remove(struct pci_dev *pci) platform_device_unregister(dmic_dev); if (pdev) platform_device_unregister(pdev); - ret = acp_deinit(chip->base); + ret = acp_deinit(chip); if (ret) dev_err(&pci->dev, "ACP de-init failed\n"); } diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 62d0793027f2..e3bb470d1f32 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -222,7 +222,7 @@ int smn_read(struct pci_dev *dev, u32 smn_addr); int smn_write(struct pci_dev *dev, u32 smn_addr, u32 data); int acp_init(struct acp_chip_info *chip); -int acp_deinit(void __iomem *base); +int acp_deinit(struct acp_chip_info *chip); void acp_enable_interrupts(struct acp_dev_data *adata); void acp_disable_interrupts(struct acp_dev_data *adata); /* Machine configuration */ From patchwork Sat Oct 21 14:50:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 736699 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 CAAE8C004C0 for ; Sat, 21 Oct 2023 14:58:01 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3CCEBE76; Sat, 21 Oct 2023 16:57:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3CCEBE76 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697900280; bh=PerkKg4HJKk01DlWklgv7+JM4x3wkO+sLaXv3vl/EIU=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=m5TsC/pVvXZWXy+Zyj1dDNEgy8IrBJ+ZIX6bwBB1qDILfEnnOFWuxJV6J5mXAtnMj tZ1X+iMT5fMS7elN5vmTJhygbJAd6GbTxbOQpiIUfuB2Ia8VNqABJONdnkOV4YlVZR xaAHPNV8F3Mu3QlbMYq0iFPE/YUxssu9x1uKl4oU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 38616F805EE; Sat, 21 Oct 2023 16:54:50 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B0C1BF805EE; Sat, 21 Oct 2023 16:54:49 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 17E78F8032D; Sat, 21 Oct 2023 16:53:37 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2060f.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8b::60f]) (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 43D72F8024E for ; Sat, 21 Oct 2023 16:53:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 43D72F8024E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=5BF0lC9U ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YxPVIYtGXeZsatPVwwghKhcvrMMRDEd0O1NAGOrqa5I6Puwm3K80G+RUOzfK4775P3GlO0ipxMjS6mQSzQZUlZ5fBue9An8tYBc4DjMFhW8YGujac/QTj8sIf5QUos1Xb8UjQOSyXqDooqc/z7TKr057cwh0Kn/xve1Ckt83s7psi2kFEqZ8+9SbJ1rBe0DBQUwoDisfpwsSM8XqM6RTtoFNEqvch1fDeqrg+duQQsYac6hbe328zanKYHvPO0loYScrGf7DxacncMexMknql9PUZZ0YlI8p5FEVN7vWhOGSS1doROHM9Jj8zE7PUYS9I1pE9tWrE1Zu9lMgKBCvrA== 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=VUl+/jOmshxtwB90xbdpSKuf+wov1WY/I+TPhIdwLyg=; b=k4rig5IUk50FtojXjd+EludzYeXQGM3kKFl262+eeTDKwoWvY32Gvc5tcAUGz1+jFuVpvbfm2/vwkBcfMLriyZZ9F6RXdUQG1/PsofbTRsQeeETW6hDsDOUDDLKMbXcukdW4z1yx6jYUrVEx5LLb1Tnw4E9JMAA7O1lRWXYF5GCimVt0A3ClH05YCMPofKFKfThStBw3FbmqoacGOptHqYknfVGUjgU1P8TRA1maVd3aD1oeM2qcNv7RnUK9XPcndICZFEGCpXrtQuLSZMceRnAXWIIQ6fMiBvkvZIWJreOgB0GAMXcWNIEFC89QWZvw/U1Raf/W/3cH70EGaH4gRA== 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=VUl+/jOmshxtwB90xbdpSKuf+wov1WY/I+TPhIdwLyg=; b=5BF0lC9Uggrj+m8FztaGB7ZIppv9pPvbhpKFUTcia0DVrxUqPUZ6/WiACHi8D0s9cf8qEMjfWxELj1lngWCPtl1Fn34S8Mzv6TMAIiomWShGunxDSGfL3sVzhDUiSEmeqXzqqjeK1MMuyyJx8Bix5eKjzJHjvvmOPqAHOEeIXd8= Received: from PH0PR07CA0048.namprd07.prod.outlook.com (2603:10b6:510:e::23) by MN2PR12MB4271.namprd12.prod.outlook.com (2603:10b6:208:1d7::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sat, 21 Oct 2023 14:53:18 +0000 Received: from SN1PEPF000252A0.namprd05.prod.outlook.com (2603:10b6:510:e:cafe::fb) by PH0PR07CA0048.outlook.office365.com (2603:10b6:510:e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26 via Frontend Transport; Sat, 21 Oct 2023 14:53:17 +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; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF000252A0.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Sat, 21 Oct 2023 14:53:17 +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.2507.27; Sat, 21 Oct 2023 09:53:17 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 21 Oct 2023 09:53:16 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Sat, 21 Oct 2023 09:53:10 -0500 From: Syed Saba Kareem To: , CC: , , , , , , , , Syed Saba Kareem , Liam Girdwood , "Jaroslav Kysela" , Takashi Iwai , Kuninori Morimoto , V Sujith Kumar Reddy , Marian Postevca , "Jarkko Nikula" , Claudiu Beznea , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= , Yang Li , "Dan Carpenter" , open list Subject: [PATCH 12/13] ASoC: amd: acp: Add pci legacy driver support for acp7.0 platform Date: Sat, 21 Oct 2023 20:20:53 +0530 Message-ID: <20231021145110.478744-12-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231021145110.478744-1-Syed.SabaKareem@amd.com> References: <20231021145110.478744-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A0:EE_|MN2PR12MB4271:EE_ X-MS-Office365-Filtering-Correlation-Id: ee501119-f36a-48fc-3a37-08dbd24575fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aaafx4uqYdIfL5ES2Z0KZPEo07dbNL+r8VUfpVARsNo4m535NCzaHp8Fj1cWcdcMHoNraQZFPAVirLUeVY3/6B6AmlGbPREgBmV1f+Ysx2po0Q1N5l1r+FpHwTC7FXkTB9X1/eQXHOCjlGA6zDEalDS/RSqIS0giAQcWFFXA7CKldOgEMZRhKUz0/zDGVnVu2/+RSH7OyQH8v9kO6GDL7gmo7z/o5DO1AVxcC30L3zhWSSM9rKW5reSX9ckgDXxvMI2EpsXESEkf2Q1jC/FSQPFpUD5PsIFFcYb3MB83YLvh5u51CmBqYTHfgumrf5BxYjDctmTAZuYLozteZduynlhZJe4LYrRU/EyykU3Xp2BUHFv1doyF09nM+LJ9LO64WkkzeModmeqep3pppfsIuzU1YeTTnaVCY54SoWoCNLl6YjJXDc2kLNxn2AtuDKPNdcQd0YCyEqVAvMV67xKqnGZkZprFbw1lH13/gHe/60MxiT63oN2kJFgEkxysq2f6UJPCiPF3SKsKYlgO5IGS2+qBek+Hbsrs2pAtvpHMNM8Ihxkk8AW7GaTxa+19Eifc0foDMFW4927gelTIUYr9sHqBAB/Jx7Hu6ZPUx+juP1blguA+ax+ms+g0AHLn+uHAFurTDlcypYOhFgVzbQ+UazFB1wDQSUqRHP3sPpq/jX/qxCsjzvAwSRQNecyGMVozRVZ/Q/TadsKRtAAEWuBvaiUCHg86BEBmAjtvPBJKveoRVu03gfzzcuNEGUs6hpeLOLIj1jG8Pbi6TDvpu3PZwQ== 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:(13230031)(4636009)(376002)(396003)(136003)(39860400002)(346002)(230922051799003)(82310400011)(64100799003)(451199024)(1800799009)(186009)(40470700004)(46966006)(36840700001)(40460700003)(47076005)(41300700001)(4326008)(36756003)(7416002)(26005)(5660300002)(36860700001)(83380400001)(1076003)(82740400003)(81166007)(426003)(336012)(356005)(86362001)(7696005)(2616005)(40480700001)(478600001)(70206006)(8676002)(2906002)(70586007)(110136005)(54906003)(6666004)(316002)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2023 14:53:17.6472 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee501119-f36a-48fc-3a37-08dbd24575fc 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: SN1PEPF000252A0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4271 Message-ID-Hash: N3TZUTNAX2QTHT3TXRGBEPEKQ2ML675T X-Message-ID-Hash: N3TZUTNAX2QTHT3TXRGBEPEKQ2ML675T X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add pci legacy driver support and create platform driver for acp7.0 platform. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-legacy-common.c | 11 +- sound/soc/amd/acp/acp-mach.h | 1 + sound/soc/amd/acp/acp-pci.c | 4 + sound/soc/amd/acp/acp70.c | 254 ++++++++++++++++++++++++++ sound/soc/amd/acp/amd.h | 4 + 5 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 sound/soc/amd/acp/acp70.c diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index cba0aabefb34..b5aff3f230be 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -19,6 +19,7 @@ #define ACP_RENOIR_PDM_ADDR 0x02 #define ACP_REMBRANDT_PDM_ADDR 0x03 #define ACP63_PDM_ADDR 0x02 +#define ACP70_PDM_ADDR 0x02 void acp_enable_interrupts(struct acp_dev_data *adata) { @@ -268,6 +269,10 @@ static int acp_power_on(struct acp_chip_info *chip) acp_pgfsm_stat_reg = ACP63_PGFSM_STATUS; acp_pgfsm_ctrl_reg = ACP63_PGFSM_CONTROL; break; + case ACP70_DEV: + acp_pgfsm_stat_reg = ACP70_PGFSM_STATUS; + acp_pgfsm_ctrl_reg = ACP70_PGFSM_CONTROL; + break; default: return -EINVAL; } @@ -329,7 +334,8 @@ int acp_deinit(struct acp_chip_info *chip) if (ret) return ret; - writel(0, chip->base + ACP_CONTROL); + if (chip->acp_rev != ACP70_DEV) + writel(0, chip->base + ACP_CONTROL); return 0; } EXPORT_SYMBOL_NS_GPL(acp_deinit, SND_SOC_ACP_COMMON); @@ -385,6 +391,9 @@ int check_acp_pdm(struct pci_dev *pci, struct acp_chip_info *chip) case ACP63_DEV: pdm_addr = ACP63_PDM_ADDR; break; + case ACP70_DEV: + pdm_addr = ACP70_PDM_ADDR; + break; default: return -EINVAL; } diff --git a/sound/soc/amd/acp/acp-mach.h b/sound/soc/amd/acp/acp-mach.h index 69db61f12eca..cd681101bea7 100644 --- a/sound/soc/amd/acp/acp-mach.h +++ b/sound/soc/amd/acp/acp-mach.h @@ -54,6 +54,7 @@ enum platform_end_point { RENOIR = 0, REMBRANDT, ACP63, + ACP70, }; struct acp_mach_ops { diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index 696c9ee6786f..8c8b1dcac628 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -91,6 +91,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id chip->name = "acp_asoc_acp63"; chip->acp_rev = ACP63_DEV; break; + case 0x70: + chip->name = "acp_asoc_acp70"; + chip->acp_rev = ACP70_DEV; + break; default: dev_err(dev, "Unsupported device revision:0x%x\n", pci->revision); ret = -EINVAL; diff --git a/sound/soc/amd/acp/acp70.c b/sound/soc/amd/acp/acp70.c new file mode 100644 index 000000000000..dd384c966ae9 --- /dev/null +++ b/sound/soc/amd/acp/acp70.c @@ -0,0 +1,254 @@ +// 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) 2023 Advanced Micro Devices, Inc. +// +// Authors: Syed Saba kareem +/* + * Hardware interface for ACP7.0 block + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "amd.h" +#include "acp-mach.h" + +#define DRV_NAME "acp_asoc_acp70" + +static struct acp_resource rsrc = { + .offset = 0, + .no_of_ctrls = 2, + .irqp_used = 1, + .soc_mclk = true, + .irq_reg_offset = 0x1a00, + .i2s_pin_cfg_offset = 0x1440, + .i2s_mode = 0x0a, + .scratch_reg_offset = 0x12800, + .sram_pte_offset = 0x03802800, +}; + +static struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_acp_machines[] = { + { + .id = "AMDI0029", + .drv_name = "acp70-acp", + }, + {}, +}; + +static struct snd_soc_dai_driver acp70_dai[] = { +{ + .name = "acp-i2s-sp", + .id = I2S_SP_INSTANCE, + .playback = { + .stream_name = "I2S SP Playback", + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 96000, + }, + .capture = { + .stream_name = "I2S SP Capture", + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &asoc_acp_cpu_dai_ops, +}, +{ + .name = "acp-i2s-bt", + .id = I2S_BT_INSTANCE, + .playback = { + .stream_name = "I2S BT Playback", + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 96000, + }, + .capture = { + .stream_name = "I2S BT Capture", + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 2, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &asoc_acp_cpu_dai_ops, +}, +{ + .name = "acp-i2s-hs", + .id = I2S_HS_INSTANCE, + .playback = { + .stream_name = "I2S HS Playback", + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 96000, + }, + .capture = { + .stream_name = "I2S HS Capture", + .rates = SNDRV_PCM_RATE_8000_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 48000, + }, + .ops = &asoc_acp_cpu_dai_ops, +}, +{ + .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 acp_acp70_audio_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct acp_chip_info *chip; + struct acp_dev_data *adata; + struct resource *res; + + 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 != ACP70_DEV) { + dev_err(&pdev->dev, "Un-supported ACP Revision %d\n", chip->acp_rev); + return -ENODEV; + } + + adata = devm_kzalloc(dev, sizeof(struct acp_dev_data), GFP_KERNEL); + if (!adata) + return -ENOMEM; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "acp_mem"); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n"); + return -ENODEV; + } + + adata->acp_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!adata->acp_base) + return -ENOMEM; + + res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "acp_dai_irq"); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n"); + return -ENODEV; + } + + adata->i2s_irq = res->start; + adata->dev = dev; + adata->dai_driver = acp70_dai; + adata->num_dai = ARRAY_SIZE(acp70_dai); + adata->rsrc = &rsrc; + adata->machines = snd_soc_acpi_amd_acp70_acp_machines; + adata->platform = ACP70; + adata->flag = chip->flag; + acp_machine_select(adata); + + dev_set_drvdata(dev, adata); + acp_enable_interrupts(adata); + acp_platform_register(dev); + pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_mark_last_busy(&pdev->dev); + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); + return 0; +} + +static void acp_acp70_audio_remove(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct acp_dev_data *adata = dev_get_drvdata(dev); + + acp_disable_interrupts(adata); + acp_platform_unregister(dev); + pm_runtime_disable(&pdev->dev); +} + +static int __maybe_unused acp70_pcm_resume(struct device *dev) +{ + struct acp_dev_data *adata = dev_get_drvdata(dev); + struct acp_stream *stream; + struct snd_pcm_substream *substream; + snd_pcm_uframes_t buf_in_frames; + u64 buf_size; + + spin_lock(&adata->acp_lock); + list_for_each_entry(stream, &adata->stream_list, list) { + if (stream) { + substream = stream->substream; + if (substream && substream->runtime) { + buf_in_frames = (substream->runtime->buffer_size); + buf_size = frames_to_bytes(substream->runtime, buf_in_frames); + config_pte_for_stream(adata, stream); + config_acp_dma(adata, stream, buf_size); + if (stream->dai_id) + restore_acp_i2s_params(substream, adata, stream); + else + restore_acp_pdm_params(substream, adata); + } + } + } + spin_unlock(&adata->acp_lock); + return 0; +} + +static const struct dev_pm_ops acp70_dma_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(NULL, acp70_pcm_resume) +}; + +static struct platform_driver acp70_driver = { + .probe = acp_acp70_audio_probe, + .remove_new = acp_acp70_audio_remove, + .driver = { + .name = "acp_asoc_acp70", + .pm = &acp70_dma_pm_ops, + }, +}; + +module_platform_driver(acp70_driver); + +MODULE_DESCRIPTION("AMD ACP ACP70 Driver"); +MODULE_IMPORT_NS(SND_SOC_ACP_COMMON); +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_ALIAS("platform:" DRV_NAME); diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 937ce13c7d40..5017e868f39b 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -21,6 +21,7 @@ #define ACP3X_DEV 3 #define ACP6X_DEV 6 #define ACP63_DEV 0x63 +#define ACP70_DEV 0x70 #define DMIC_INSTANCE 0x00 #define I2S_SP_INSTANCE 0x01 @@ -99,6 +100,9 @@ #define ACP63_PGFSM_CONTROL ACP6X_PGFSM_CONTROL #define ACP63_PGFSM_STATUS ACP6X_PGFSM_STATUS +#define ACP70_PGFSM_CONTROL ACP6X_PGFSM_CONTROL +#define ACP70_PGFSM_STATUS ACP6X_PGFSM_STATUS + #define ACP_SOFT_RST_DONE_MASK 0x00010001 #define ACP_PGFSM_CNTL_POWER_ON_MASK 0xffffffff