From patchwork Fri May 3 12:02:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 794420 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 2ECD0C4345F for ; Fri, 3 May 2024 12:04:13 +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 CA0F3E66; Fri, 3 May 2024 14:04:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CA0F3E66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714737851; bh=7Mrxn0c2Of15FvtOLnDftYna3fbVbc+E96tx5ROV0oA=; h=From:To:CC:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=JLnloWMQpo8NQO7hg036UkM5dKL8Y/HsUnZ69GLiL2Qm91w8GdUSa9z5wxRlnBumS IBF7wyQS5N9R6UKwt6+e7scjFNi6WgJuV2FPTdDPlUoHmky/ChwTsZNetA7PWHMExN Pu6i06XDMebZB8dJ/gGI1wuNMSxQBWRiRPZUF2rQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A7A5FF805AA; Fri, 3 May 2024 14:03:40 +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 0D56DF805A9; Fri, 3 May 2024 14:03:40 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4F139F80269; Fri, 3 May 2024 14:03:33 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2415::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 29701F800E2 for ; Fri, 3 May 2024 14:03:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 29701F800E2 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=nOeLmQSK ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dx6gnYOC+x+EPu5szRjXxadDqmMbl3bZ2yecR+pHr+YaM5vscZ/KhMC5QurA97Qd+hiszB3dWoSuY18nIU/VzTouIIpXNZPa0S/w+Gvntoc58GEFNd1qVoSwmjrPJIybVcY58okpPuhv/vc83qxnCPqLETjlGyAfLlxTloN2E/4B2bLBOZRXQhVy1/lVNkCa9Yh6wYZKpdAJRddQDdWK9zIZADA6VAf5IrSkXCohvFHpJ/CdP9+VswZOgxUIb9FBqWFcY6az1ryvR4H1g3HmjzwUGwicb92XHOQcqbDGtz6K01cU+HLcCITopoGuGl2ronGLXr2xKQBf2hCGozAuAA== 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=y6lu8rsZi0fmvOJfipimJkSPCmlepObwC5L47W85CmQ=; b=n5tm2eeweI3+QcsZPQomy5WlsuKfWHIx4HC/INAGLYiGVsBmUrX3ScmXO+DJZkWzFf9JR2lcV5XJvhrpFl52p7PBwJK2Tpg2t91FYWftSHe7UsZeFEwv36YEe7taBi7EgqrbrxtRGbiRPCfofM5pUC4efheU/xc7TPZ8J9SeWZzQylM1tWExV5BPUmjinHtDe+nO6RB1cTplnCQ5lWVBemrGK+KeAwNevGm2MlaXp8CJDzj9HuWvA8ZzeTwkAMCxUVsiDG+x7xMxuighhzeNG4tTjZNDjES8d7ZpYACXdDIaikTtXhTxxnGe68TYIJ4xLEeyZB2LkrKx6/Et69Ygzw== 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 (0) 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=y6lu8rsZi0fmvOJfipimJkSPCmlepObwC5L47W85CmQ=; b=nOeLmQSKyVXIZM5NAOTUuogZ/gXQTSsi8ExRz5YeZ6qZk5wJ9de/CIvHS0yuLWz2N1S6k7xDuhSXqSk3IgEb1WSQMjmENcbHO5CjNcM4eK2QGIbsOwbF/RzjurOCKwSF7x0eWEIKsMpxj6fuur7qqpsk+KaZh3K8+ogz6pfSiJY= Received: from BY5PR16CA0036.namprd16.prod.outlook.com (2603:10b6:a03:1a0::49) by DM4PR12MB7503.namprd12.prod.outlook.com (2603:10b6:8:111::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.34; Fri, 3 May 2024 12:03:12 +0000 Received: from SJ1PEPF00001CE5.namprd03.prod.outlook.com (2603:10b6:a03:1a0:cafe::67) by BY5PR16CA0036.outlook.office365.com (2603:10b6:a03:1a0::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.32 via Frontend Transport; Fri, 3 May 2024 12:03:12 +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 SJ1PEPF00001CE5.mail.protection.outlook.com (10.167.242.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Fri, 3 May 2024 12:03:12 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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.35; Fri, 3 May 2024 07:03:11 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 3 May 2024 07:03:07 -0500 From: Vijendar Mukunda To: CC: , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Syed Saba Kareem" , Kuninori Morimoto , V Sujith Kumar Reddy , Jarkko Nikula , Claudiu Beznea , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH V2 1/2] ASoC: amd: acp: fix for acp platform device creation failure Date: Fri, 3 May 2024 17:32:52 +0530 Message-ID: <20240503120306.4300-1-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE5:EE_|DM4PR12MB7503:EE_ X-MS-Office365-Filtering-Correlation-Id: 736498e9-5aab-4196-32ac-08dc6b6901a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|376005|7416005|1800799015|36860700004; X-Microsoft-Antispam-Message-Info: GtzSIRFZWs+TT1GnVz+cf/KZT1WBvDWztUopJiCrJzMzQ8E522rdWWPqcOF1ouHN4ZcEYQKwh9IRf7LtWKaeWQxt49S0N3g4Rw6dRozH8xQ4mKuqXeTR/1x+fUk2qiwsGZD3t4SEfN3QxoRs5UdmIjm71pHcvNhVEur1BfQ8VzHVPi1bScaW9AQ1IilODeQpkcKQKS3nFQGIJDPrTa/TnCjP6GmE4uzsrcLxpQ4wTWweSEGA58LMqKlzSCw3J5z9HpzeRkmfwn4vQxkVjX85z7a7bA9rTFJGqeGlaldrDoh/UjX5dfNdDhrXlCULnx+Mw661hiezAf1/X9u/+WdFu5qXhqcFYhzdGSukc0lqffe7xQ+hvQiUJAKF0aJqGvZxF5DIFBgBuONgKsD1frXIv8G5BiafOC56t4CyXpyKOlVBSDuUXjBGj9bCR1sTeqm0og/uKk8Vem3qpk5IvihJub7Nu7wFP/Wh87u3xQU1p3kjNAN8J+Yi/lWxpys/yCM+/M+s82AWuiaXzY7u7NlI7rdvmu1/V/Mq0u5EETVswmqzXcQLgnBlWDyqwnI3AMNc7IatSZOHj1VnVoFsgmHtCJ+yXKD0QP4FZgc26mPXvkhcTx6Zr7kl2qSzRS0H1PTO11Ix9A/damtrbQKtOX+9rTW/kTPyMsBGGd3be+GbCpuOlkeYN1XEc8DzuEheuCw0gVUWcveUWYgOTacXTQOYpx+kuwD8pN0BOrw5I36paJCCOZ0MU4r99qacQrIThKoWV/wuVxVeTQ+0+6W9Jr0J9PtiDGod/siP1SADAXjmv7wzmfs7NwQK9WdEZ6Kn3dDyjvO43fG99BbTauX5h4gx2p0Hb3so03JDaMjhUA1VDsbgUGt+E8IJ9679TbNgbUuVZFyvyljOMVJYe5uAIkvyUVr6tXLSgLUPtc6BEwmmWtNSoU6WhpGvDzbMnARkUItheQnw9KZuZquCuCjt70vRvmGeKVxjEsgGRRmYxuFAmj+Sk9zSMRh+q1dBkpQINmai+f+0ViBDqfFSGItrbKGZsMGc7TRfinLpVZ/AhD72soFEaJOl+fqeOLQbvoCdlI3PC1pwBSXPyMQsatRvmTjNyUg7rB37VW0yrbeI9L6RtcjP+G2oFKyg98fgTYdMvzV4syW3d5E53ScR0fIAFpaC24aNSYg92SDaKT8yS41OXVLTsgLJm8DWxXUlvVXWneYf/CpvGl2ip0HTNFuqInGLq/Mgduv2RkSC5yX5eoQCYWrbko5DDrHwB4V7H3nYONRq5HOmpEQDMgMjYZdh6/PEOZcjCl7afa2D45oVdqlPKWHjl4CbfMhqMyi0s7DBcNk9 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)(376005)(7416005)(1800799015)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2024 12:03:12.0906 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 736498e9-5aab-4196-32ac-08dc6b6901a0 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: SJ1PEPF00001CE5.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7503 Message-ID-Hash: HFNOAHYXHZGWZLERGVE7DAAT5K6DRWUA X-Message-ID-Hash: HFNOAHYXHZGWZLERGVE7DAAT5K6DRWUA X-MailFrom: Vijendar.Mukunda@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.9 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 pin configuration varies based on acp version. ACP PCI driver should read the ACP PIN config value and based on config value, it has to create a platform device in below two conditions. 1) If ACP PDM configuration is selected from BIOS and ACP PDM controller exists. 2) If ACP I2S configuration is selected from BIOS. Other than above scenarios, ACP PCI driver should skip the platform device creation logic, i.e. ACP PCI driver probe sequence should never fail if other acp pin configuration is selected. It should skip platform device creation logic. check_acp_pdm() function was implemented for ACP6.x platforms to check ACP PDM configuration. Previously, this code was safe guarded by FLAG_AMD_LEGACY_ONLY_DMIC flag check. This implementation breaks audio use cases for Huawei Matebooks which are based on ACP3.x varaint uses I2S configuration. In current scenario, check_acp_pdm() function returns -ENODEV value which results in ACP PCI driver probe failure without creating a platform device even in case of valid ACP pin configuration. Implement check_acp_config() as a common function which invokes platform specific acp pin configuration check functions for ACP3.x, ACP6.0 & ACP6.3 & ACP7.0 variants and checks for ACP PDM controller. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218780 Fixes: 4af565de9f8c ("ASoC: amd: acp: fix for acp pdm configuration check") Signed-off-by: Vijendar Mukunda --- changes since v1: - drop white line change which is not relevant to this patch. sound/soc/amd/acp/acp-legacy-common.c | 96 ++++++++++++++++++++++----- sound/soc/amd/acp/acp-pci.c | 8 +-- sound/soc/amd/acp/amd.h | 10 ++- sound/soc/amd/acp/chip_offset_byte.h | 1 + 4 files changed, 95 insertions(+), 20 deletions(-) diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index b5aff3f230be..3be7c6d55a6f 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -358,11 +358,25 @@ 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) +static void check_acp3x_config(struct acp_chip_info *chip) { - struct acpi_device *pdm_dev; - const union acpi_object *obj; - u32 pdm_addr, val; + u32 val; + + val = readl(chip->base + ACP3X_PIN_CONFIG); + switch (val) { + case ACP_CONFIG_4: + chip->is_i2s_config = true; + chip->is_pdm_config = true; + break; + default: + chip->is_pdm_config = true; + break; + } +} + +static void check_acp6x_config(struct acp_chip_info *chip) +{ + u32 val; val = readl(chip->base + ACP_PIN_CONFIG); switch (val) { @@ -371,42 +385,94 @@ int check_acp_pdm(struct pci_dev *pci, struct acp_chip_info *chip) case ACP_CONFIG_6: case ACP_CONFIG_7: case ACP_CONFIG_8: - case ACP_CONFIG_10: case ACP_CONFIG_11: + case ACP_CONFIG_14: + chip->is_pdm_config = true; + break; + case ACP_CONFIG_9: + chip->is_i2s_config = true; + break; + case ACP_CONFIG_10: case ACP_CONFIG_12: case ACP_CONFIG_13: + chip->is_i2s_config = true; + chip->is_pdm_config = true; + break; + default: + break; + } +} + +static void check_acp70_config(struct acp_chip_info *chip) +{ + u32 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_11: case ACP_CONFIG_14: + case ACP_CONFIG_17: + case ACP_CONFIG_18: + chip->is_pdm_config = true; + break; + case ACP_CONFIG_9: + chip->is_i2s_config = true; + break; + case ACP_CONFIG_10: + case ACP_CONFIG_12: + case ACP_CONFIG_13: + case ACP_CONFIG_19: + case ACP_CONFIG_20: + chip->is_i2s_config = true; + chip->is_pdm_config = true; break; default: - return -EINVAL; + break; } +} + +void check_acp_config(struct pci_dev *pci, struct acp_chip_info *chip) +{ + struct acpi_device *pdm_dev; + const union acpi_object *obj; + u32 pdm_addr; switch (chip->acp_rev) { case ACP3X_DEV: pdm_addr = ACP_RENOIR_PDM_ADDR; + check_acp3x_config(chip); break; case ACP6X_DEV: pdm_addr = ACP_REMBRANDT_PDM_ADDR; + check_acp6x_config(chip); break; case ACP63_DEV: pdm_addr = ACP63_PDM_ADDR; + check_acp6x_config(chip); break; case ACP70_DEV: pdm_addr = ACP70_PDM_ADDR; + check_acp70_config(chip); break; default: - return -EINVAL; + break; } - 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; + if (chip->is_pdm_config) { + 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) + chip->is_pdm_dev = true; + } } - return -ENODEV; } -EXPORT_SYMBOL_NS_GPL(check_acp_pdm, SND_SOC_ACP_COMMON); +EXPORT_SYMBOL_NS_GPL(check_acp_config, 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 5f35b90eab8d..d8314d2b331b 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -119,6 +119,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id if (ret) goto unregister_dmic_dev; + check_acp_config(pci, chip); + if (!chip->is_pdm_dev && !chip->is_i2s_config) + goto skip_pdev_creation; + res = devm_kcalloc(&pci->dev, num_res, sizeof(struct resource), GFP_KERNEL); if (!res) { ret = -ENOMEM; @@ -136,10 +140,6 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id } } - ret = check_acp_pdm(pci, chip); - if (ret < 0) - goto skip_pdev_creation; - chip->flag = flag; memset(&pdevinfo, 0, sizeof(pdevinfo)); diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 5017e868f39b..d75b4eb34de8 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -138,6 +138,9 @@ struct acp_chip_info { void __iomem *base; /* ACP memory PCI base */ struct platform_device *chip_pdev; unsigned int flag; /* Distinguish b/w Legacy or Only PDM */ + bool is_pdm_dev; /* flag set to true when ACP PDM controller exists */ + bool is_pdm_config; /* flag set to true when PDM configuration is selected from BIOS */ + bool is_i2s_config; /* flag set to true when I2S configuration is selected from BIOS */ }; struct acp_stream { @@ -212,6 +215,11 @@ enum acp_config { ACP_CONFIG_13, ACP_CONFIG_14, ACP_CONFIG_15, + ACP_CONFIG_16, + ACP_CONFIG_17, + ACP_CONFIG_18, + ACP_CONFIG_19, + ACP_CONFIG_20, }; extern const struct snd_soc_dai_ops asoc_acp_cpu_dai_ops; @@ -240,7 +248,7 @@ 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); +void check_acp_config(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) { diff --git a/sound/soc/amd/acp/chip_offset_byte.h b/sound/soc/amd/acp/chip_offset_byte.h index cfd6c4d07594..18da734c0e9e 100644 --- a/sound/soc/amd/acp/chip_offset_byte.h +++ b/sound/soc/amd/acp/chip_offset_byte.h @@ -20,6 +20,7 @@ #define ACP_SOFT_RESET 0x1000 #define ACP_CONTROL 0x1004 #define ACP_PIN_CONFIG 0x1440 +#define ACP3X_PIN_CONFIG 0x1400 #define ACP_EXTERNAL_INTR_REG_ADDR(adata, offset, ctrl) \ (adata->acp_base + adata->rsrc->irq_reg_offset + offset + (ctrl * 0x04)) From patchwork Fri May 3 12:02:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 794644 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 0E285C4345F for ; Fri, 3 May 2024 12:04:26 +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 4B84EE65; Fri, 3 May 2024 14:04:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4B84EE65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714737865; bh=JD7L+elBxsMYCzNWpE2V2IV4xD5KuR8FeTJRcqRA9C8=; 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=K4flSwcV1qjH8DC4Pult2eqVNhyAvPqvlMv8BY5dbKzz3F2VuU1Bw3jNSRoK1Iw+t 8qXABThbW/VMirvTXcA0qeqZdPq6f7rP+ne2pXCjBKyjV4LGR0RIVBjOINWfmWkgD2 3jiPuSv9YpaG32elTQH2oG1sJ8AYLer+v2dFWVmA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 03DEBF805C0; Fri, 3 May 2024 14:03:43 +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 6DC54F805C9; Fri, 3 May 2024 14:03:43 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AA7EBF80266; Fri, 3 May 2024 14:03:34 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2418::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 86840F8025D for ; Fri, 3 May 2024 14:03:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 86840F8025D 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=QacN1a8O ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fk0hC4ZAoYBqlKEfbz1TgfRUHGpBuyD6t/LD8i7L/fZMTzKlPRmJPTGf7Ezy4LbpOVfdyNqisismhbX1j3MT70t1fTu5kd0+2DeYuOTUHIswQUbU66dMDZTjJCXos/vkoiADtPYhUlqDohyaID831yBYW3c1t1sQ2yY5M1QLmg3vm/gBgT4Fbnf3vzz/XcznRZIzpGrxYPLeVH+c47VkxO5WGSoJQvfHwzUOtMCDeVAS9dRW9XViyK6A3le2EKzHO9dPF3+eFESTrYgkrLAJRV6zW0SjcUP9VWMo5lDmeJn2fun6E4yU1yYGx3pLj7CGhWMTbHNwalrMRbtK7Iy+oA== 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=8Qbue7grr2bVxgPmLG82CvLiuXBtHrfrsmJyYa1R9AM=; b=gUC5TMxLQbwjAk0aikj/1NsvLkz41YnYch1FbQND8SBG2OpdjVLvcNrmwZmTwTovzxsUjYrCvioJaW1M4SudEO1XijxKyMx6cm/zPYqNlvW1PN/iwP1v4xEw/voiU1EaTAh+ufSZb/a5gG6qpxW4eyaBbsaWCpRcF0+oV8vLvy0s9meB/4gJDqrzlbF1iuW/0enxSIkPfGRPdZImeBwoISy/sOS3VHXXkV2zlaz/Te124BNNh1fJpWlH2IXu4tcV0PkQitCZRPROJHMGODbsEF4RFyr3mhhCvvC7/vE5NNPtlJoFK0QyFLczrs9EZEx/nmveQ3uZ1ubXXYggft7VIw== 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 (0) 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=8Qbue7grr2bVxgPmLG82CvLiuXBtHrfrsmJyYa1R9AM=; b=QacN1a8ObmqLB4p0aOqZBFwisJGjzp7wuScLeZTxBV4xCNh0AO0ZRqBNuKdKWMSo05XrcTJKdeMNbJSd8jCaQ3IWyXbt7KgvAtbVtzsggBSuWfvhmJiucLuJaqre8+EnxAp+b3I0mtkNsDDJqG/3IL+gZu0v6eFFfx8Tep4rNus= Received: from MW4PR04CA0355.namprd04.prod.outlook.com (2603:10b6:303:8a::30) by MW4PR12MB7120.namprd12.prod.outlook.com (2603:10b6:303:222::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.29; Fri, 3 May 2024 12:03:19 +0000 Received: from CO1PEPF000066E7.namprd05.prod.outlook.com (2603:10b6:303:8a:cafe::8) by MW4PR04CA0355.outlook.office365.com (2603:10b6:303:8a::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.30 via Frontend Transport; Fri, 3 May 2024 12:03:19 +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 CO1PEPF000066E7.mail.protection.outlook.com (10.167.249.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Fri, 3 May 2024 12:03:19 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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.35; Fri, 3 May 2024 07:03:18 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 3 May 2024 07:03:14 -0500 From: Vijendar Mukunda To: CC: , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Syed Saba Kareem" , Claudiu Beznea , Jarkko Nikula , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH V2 2/2] ASoC: amd: acp: move chip->flag variable assignment Date: Fri, 3 May 2024 17:32:53 +0530 Message-ID: <20240503120306.4300-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240503120306.4300-1-Vijendar.Mukunda@amd.com> References: <20240503120306.4300-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066E7:EE_|MW4PR12MB7120:EE_ X-MS-Office365-Filtering-Correlation-Id: aaea397b-cab6-4eea-d4b8-08dc6b6905ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|36860700004; X-Microsoft-Antispam-Message-Info: AOUQeCcQT0ZjNy7ZLBMNQEwKqaLeKq6tSKq6Cnt/UQ5E8z8seaICVg7uTiN8BZ2rGOi2pbh8HR8ojZlDBieuNjG08Z78ne9JXfU1n7d2Ni1Ffs2HhUqdhATNbU1snpw+P0aAlTTqvofAjn+wduWWyzzm0nHOY5d18hF58+MpCTIdj1hlbrZaFRJSs6ZgoFWT/Ltvw9DGVQ0DWz5Dyc8c5gTQeSWtL1cfrmz3sQmV5YpDVj0vYSuhi55H+zVyh18GlR9pPHbvdXl++RG33kh73FkSpnir1mReLLNwPoaxVad3J8EFywJaPdcgnSd/f5eNyxa0L/ggFXfJlvc3woSwZp8DHmixHRI0RLbmG4FojnpYBnYavBWqtMbJmyooZYIhP/JcJiCKA2pgLS1HMUwXpDBWpJs4VIwp2w/nNHldop8hv+EiiPPd8dFerhKEkp0hHyfDr5YlQZzP8iI12lg+evXa7HtQ5BTFmq3ABk+dZgyW0DoJmBeAFlSu7U7tP6lFM3q+prlTo4+wEtemewpnTxeedFI+zuK8+nFF3bYTE4hSfPSoErwmJbPgjgSCkzJmPR6QxT31M9oZHF8RQRr8l+YVh6Nc+MsfVPmw/gpGr2IGk1j/UGIuCoPk0flM+JZ22M26TajGsj4vbeooD7mBYTJ2uHTemVqdEDtK4wUcsagnArSyTIYxNyXCjqk0iYGiKyTe69xv6b07L0Iy/pX1YeOT/+Gzc8SEa1wvRi53hqIkam8GdUKwN1CUSeDHVT/vVQZDS9a+IsdeGESgIp6z3SlOiJfSb/+34uvX49Haoh2BMrmZUy5QMpV+WxS9n18S3LbydA0l6wnZiH1GBk+jIswJ+sJFfs7ixn2x76yGyl7QF2chO+Po4fJgHxX/u01TISRa0Q6abQkj4tbxfiwDnirhk+aWNh+A8vB7P+pNeF/QFtWb9EYcRyk8KUTmZ09zI450P7FlBIMEhc8uN60FP7Wdq6BJvqOGVwIfTyvDZqCKDcfG5e2pwmGLuWRw6ZNvbgjZGBno/lqlVBj04TyxcKL8b/AQbrSQjXwhjHUgfo2bvEX7l3q2U9xyuk08HUuZzIGXwzaU6Jf3Jm8w7KClY+fl9MeVeaEibvCooLhGXYMajyTMZoEshOBbL8Gy4Li7Dw5rjm1yWtQsDam6T/JpFZ3OSwBAWNGPyQAuc5Yo9Jkw34ClwBi+H968aVMiQ5PhSI5UZXd8HQYMruuYqsHw5tMAu+zJw9nTaN0B1uXaMV378clHEnUzKiSmk5C15hd9EhwNvfeUanWVL3yT1xqwMOLXkDRZIUrmQwhoXkGr2FsB2hmMypgE9ldL9N62AmBsDQ3EjC8o7WjCH6u25D0nlNvon6ABsEwIZAizslPMCXCbD9Eaf1RnG6PNbzwG4Yy/ 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)(376005)(1800799015)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2024 12:03:19.4595 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aaea397b-cab6-4eea-d4b8-08dc6b6905ff 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: CO1PEPF000066E7.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7120 Message-ID-Hash: OG5L75ZMY2E45KHICRV2OG6WRITEJ6AF X-Message-ID-Hash: OG5L75ZMY2E45KHICRV2OG6WRITEJ6AF X-MailFrom: Vijendar.Mukunda@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.9 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: chip->flag variable should be assigned along with other structure variables for 'chip' structure. Move the variable assignment. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/acp/acp-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index d8314d2b331b..b70b3ae33df7 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -101,6 +101,7 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id goto release_regions; } + chip->flag = flag; 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"); @@ -140,7 +141,6 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id } } - chip->flag = flag; memset(&pdevinfo, 0, sizeof(pdevinfo)); pdevinfo.name = chip->name;