]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: amd: acp: Refactor rembrant platform resource structure
authorVenkata Prasad Potturu <venkataprasad.potturu@amd.com>
Mon, 10 Mar 2025 18:31:59 +0000 (00:01 +0530)
committerMark Brown <broonie@kernel.org>
Tue, 11 Mar 2025 17:18:33 +0000 (17:18 +0000)
Refactor rembrandt platform resource private structure to amd.h
header fle.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250310183201.11979-13-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/acp/acp-pci.c
sound/soc/amd/acp/acp-rembrandt.c
sound/soc/amd/acp/amd.h

index 3df665ca1b0b2e758d281caba383b6f3753da832..6dd905e75f1d1257aaf8f2e1fb9e475fea20cba2 100644 (file)
@@ -140,6 +140,7 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
                break;
        case 0x6f:
                chip->name = "acp_asoc_rembrandt";
+               chip->rsrc = &rmb_rsrc;
                chip->acp_hw_ops_init = acp6x_hw_ops_init;
                chip->machines = snd_soc_acpi_amd_rmb_acp_machines;
                break;
index dfb18d5cdc7ad71ca9db683ec85cc2028349b9a5..21614e2e1b6c85a9574c8ce831104846a270ee1d 100644 (file)
 #define MP1_C2PMSG_85 0x3B10A54
 #define MP1_C2PMSG_93 0x3B10A74
 
-static struct acp_resource rsrc = {
-       .offset = 0,
-       .no_of_ctrls = 2,
-       .irqp_used = 1,
-       .soc_mclk = true,
-       .irq_reg_offset = 0x1a00,
-       .scratch_reg_offset = 0x12800,
-       .sram_pte_offset = 0x03802800,
-};
-
 static struct snd_soc_dai_driver acp_rmb_dai[] = {
 {
        .name = "acp-i2s-sp",
@@ -171,11 +161,10 @@ static int rembrandt_audio_probe(struct platform_device *pdev)
        }
 
        chip->dev = dev;
-       chip->rsrc = &rsrc;
        chip->dai_driver = acp_rmb_dai;
        chip->num_dai = ARRAY_SIZE(acp_rmb_dai);
 
-       if (chip->is_i2s_config && rsrc.soc_mclk) {
+       if (chip->is_i2s_config && chip->rsrc->soc_mclk) {
                ret = acp6x_master_clock_generate(dev);
                if (ret)
                        return ret;
index 075659fb3314a01ba6e850761104e080e7beea4f..0cb6d2abf832436e4d7812e9e68c6e967b93335c 100644 (file)
@@ -238,6 +238,16 @@ enum acp_config {
        ACP_CONFIG_20,
 };
 
+struct acp_resource rmb_rsrc = {
+       .offset = 0,
+       .no_of_ctrls = 2,
+       .irqp_used = 1,
+       .soc_mclk = true,
+       .irq_reg_offset = 0x1a00,
+       .scratch_reg_offset = 0x12800,
+       .sram_pte_offset = 0x03802800,
+};
+
 struct acp_resource acp63_rsrc = {
        .offset = 0,
        .no_of_ctrls = 2,