OSDN Git Service

ASoC: SOF: add IPC-dependent file names
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 14 Apr 2022 18:48:06 +0000 (13:48 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 19 Apr 2022 11:03:34 +0000 (12:03 +0100)
To avoid misleading file names, use different names for INTEL_IPC4
firmware files.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Chao Song <chao.song@intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
16 files changed:
include/sound/sof.h
sound/soc/sof/amd/pci-rn.c
sound/soc/sof/imx/imx8.c
sound/soc/sof/imx/imx8m.c
sound/soc/sof/intel/bdw.c
sound/soc/sof/intel/byt.c
sound/soc/sof/intel/hda.c
sound/soc/sof/intel/pci-apl.c
sound/soc/sof/intel/pci-cnl.c
sound/soc/sof/intel/pci-icl.c
sound/soc/sof/intel/pci-tgl.c
sound/soc/sof/intel/pci-tng.c
sound/soc/sof/mediatek/mt8195/mt8195.c
sound/soc/sof/sof-acpi-dev.c
sound/soc/sof/sof-of-dev.c
sound/soc/sof/sof-pci-dev.c

index a65af85..9699765 100644 (file)
@@ -133,7 +133,7 @@ struct sof_dev_desc {
        const char *default_tplg_path[SOF_IPC_TYPE_COUNT];
 
        /* default firmware name */
-       const char *default_fw_filename;
+       const char *default_fw_filename[SOF_IPC_TYPE_COUNT];
 
        const struct snd_sof_dsp_ops *ops;
 };
index 34b153f..b8910bb 100644 (file)
@@ -62,7 +62,9 @@ static const struct sof_dev_desc renoir_desc = {
        .default_tplg_path = {
                [SOF_IPC] = "amd/sof-tplg",
        },
-       .default_fw_filename    = "sof-rn.ri",
+       .default_fw_filename    = {
+               [SOF_IPC] = "sof-rn.ri",
+       },
        .nocodec_tplg_filename  = "sof-acp.tplg",
        .ops                    = &sof_renoir_ops,
 };
index cdbbd20..db53be8 100644 (file)
@@ -621,7 +621,9 @@ static struct sof_dev_desc sof_of_imx8qxp_desc = {
        .default_tplg_path = {
                [SOF_IPC] = "imx/sof-tplg",
        },
-       .default_fw_filename = "sof-imx8x.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-imx8x.ri",
+       },
        .nocodec_tplg_filename = "sof-imx8-nocodec.tplg",
        .ops = &sof_imx8x_ops,
 };
@@ -635,7 +637,9 @@ static struct sof_dev_desc sof_of_imx8qm_desc = {
        .default_tplg_path = {
                [SOF_IPC] = "imx/sof-tplg",
        },
-       .default_fw_filename = "sof-imx8.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-imx8.ri",
+       },
        .nocodec_tplg_filename = "sof-imx8-nocodec.tplg",
        .ops = &sof_imx8_ops,
 };
index cbee484..196ca7d 100644 (file)
@@ -481,7 +481,9 @@ static struct sof_dev_desc sof_of_imx8mp_desc = {
        .default_tplg_path = {
                [SOF_IPC] = "imx/sof-tplg",
        },
-       .default_fw_filename = "sof-imx8m.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-imx8m.ri",
+       },
        .nocodec_tplg_filename = "sof-imx8-nocodec.tplg",
        .ops = &sof_imx8m_ops,
 };
index a0f22b1..efdc9e6 100644 (file)
@@ -654,7 +654,9 @@ static const struct sof_dev_desc sof_acpi_broadwell_desc = {
        .default_tplg_path = {
                [SOF_IPC] = "intel/sof-tplg",
        },
-       .default_fw_filename = "sof-bdw.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-bdw.ri",
+       },
        .nocodec_tplg_filename = "sof-bdw-nocodec.tplg",
        .ops = &sof_bdw_ops,
 };
index 427b5c5..748d145 100644 (file)
@@ -396,7 +396,9 @@ static const struct sof_dev_desc sof_acpi_baytrailcr_desc = {
        .default_tplg_path = {
                [SOF_IPC] = "intel/sof-tplg",
        },
-       .default_fw_filename = "sof-byt.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-byt.ri",
+       },
        .nocodec_tplg_filename = "sof-byt-nocodec.tplg",
        .ops = &sof_byt_ops,
 };
@@ -416,7 +418,9 @@ static const struct sof_dev_desc sof_acpi_baytrail_desc = {
        .default_tplg_path = {
                [SOF_IPC] = "intel/sof-tplg",
        },
-       .default_fw_filename = "sof-byt.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-byt.ri",
+       },
        .nocodec_tplg_filename = "sof-byt-nocodec.tplg",
        .ops = &sof_byt_ops,
 };
@@ -436,7 +440,9 @@ static const struct sof_dev_desc sof_acpi_cherrytrail_desc = {
        .default_tplg_path = {
                [SOF_IPC] = "intel/sof-tplg",
        },
-       .default_fw_filename = "sof-cht.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-cht.ri",
+       },
        .nocodec_tplg_filename = "sof-cht-nocodec.tplg",
        .ops = &sof_cht_ops,
 };
index 9c97c80..da665d1 100644 (file)
@@ -1274,7 +1274,7 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev
                        mach->mach_params.links = mach->links;
                        mach->mach_params.link_mask = mach->link_mask;
                        mach->mach_params.platform = dev_name(sdev->dev);
-                       pdata->fw_filename = pdata->desc->default_fw_filename;
+                       pdata->fw_filename = pdata->desc->default_fw_filename[pdata->ipc_type];
                        pdata->tplg_filename = mach->sof_tplg_filename;
 
                        /*
index c173f20..1f0e509 100644 (file)
@@ -37,7 +37,10 @@ static const struct sof_dev_desc bxt_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-apl.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-apl.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-apl-nocodec.tplg",
        .ops = &sof_apl_ops,
 };
@@ -60,7 +63,10 @@ static const struct sof_dev_desc glk_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-glk.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-glk.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-glk-nocodec.tplg",
        .ops = &sof_apl_ops,
 };
index b521939..858e8a1 100644 (file)
@@ -38,7 +38,10 @@ static const struct sof_dev_desc cnl_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-cnl.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-cnl.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-cnl-nocodec.tplg",
        .ops = &sof_cnl_ops,
 };
@@ -62,7 +65,10 @@ static const struct sof_dev_desc cfl_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-cfl.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-cfl.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-cnl-nocodec.tplg",
        .ops = &sof_cnl_ops,
 };
@@ -86,7 +92,10 @@ static const struct sof_dev_desc cml_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-cml.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-cml.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-cnl-nocodec.tplg",
        .ops = &sof_cnl_ops,
 };
index c1ed81b..21bcd5d 100644 (file)
@@ -38,7 +38,10 @@ static const struct sof_dev_desc icl_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-icl.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-icl.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-icl-nocodec.tplg",
        .ops = &sof_icl_ops,
 };
@@ -61,7 +64,10 @@ static const struct sof_dev_desc jsl_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-jsl.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-jsl.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-jsl-nocodec.tplg",
        .ops = &sof_cnl_ops,
 };
index 6a44143..caefd30 100644 (file)
@@ -38,7 +38,10 @@ static const struct sof_dev_desc tgl_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-tgl.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-tgl.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
        .ops = &sof_tgl_ops,
 };
@@ -62,7 +65,10 @@ static const struct sof_dev_desc tglh_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-tgl-h.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-tgl-h.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
        .ops = &sof_tgl_ops,
 };
@@ -85,7 +91,10 @@ static const struct sof_dev_desc ehl_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-ehl.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-ehl.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-ehl-nocodec.tplg",
        .ops = &sof_tgl_ops,
 };
@@ -109,7 +118,10 @@ static const struct sof_dev_desc adls_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-adl-s.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-adl-s.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
        .ops = &sof_tgl_ops,
 };
@@ -133,7 +145,10 @@ static const struct sof_dev_desc adl_desc = {
                [SOF_IPC] = "intel/sof-tplg",
                [SOF_INTEL_IPC4] = "intel/avs-tplg",
        },
-       .default_fw_filename = "sof-adl.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-adl.ri",
+               [SOF_INTEL_IPC4] = "dsp_basefw.bin",
+       },
        .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
        .ops = &sof_tgl_ops,
 };
index 18cf9f3..38ce6fd 100644 (file)
@@ -227,7 +227,9 @@ static const struct sof_dev_desc tng_desc = {
        .default_tplg_path = {
                [SOF_IPC] = "intel/sof-tplg",
        },
-       .default_fw_filename = "sof-byt.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-byt.ri",
+       },
        .nocodec_tplg_filename = "sof-byt.tplg",
        .ops = &sof_tng_ops,
 };
index 7291538..5085a3a 100644 (file)
@@ -448,7 +448,9 @@ static const struct sof_dev_desc sof_of_mt8195_desc = {
        .default_tplg_path = {
                [SOF_IPC] = "mediatek/sof-tplg",
        },
-       .default_fw_filename = "sof-mt8195.ri",
+       .default_fw_filename = {
+               [SOF_IPC] = "sof-mt8195.ri",
+       },
        .nocodec_tplg_filename = "sof-mt8195-nocodec.tplg",
        .ops = &sof_mt8195_ops,
 };
index 8bbc0c5..1b04dcb 100644 (file)
@@ -74,7 +74,7 @@ int sof_acpi_probe(struct platform_device *pdev, const struct sof_dev_desc *desc
 
        sof_pdata->desc = desc;
        sof_pdata->dev = &pdev->dev;
-       sof_pdata->fw_filename = desc->default_fw_filename;
+       sof_pdata->fw_filename = desc->default_fw_filename[SOF_IPC];
 
        /* alternate fw and tplg filenames ? */
        if (fw_path)
index 9e2fb9a..53faecc 100644 (file)
@@ -64,7 +64,7 @@ int sof_of_probe(struct platform_device *pdev)
 
        sof_pdata->desc = desc;
        sof_pdata->dev = &pdev->dev;
-       sof_pdata->fw_filename = desc->default_fw_filename;
+       sof_pdata->fw_filename = desc->default_fw_filename[SOF_IPC];
 
        if (fw_path)
                sof_pdata->fw_filename_prefix = fw_path;
index a0a7fa6..470c0ac 100644 (file)
@@ -173,7 +173,9 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
        sof_pdata->name = pci_name(pci);
        sof_pdata->desc = desc;
        sof_pdata->dev = dev;
-       sof_pdata->fw_filename = desc->default_fw_filename;
+
+       sof_pdata->ipc_type = desc->ipc_default;
+       sof_pdata->fw_filename = desc->default_fw_filename[sof_pdata->ipc_type];
 
        /*
         * for platforms using the SOF community key, change the
@@ -193,7 +195,7 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
        } else if (dmi_check_system(community_key_platforms)) {
                sof_pdata->fw_filename_prefix =
                        devm_kasprintf(dev, GFP_KERNEL, "%s/%s",
-                                      sof_pdata->desc->default_fw_path[SOF_IPC],
+                                      sof_pdata->desc->default_fw_path[sof_pdata->ipc_type],
                                       "community");
 
                dev_dbg(dev,
@@ -201,14 +203,14 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                        sof_pdata->fw_filename_prefix);
        } else {
                sof_pdata->fw_filename_prefix =
-                       sof_pdata->desc->default_fw_path[SOF_IPC];
+                       sof_pdata->desc->default_fw_path[sof_pdata->ipc_type];
        }
 
        if (tplg_path)
                sof_pdata->tplg_filename_prefix = tplg_path;
        else
                sof_pdata->tplg_filename_prefix =
-                       sof_pdata->desc->default_tplg_path[SOF_IPC];
+                       sof_pdata->desc->default_tplg_path[sof_pdata->ipc_type];
 
        dmi_check_system(sof_tplg_table);
        if (sof_override_tplg_name)