From patchwork Mon Aug 19 06:13:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13767943 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2064.outbound.protection.outlook.com [40.107.92.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0972811CA0; Mon, 19 Aug 2024 06:13:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724048034; cv=fail; b=PhDMzO1f67e/NNqaYCW355ZDLiz/uj6d6NHzV4wDS6G29HQQkfeTISSBFFl711igN7o5LmQk+1WtbGwhs04+4UGY6X4K6cfOVjhTRtvgFQcM0qlqnkroxGg9dEV9jcuNuGsv4TqwM5m6iNeRJ0MffU60XM03smBXJaWl1+ZXiSk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724048034; c=relaxed/simple; bh=T4ECzQLjoNm/Ww6/vGdZQyd6zCYy9Z2BVlVE0QhVi8E=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=nE+SL81d5mHLUV7wFeEANH8fwfSZiqCSKSJmFWOYvcvNQDweEvYrlfj4qzTOX2wbEc3bKQoxasfJdTMeiRK+PxNs1mmvrMjW3EpiUWuAeLQIspzupFg+S1msTlFUSC/qjl6bBZLQzFBZmr3pu3SjIrA5J7rWjgrtWtlWFk/8ACM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=p3Z7lZRD; arc=fail smtp.client-ip=40.107.92.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="p3Z7lZRD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pP9MsYdfbJ3emNv8oB3X5Z3SLpSM65xzwpWfQOBOjmoG6SeagcrFg0f69Nh9CemoGYfheipmgTNVx4e6dcit0ZTwlYUEp+FdVsNCzRZlY2XGBLARtIlfZbGCOLzDL4rPXVYgQEYvSsonVb2J2k4S5pmMMAJKioqMWHUZ850295uGVAHK116F9KrcHaGJsWJcNoEHmh3C1YZ2CsrUqvTGz+iavUiLheeyAw4NpmDx1Aah6Knsb3CyUc59MkfBVm/YP15xRo7PtAsK7hiplFc2MHSGj9n80NFQ5e/BEE6X3sUJDFzAGUSejIGmr2d3CIMKauIQ1wVSe0Wlmj9hjTZXSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=7chqinX2UUHex5v9pq4eYenkRZTwtCWHR4zd4VbToJA=; b=Nu9LOrBFYlcyJNfSnNtgH27A+FmESkEtL9HXKKAuD47Hrq7qpwmkTq8o3brnxKvRW4rYwG3ujAZwYZwoxm9X/zyXIo2qxwgQkYEliHwHJ8Zdh+fDKA5MJmybLycCKCSGUO9v4kLCgYGHPwFVCr01Xeh3CR+qIEubDH3JjcCdNRtPMlqiqKGfLYf1PFdrt8sdIYR+ZG1N9umy8blRlsMdK6deQudGyb+fubgAhHptphAaLvjfj8GzH97H2s3WylL1s2j5EfPR1qaeg4ilpe2Yt0jE6nsXPHmfpZ19HcICvol0NBcf7cDiUNox/zQBb9PwpfvsZ4qCLR2xpPx+PjyZrA== 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=7chqinX2UUHex5v9pq4eYenkRZTwtCWHR4zd4VbToJA=; b=p3Z7lZRDiJ/sOSZY4HHmIeW5rRWh2sHXRHHAEMKo+3nU+vrTvwgalF88nkHA+RoaujBp+U7zje9hnngliEHIe7g3EXBRuYuFxR8f0B9oaILp3thKXPY7K1Jc3G7xZszcAqYhgjmnlC8rCuQYYa6mUWx851c4CVtFRkgFVz39q8E= Received: from MW4PR04CA0131.namprd04.prod.outlook.com (2603:10b6:303:84::16) by CY8PR12MB7684.namprd12.prod.outlook.com (2603:10b6:930:87::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Mon, 19 Aug 2024 06:13:48 +0000 Received: from CO1PEPF000044F8.namprd21.prod.outlook.com (2603:10b6:303:84:cafe::b0) by MW4PR04CA0131.outlook.office365.com (2603:10b6:303:84::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend Transport; Mon, 19 Aug 2024 06:13:48 +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 CO1PEPF000044F8.mail.protection.outlook.com (10.167.241.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.4 via Frontend Transport; Mon, 19 Aug 2024 06:13:47 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.39; Mon, 19 Aug 2024 01:13:42 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH] ASoC: amd: acp: replace desc->rev check with acp pci revision id Date: Mon, 19 Aug 2024 11:43:29 +0530 Message-ID: <20240819061329.1025189-1-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F8:EE_|CY8PR12MB7684:EE_ X-MS-Office365-Filtering-Correlation-Id: 28fb3737-263f-480e-52f2-08dcc0161691 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024|7416014; X-Microsoft-Antispam-Message-Info: G417QAG8+X0ozyJjuquHve1HFzhtroWcD1f4Bk9xfkAbdLiyxlsz29641HPwg8CffcPmH2GmVSBpTq/A9uqAUUebDHXe8H45WzGAAyk0snTEzXNW13leoHhu1nhbSYhfNrFsLPWf/S1+K/ms3XAl2KIf026V99R54AQIuZSeWwgAsFKm1zhqHMjTaclX/nIacyCRfuaqoZtKp9fxPB+s/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2I5VnqD/JY6OvxTb/Baa/hhwgVBziYffT2G1OFFyD1Xmg/Dk7fJMC5lft032htXef5LI3vUboKuIjKjByTP5dkpOwNlDkyg5mDjN+jpw463ZaXmevuxu+AEbOtCHz57Eb6rkP6y1naaIeqCX2n8NfkoWgd 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:(13230040)(36860700013)(82310400026)(376014)(1800799024)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2024 06:13:47.8641 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 28fb3737-263f-480e-52f2-08dcc0161691 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: CO1PEPF000044F8.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7684 Replace acp descriptor structure member 'rev' check with acp pci revision id. Signed-off-by: Vijendar Mukunda --- sound/soc/sof/amd/acp.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c index 0f6115c8b005..e4d46fdda88b 100644 --- a/sound/soc/sof/amd/acp.c +++ b/sound/soc/sof/amd/acp.c @@ -236,7 +236,6 @@ int configure_and_run_sha_dma(struct acp_dev_data *adata, void *image_addr, unsigned int image_length) { struct snd_sof_dev *sdev = adata->dev; - const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata); unsigned int tx_count, fw_qualifier, val; int ret; @@ -265,8 +264,9 @@ int configure_and_run_sha_dma(struct acp_dev_data *adata, void *image_addr, snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP_SHA_DMA_DESTINATION_ADDR, dest_addr); snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP_SHA_MSG_LENGTH, image_length); - /* psp_send_cmd only required for vangogh platform (rev - 5) */ - if (desc->rev == 5 && !(adata->quirks && adata->quirks->skip_iram_dram_size_mod)) { + /* psp_send_cmd only required for vangogh platform */ + if (adata->pci_rev == ACP_VANGOGH_PCI_ID && + !(adata->quirks && adata->quirks->skip_iram_dram_size_mod)) { /* Modify IRAM and DRAM size */ ret = psp_send_cmd(adata, MBOX_ACP_IRAM_DRAM_FENCE_COMMAND | IRAM_DRAM_FENCE_2); if (ret) @@ -285,8 +285,8 @@ int configure_and_run_sha_dma(struct acp_dev_data *adata, void *image_addr, return ret; } - /* psp_send_cmd only required for renoir platform (rev - 3) */ - if (desc->rev == 3) { + /* psp_send_cmd only required for renoir platform*/ + if (adata->pci_rev == ACP_RN_PCI_ID) { ret = psp_send_cmd(adata, MBOX_ACP_SHA_DMA_COMMAND); if (ret) return ret; @@ -405,7 +405,7 @@ static irqreturn_t acp_irq_handler(int irq, void *dev_id) snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_stat, ACP_ERROR_IRQ_MASK); snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->acp_sw0_i2s_err_reason, 0); /* ACP_SW1_I2S_ERROR_REASON is newly added register from rmb platform onwards */ - if (desc->rev >= 6) + if (adata->pci_rev >= ACP_RMB_PCI_ID) snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP_SW1_I2S_ERROR_REASON, 0); snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->acp_error_stat, 0); irq_flag = 1; @@ -431,6 +431,7 @@ static irqreturn_t acp_irq_handler(int irq, void *dev_id) static int acp_power_on(struct snd_sof_dev *sdev) { const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata); + struct acp_dev_data *adata = sdev->pdata->hw_pdata; unsigned int base = desc->pgfsm_base; unsigned int val; unsigned int acp_pgfsm_status_mask, acp_pgfsm_cntl_mask; @@ -441,13 +442,14 @@ static int acp_power_on(struct snd_sof_dev *sdev) if (val == ACP_POWERED_ON) return 0; - switch (desc->rev) { - case 3: - case 5: + switch (adata->pci_rev) { + case ACP_RN_PCI_ID: + case ACP_VANGOGH_PCI_ID: acp_pgfsm_status_mask = ACP3X_PGFSM_STATUS_MASK; acp_pgfsm_cntl_mask = ACP3X_PGFSM_CNTL_POWER_ON_MASK; break; - case 6: + case ACP_RMB_PCI_ID: + case ACP63_PCI_ID: acp_pgfsm_status_mask = ACP6X_PGFSM_STATUS_MASK; acp_pgfsm_cntl_mask = ACP6X_PGFSM_CNTL_POWER_ON_MASK; break;