From 001cb1064bae11ef4c08b6ad3d682fc148e6e097 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 13 Apr 2023 09:22:59 +0300 Subject: [PATCH 01/27] ASoC: SOF: Introduce generic names for IPC types Change the enum names for the IPC types to be more descriptive and drop tying the IPC4 to Intel SoCs. Add defines to avoid build breakage while the related code is modified to use the new enum names. Signed-off-by: Peter Ujfalusi --- include/sound/sof.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/sound/sof.h b/include/sound/sof.h index d3c41f87ac3191..6bc5e56ed3e0c2 100644 --- a/include/sound/sof.h +++ b/include/sound/sof.h @@ -52,11 +52,14 @@ enum sof_dsp_power_states { /* Definitions for multiple IPCs */ enum sof_ipc_type { - SOF_IPC, - SOF_INTEL_IPC4, + SOF_IPC_TYPE_3, + SOF_IPC_TYPE_4, SOF_IPC_TYPE_COUNT }; +#define SOF_IPC SOF_IPC_TYPE_3 +#define SOF_INTEL_IPC4 SOF_IPC_TYPE_4 + /* * SOF Platform data. */ From 3e43cf43ea4c0a2e6737d0bd72bbfc3e4b20119f Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 13 Apr 2023 09:27:53 +0300 Subject: [PATCH 02/27] ASoC: SOF: sof-pci-dev: Update the ipc_type module parameter description Clarify the description of the ipc_type module parameter and drop the Intel CAVS in favor of IPC4. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/sof-pci-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c index f5ece43d0ec247..54932f163b3924 100644 --- a/sound/soc/sof/sof-pci-dev.c +++ b/sound/soc/sof/sof-pci-dev.c @@ -46,7 +46,7 @@ MODULE_PARM_DESC(sof_pci_debug, "SOF PCI debug options (0x0 all off)"); static int sof_pci_ipc_type = -1; module_param_named(ipc_type, sof_pci_ipc_type, int, 0444); -MODULE_PARM_DESC(ipc_type, "SOF IPC type (0): SOF, (1) Intel CAVS"); +MODULE_PARM_DESC(ipc_type, "Force SOF IPC type. 0 - IPC3, 1 - IPC4"); static const char *sof_dmi_override_tplg_name; static bool sof_dmi_use_community_key; From abc3feb41b54e6cbba86ca1e29949e6a4e46763a Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 13 Apr 2023 09:37:03 +0300 Subject: [PATCH 03/27] ASoC: SOF: Kconfig: Rename SND_SOC_SOF_INTEL_IPC4 to SND_SOC_SOF_IPC4 Drop the Intel from the IPC type Kconfig option Signed-off-by: Peter Ujfalusi --- sound/soc/sof/Kconfig | 2 +- sound/soc/sof/Makefile | 4 ++-- sound/soc/sof/intel/Kconfig | 14 +++++++------- sound/soc/sof/ipc.c | 2 +- sound/soc/sof/sof-client-probes.c | 2 +- sound/soc/sof/sof-client.c | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig index a2725188f4ce48..ae101e7fd199a0 100644 --- a/sound/soc/sof/Kconfig +++ b/sound/soc/sof/Kconfig @@ -272,7 +272,7 @@ config SND_SOC_SOF_PROBE_WORK_QUEUE config SND_SOC_SOF_IPC3 bool -config SND_SOC_SOF_INTEL_IPC4 +config SND_SOC_SOF_IPC4 bool source "sound/soc/sof/amd/Kconfig" diff --git a/sound/soc/sof/Makefile b/sound/soc/sof/Makefile index 308d8763991636..75a5a5bb063d12 100644 --- a/sound/soc/sof/Makefile +++ b/sound/soc/sof/Makefile @@ -8,7 +8,7 @@ ifneq ($(CONFIG_SND_SOC_SOF_IPC3),) snd-sof-objs += ipc3.o ipc3-loader.o ipc3-topology.o ipc3-control.o ipc3-pcm.o\ ipc3-dtrace.o endif -ifneq ($(CONFIG_SND_SOC_SOF_INTEL_IPC4),) +ifneq ($(CONFIG_SND_SOC_SOF_IPC4),) snd-sof-objs += ipc4.o ipc4-loader.o ipc4-topology.o ipc4-control.o ipc4-pcm.o\ ipc4-mtrace.o endif @@ -30,7 +30,7 @@ snd-sof-probes-objs := sof-client-probes.o ifneq ($(CONFIG_SND_SOC_SOF_IPC3),) snd-sof-probes-objs += sof-client-probes-ipc3.o endif -ifneq ($(CONFIG_SND_SOC_SOF_INTEL_IPC4),) +ifneq ($(CONFIG_SND_SOC_SOF_IPC4),) snd-sof-probes-objs += sof-client-probes-ipc4.o endif diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig index ff45e28712d783..16704359593ac7 100644 --- a/sound/soc/sof/intel/Kconfig +++ b/sound/soc/sof/intel/Kconfig @@ -98,7 +98,7 @@ config SND_SOC_SOF_MERRIFIELD config SND_SOC_SOF_INTEL_SKL tristate select SND_SOC_SOF_HDA_COMMON - select SND_SOC_SOF_INTEL_IPC4 + select SND_SOC_SOF_IPC4 config SND_SOC_SOF_SKYLAKE tristate "SOF support for SkyLake" @@ -124,7 +124,7 @@ config SND_SOC_SOF_INTEL_APL tristate select SND_SOC_SOF_HDA_COMMON select SND_SOC_SOF_IPC3 - select SND_SOC_SOF_INTEL_IPC4 + select SND_SOC_SOF_IPC4 config SND_SOC_SOF_APOLLOLAKE tristate "SOF support for Apollolake" @@ -151,7 +151,7 @@ config SND_SOC_SOF_INTEL_CNL select SND_SOC_SOF_HDA_COMMON select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE select SND_SOC_SOF_IPC3 - select SND_SOC_SOF_INTEL_IPC4 + select SND_SOC_SOF_IPC4 config SND_SOC_SOF_CANNONLAKE tristate "SOF support for Cannonlake" @@ -187,7 +187,7 @@ config SND_SOC_SOF_INTEL_ICL select SND_SOC_SOF_HDA_COMMON select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE select SND_SOC_SOF_IPC3 - select SND_SOC_SOF_INTEL_IPC4 + select SND_SOC_SOF_IPC4 config SND_SOC_SOF_ICELAKE tristate "SOF support for Icelake" @@ -214,7 +214,7 @@ config SND_SOC_SOF_INTEL_TGL select SND_SOC_SOF_HDA_COMMON select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE select SND_SOC_SOF_IPC3 - select SND_SOC_SOF_INTEL_IPC4 + select SND_SOC_SOF_IPC4 config SND_SOC_SOF_TIGERLAKE tristate "SOF support for Tigerlake" @@ -250,7 +250,7 @@ config SND_SOC_SOF_INTEL_MTL tristate select SND_SOC_SOF_HDA_COMMON select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE - select SND_SOC_SOF_INTEL_IPC4 + select SND_SOC_SOF_IPC4 config SND_SOC_SOF_METEORLAKE tristate "SOF support for Meteorlake" @@ -266,7 +266,7 @@ config SND_SOC_SOF_INTEL_LNL tristate select SND_SOC_SOF_HDA_COMMON select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE - select SND_SOC_SOF_INTEL_IPC4 + select SND_SOC_SOF_IPC4 config SND_SOC_SOF_LUNARLAKE tristate "SOF support for Lunarlake" diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index b53abc92302669..8a7eb3cb019a68 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -169,7 +169,7 @@ struct snd_sof_ipc *snd_sof_ipc_init(struct snd_sof_dev *sdev) ops = &ipc3_ops; break; #endif -#if defined(CONFIG_SND_SOC_SOF_INTEL_IPC4) +#if defined(CONFIG_SND_SOC_SOF_IPC4) case SOF_INTEL_IPC4: ops = &ipc4_ops; break; diff --git a/sound/soc/sof/sof-client-probes.c b/sound/soc/sof/sof-client-probes.c index 8d9e9d5f40e45b..46562fe95ac8a4 100644 --- a/sound/soc/sof/sof-client-probes.c +++ b/sound/soc/sof/sof-client-probes.c @@ -419,7 +419,7 @@ static int sof_probes_client_probe(struct auxiliary_device *auxdev, priv->host_ops = ops; switch (sof_client_get_ipc_type(cdev)) { -#ifdef CONFIG_SND_SOC_SOF_INTEL_IPC4 +#ifdef CONFIG_SND_SOC_SOF_IPC4 case SOF_INTEL_IPC4: priv->ipc_ops = &ipc4_probe_ops; break; diff --git a/sound/soc/sof/sof-client.c b/sound/soc/sof/sof-client.c index d6b7caa0cf0317..7fd29d0788e05d 100644 --- a/sound/soc/sof/sof-client.c +++ b/sound/soc/sof/sof-client.c @@ -288,7 +288,7 @@ int sof_client_ipc_set_get_data(struct sof_client_dev *cdev, void *ipc_msg, } EXPORT_SYMBOL_NS_GPL(sof_client_ipc_set_get_data, SND_SOC_SOF_CLIENT); -#ifdef CONFIG_SND_SOC_SOF_INTEL_IPC4 +#ifdef CONFIG_SND_SOC_SOF_IPC4 struct sof_ipc4_fw_module *sof_client_ipc4_find_module(struct sof_client_dev *c, const guid_t *uuid) { struct snd_sof_dev *sdev = c->sdev; From f73322392db4c3fe6ad231b024f97f2f4ce0bee5 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 13 Apr 2023 13:16:59 +0300 Subject: [PATCH 04/27] ASoC: SOF: Use generic names for IPC types Use the new SOF_IPC_TYPE_3, SOF_IPC_TYPE_4 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/ipc.c | 4 ++-- sound/soc/sof/ipc3-dtrace.c | 2 +- sound/soc/sof/sof-acpi-dev.c | 8 +++----- sound/soc/sof/sof-client-ipc-msg-injector.c | 4 ++-- sound/soc/sof/sof-client-probes.c | 4 ++-- sound/soc/sof/sof-client.c | 20 ++++++++++---------- sound/soc/sof/sof-of-dev.c | 6 +++--- 7 files changed, 23 insertions(+), 25 deletions(-) diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index 8a7eb3cb019a68..febe372f9aa876 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -165,12 +165,12 @@ struct snd_sof_ipc *snd_sof_ipc_init(struct snd_sof_dev *sdev) switch (sdev->pdata->ipc_type) { #if defined(CONFIG_SND_SOC_SOF_IPC3) - case SOF_IPC: + case SOF_IPC_TYPE_3: ops = &ipc3_ops; break; #endif #if defined(CONFIG_SND_SOC_SOF_IPC4) - case SOF_INTEL_IPC4: + case SOF_IPC_TYPE_4: ops = &ipc4_ops; break; #endif diff --git a/sound/soc/sof/ipc3-dtrace.c b/sound/soc/sof/ipc3-dtrace.c index 1d3bca2d28dd61..7f240c1ba319e4 100644 --- a/sound/soc/sof/ipc3-dtrace.c +++ b/sound/soc/sof/ipc3-dtrace.c @@ -501,7 +501,7 @@ static int ipc3_dtrace_init(struct snd_sof_dev *sdev) int ret; /* dtrace is only supported with SOF_IPC */ - if (sdev->pdata->ipc_type != SOF_IPC) + if (sdev->pdata->ipc_type != SOF_IPC_TYPE_3) return -EOPNOTSUPP; if (sdev->fw_trace_data) { diff --git a/sound/soc/sof/sof-acpi-dev.c b/sound/soc/sof/sof-acpi-dev.c index 1b04dcb332935f..5c4e5ab31abff7 100644 --- a/sound/soc/sof/sof-acpi-dev.c +++ b/sound/soc/sof/sof-acpi-dev.c @@ -74,20 +74,18 @@ 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_IPC]; + sof_pdata->fw_filename = desc->default_fw_filename[SOF_IPC_TYPE_3]; /* alternate fw and tplg filenames ? */ if (fw_path) sof_pdata->fw_filename_prefix = fw_path; else - sof_pdata->fw_filename_prefix = - sof_pdata->desc->default_fw_path[SOF_IPC]; + sof_pdata->fw_filename_prefix = desc->default_fw_path[SOF_IPC_TYPE_3]; 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->tplg_filename_prefix = desc->default_tplg_path[SOF_IPC_TYPE_3]; /* set callback to be called on successful device probe to enable runtime_pm */ sof_pdata->sof_probe_complete = sof_acpi_probe_complete; diff --git a/sound/soc/sof/sof-client-ipc-msg-injector.c b/sound/soc/sof/sof-client-ipc-msg-injector.c index 752d5320680f14..e249d3a9afb59d 100644 --- a/sound/soc/sof/sof-client-ipc-msg-injector.c +++ b/sound/soc/sof/sof-client-ipc-msg-injector.c @@ -267,7 +267,7 @@ static int sof_msg_inject_probe(struct auxiliary_device *auxdev, priv->max_msg_size = sof_client_get_ipc_max_payload_size(cdev); alloc_size = priv->max_msg_size; - if (priv->ipc_type == SOF_INTEL_IPC4) + if (priv->ipc_type == SOF_IPC_TYPE_4) alloc_size += sizeof(struct sof_ipc4_msg); priv->tx_buffer = devm_kmalloc(dev, alloc_size, GFP_KERNEL); @@ -275,7 +275,7 @@ static int sof_msg_inject_probe(struct auxiliary_device *auxdev, if (!priv->tx_buffer || !priv->rx_buffer) return -ENOMEM; - if (priv->ipc_type == SOF_INTEL_IPC4) { + if (priv->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_msg *ipc4_msg; ipc4_msg = priv->tx_buffer; diff --git a/sound/soc/sof/sof-client-probes.c b/sound/soc/sof/sof-client-probes.c index 46562fe95ac8a4..1744760af664cf 100644 --- a/sound/soc/sof/sof-client-probes.c +++ b/sound/soc/sof/sof-client-probes.c @@ -420,12 +420,12 @@ static int sof_probes_client_probe(struct auxiliary_device *auxdev, switch (sof_client_get_ipc_type(cdev)) { #ifdef CONFIG_SND_SOC_SOF_IPC4 - case SOF_INTEL_IPC4: + case SOF_IPC_TYPE_4: priv->ipc_ops = &ipc4_probe_ops; break; #endif #ifdef CONFIG_SND_SOC_SOF_IPC3 - case SOF_IPC: + case SOF_IPC_TYPE_3: priv->ipc_ops = &ipc3_probe_ops; break; #endif diff --git a/sound/soc/sof/sof-client.c b/sound/soc/sof/sof-client.c index 7fd29d0788e05d..f5cbdf93a383b3 100644 --- a/sound/soc/sof/sof-client.c +++ b/sound/soc/sof/sof-client.c @@ -74,7 +74,7 @@ static int sof_register_ipc_flood_test(struct snd_sof_dev *sdev) int ret = 0; int i; - if (sdev->pdata->ipc_type != SOF_IPC) + if (sdev->pdata->ipc_type != SOF_IPC_TYPE_3) return 0; for (i = 0; i < CONFIG_SND_SOC_SOF_DEBUG_IPC_FLOOD_TEST_NUM; i++) { @@ -253,12 +253,12 @@ EXPORT_SYMBOL_NS_GPL(sof_client_dev_unregister, SND_SOC_SOF_CLIENT); int sof_client_ipc_tx_message(struct sof_client_dev *cdev, void *ipc_msg, void *reply_data, size_t reply_bytes) { - if (cdev->sdev->pdata->ipc_type == SOF_IPC) { + if (cdev->sdev->pdata->ipc_type == SOF_IPC_TYPE_3) { struct sof_ipc_cmd_hdr *hdr = ipc_msg; return sof_ipc_tx_message(cdev->sdev->ipc, ipc_msg, hdr->size, reply_data, reply_bytes); - } else if (cdev->sdev->pdata->ipc_type == SOF_INTEL_IPC4) { + } else if (cdev->sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_msg *msg = ipc_msg; return sof_ipc_tx_message(cdev->sdev->ipc, ipc_msg, msg->data_size, @@ -272,12 +272,12 @@ EXPORT_SYMBOL_NS_GPL(sof_client_ipc_tx_message, SND_SOC_SOF_CLIENT); int sof_client_ipc_set_get_data(struct sof_client_dev *cdev, void *ipc_msg, bool set) { - if (cdev->sdev->pdata->ipc_type == SOF_IPC) { + if (cdev->sdev->pdata->ipc_type == SOF_IPC_TYPE_3) { struct sof_ipc_cmd_hdr *hdr = ipc_msg; return sof_ipc_set_get_data(cdev->sdev->ipc, ipc_msg, hdr->size, set); - } else if (cdev->sdev->pdata->ipc_type == SOF_INTEL_IPC4) { + } else if (cdev->sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_msg *msg = ipc_msg; return sof_ipc_set_get_data(cdev->sdev->ipc, ipc_msg, @@ -293,7 +293,7 @@ struct sof_ipc4_fw_module *sof_client_ipc4_find_module(struct sof_client_dev *c, { struct snd_sof_dev *sdev = c->sdev; - if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) return sof_ipc4_find_module_by_uuid(sdev, uuid); dev_err(sdev->dev, "Only supported with IPC4\n"); @@ -411,11 +411,11 @@ void sof_client_ipc_rx_dispatcher(struct snd_sof_dev *sdev, void *msg_buf) struct sof_ipc_event_entry *event; u32 msg_type; - if (sdev->pdata->ipc_type == SOF_IPC) { + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_3) { struct sof_ipc_cmd_hdr *hdr = msg_buf; msg_type = hdr->cmd & SOF_GLB_TYPE_MASK; - } else if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) { + } else if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_msg *msg = msg_buf; msg_type = SOF_IPC4_NOTIFICATION_TYPE_GET(msg->primary); @@ -445,10 +445,10 @@ int sof_client_register_ipc_rx_handler(struct sof_client_dev *cdev, if (!callback) return -EINVAL; - if (cdev->sdev->pdata->ipc_type == SOF_IPC) { + if (cdev->sdev->pdata->ipc_type == SOF_IPC_TYPE_3) { if (!(ipc_msg_type & SOF_GLB_TYPE_MASK)) return -EINVAL; - } else if (cdev->sdev->pdata->ipc_type == SOF_INTEL_IPC4) { + } else if (cdev->sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { if (!(ipc_msg_type & SOF_IPC4_NOTIFICATION_TYPE_MASK)) return -EINVAL; } else { diff --git a/sound/soc/sof/sof-of-dev.c b/sound/soc/sof/sof-of-dev.c index 53faeccedd4f0d..b0e8bd06f78ae5 100644 --- a/sound/soc/sof/sof-of-dev.c +++ b/sound/soc/sof/sof-of-dev.c @@ -64,17 +64,17 @@ 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_IPC]; + sof_pdata->fw_filename = desc->default_fw_filename[SOF_IPC_TYPE_3]; if (fw_path) sof_pdata->fw_filename_prefix = fw_path; else - sof_pdata->fw_filename_prefix = sof_pdata->desc->default_fw_path[SOF_IPC]; + sof_pdata->fw_filename_prefix = desc->default_fw_path[SOF_IPC_TYPE_3]; 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->tplg_filename_prefix = desc->default_tplg_path[SOF_IPC_TYPE_3]; /* set callback to be called on successful device probe to enable runtime_pm */ sof_pdata->sof_probe_complete = sof_of_probe_complete; From a0518e99fadd2215c96a3f26772ff0b4f60cd029 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 13 Apr 2023 13:18:12 +0300 Subject: [PATCH 05/27] ASoC: SOF: amd: Use generic names for IPC types Use the new SOF_IPC_TYPE_3 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/amd/pci-rmb.c | 10 +++++----- sound/soc/sof/amd/pci-rn.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/soc/sof/amd/pci-rmb.c b/sound/soc/sof/amd/pci-rmb.c index eaf70ea6e556e9..5cae889f9b35c2 100644 --- a/sound/soc/sof/amd/pci-rmb.c +++ b/sound/soc/sof/amd/pci-rmb.c @@ -45,16 +45,16 @@ static const struct sof_dev_desc rembrandt_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &rembrandt_chip_info, - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "amd/sof", + [SOF_IPC_TYPE_3] = "amd/sof", }, .default_tplg_path = { - [SOF_IPC] = "amd/sof-tplg", + [SOF_IPC_TYPE_3] = "amd/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-rmb.ri", + [SOF_IPC_TYPE_3] = "sof-rmb.ri", }, .nocodec_tplg_filename = "sof-acp.tplg", .ops = &sof_rembrandt_ops, diff --git a/sound/soc/sof/amd/pci-rn.c b/sound/soc/sof/amd/pci-rn.c index 4809cb644152b1..42170bd9aacc3e 100644 --- a/sound/soc/sof/amd/pci-rn.c +++ b/sound/soc/sof/amd/pci-rn.c @@ -45,16 +45,16 @@ static const struct sof_dev_desc renoir_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &renoir_chip_info, - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "amd/sof", + [SOF_IPC_TYPE_3] = "amd/sof", }, .default_tplg_path = { - [SOF_IPC] = "amd/sof-tplg", + [SOF_IPC_TYPE_3] = "amd/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-rn.ri", + [SOF_IPC_TYPE_3] = "sof-rn.ri", }, .nocodec_tplg_filename = "sof-acp.tplg", .ops = &sof_renoir_ops, From b8d748341003ff1499a08fe689a786d5da957636 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 13 Apr 2023 13:19:11 +0300 Subject: [PATCH 06/27] ASoC: SOF: imx: Use generic names for IPC types Use the new SOF_IPC_TYPE_3 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/imx/imx8.c | 20 ++++++++++---------- sound/soc/sof/imx/imx8m.c | 10 +++++----- sound/soc/sof/imx/imx8ulp.c | 10 +++++----- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index 2844d9a8040ad9..65a7041cbab9d7 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -609,32 +609,32 @@ static struct snd_sof_dsp_ops sof_imx8x_ops = { }; static struct sof_dev_desc sof_of_imx8qxp_desc = { - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "imx/sof", + [SOF_IPC_TYPE_3] = "imx/sof", }, .default_tplg_path = { - [SOF_IPC] = "imx/sof-tplg", + [SOF_IPC_TYPE_3] = "imx/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-imx8x.ri", + [SOF_IPC_TYPE_3] = "sof-imx8x.ri", }, .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", .ops = &sof_imx8x_ops, }; static struct sof_dev_desc sof_of_imx8qm_desc = { - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "imx/sof", + [SOF_IPC_TYPE_3] = "imx/sof", }, .default_tplg_path = { - [SOF_IPC] = "imx/sof-tplg", + [SOF_IPC_TYPE_3] = "imx/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-imx8.ri", + [SOF_IPC_TYPE_3] = "sof-imx8.ri", }, .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", .ops = &sof_imx8_ops, diff --git a/sound/soc/sof/imx/imx8m.c b/sound/soc/sof/imx/imx8m.c index 1243f8a6141eaa..9d58dda8f079d1 100644 --- a/sound/soc/sof/imx/imx8m.c +++ b/sound/soc/sof/imx/imx8m.c @@ -471,16 +471,16 @@ static struct snd_sof_dsp_ops sof_imx8m_ops = { }; static struct sof_dev_desc sof_of_imx8mp_desc = { - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "imx/sof", + [SOF_IPC_TYPE_3] = "imx/sof", }, .default_tplg_path = { - [SOF_IPC] = "imx/sof-tplg", + [SOF_IPC_TYPE_3] = "imx/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-imx8m.ri", + [SOF_IPC_TYPE_3] = "sof-imx8m.ri", }, .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", .ops = &sof_imx8m_ops, diff --git a/sound/soc/sof/imx/imx8ulp.c b/sound/soc/sof/imx/imx8ulp.c index 4a562c9856e93c..2673c1d4ddea16 100644 --- a/sound/soc/sof/imx/imx8ulp.c +++ b/sound/soc/sof/imx/imx8ulp.c @@ -478,16 +478,16 @@ static struct snd_sof_dsp_ops sof_imx8ulp_ops = { }; static struct sof_dev_desc sof_of_imx8ulp_desc = { - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "imx/sof", + [SOF_IPC_TYPE_3] = "imx/sof", }, .default_tplg_path = { - [SOF_IPC] = "imx/sof-tplg", + [SOF_IPC_TYPE_3] = "imx/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-imx8ulp.ri", + [SOF_IPC_TYPE_3] = "sof-imx8ulp.ri", }, .nocodec_tplg_filename = "sof-imx8ulp-nocodec.tplg", .ops = &sof_imx8ulp_ops, From e1ee3e748e26b4edc8ecdb6f279043a752e2332d Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 13 Apr 2023 13:25:27 +0300 Subject: [PATCH 07/27] ASoC: SOF: Intel: Use generic names for IPC types Use the new SOF_IPC_TYPE_3, SOF_IPC_TYPE_4 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/intel/apl.c | 4 +- sound/soc/sof/intel/bdw.c | 10 +-- sound/soc/sof/intel/byt.c | 30 +++---- sound/soc/sof/intel/cnl.c | 4 +- sound/soc/sof/intel/hda-dai-ops.c | 4 +- sound/soc/sof/intel/hda-dai.c | 4 +- sound/soc/sof/intel/hda-loader.c | 2 +- sound/soc/sof/intel/hda.c | 2 +- sound/soc/sof/intel/icl.c | 4 +- sound/soc/sof/intel/pci-apl.c | 36 ++++---- sound/soc/sof/intel/pci-cnl.c | 54 +++++------ sound/soc/sof/intel/pci-icl.c | 36 ++++---- sound/soc/sof/intel/pci-mtl.c | 12 +-- sound/soc/sof/intel/pci-skl.c | 20 ++--- sound/soc/sof/intel/pci-tgl.c | 144 +++++++++++++++--------------- sound/soc/sof/intel/pci-tng.c | 10 +-- sound/soc/sof/intel/tgl.c | 4 +- 17 files changed, 190 insertions(+), 190 deletions(-) diff --git a/sound/soc/sof/intel/apl.c b/sound/soc/sof/intel/apl.c index e1f25a8f0c3262..776b66389c345b 100644 --- a/sound/soc/sof/intel/apl.c +++ b/sound/soc/sof/intel/apl.c @@ -39,7 +39,7 @@ int sof_apl_ops_init(struct snd_sof_dev *sdev) /* probe/remove/shutdown */ sof_apl_ops.shutdown = hda_dsp_shutdown; - if (sdev->pdata->ipc_type == SOF_IPC) { + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_3) { /* doorbell */ sof_apl_ops.irq_thread = hda_dsp_ipc_irq_thread; @@ -52,7 +52,7 @@ int sof_apl_ops_init(struct snd_sof_dev *sdev) sof_apl_ops.set_power_state = hda_dsp_set_power_state_ipc3; } - if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) { + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; sdev->private = devm_kzalloc(sdev->dev, sizeof(*ipc4_data), GFP_KERNEL); diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c index 812a49b1d3f496..511fce8e0e198b 100644 --- a/sound/soc/sof/intel/bdw.c +++ b/sound/soc/sof/intel/bdw.c @@ -639,16 +639,16 @@ static const struct sof_dev_desc sof_acpi_broadwell_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = 0, .chip_info = &bdw_chip_info, - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "intel/sof", + [SOF_IPC_TYPE_3] = "intel/sof", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-bdw.ri", + [SOF_IPC_TYPE_3] = "sof-bdw.ri", }, .nocodec_tplg_filename = "sof-bdw-nocodec.tplg", .ops = &sof_bdw_ops, diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c index faf223b383605b..a976dc91d2ec69 100644 --- a/sound/soc/sof/intel/byt.c +++ b/sound/soc/sof/intel/byt.c @@ -374,16 +374,16 @@ static const struct sof_dev_desc sof_acpi_baytrailcr_desc = { .resindex_imr_base = 2, .irqindex_host_ipc = 0, .chip_info = &byt_chip_info, - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "intel/sof", + [SOF_IPC_TYPE_3] = "intel/sof", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-byt.ri", + [SOF_IPC_TYPE_3] = "sof-byt.ri", }, .nocodec_tplg_filename = "sof-byt-nocodec.tplg", .ops = &sof_byt_ops, @@ -396,16 +396,16 @@ static const struct sof_dev_desc sof_acpi_baytrail_desc = { .resindex_imr_base = 2, .irqindex_host_ipc = 5, .chip_info = &byt_chip_info, - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "intel/sof", + [SOF_IPC_TYPE_3] = "intel/sof", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-byt.ri", + [SOF_IPC_TYPE_3] = "sof-byt.ri", }, .nocodec_tplg_filename = "sof-byt-nocodec.tplg", .ops = &sof_byt_ops, @@ -418,16 +418,16 @@ static const struct sof_dev_desc sof_acpi_cherrytrail_desc = { .resindex_imr_base = 2, .irqindex_host_ipc = 5, .chip_info = &cht_chip_info, - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "intel/sof", + [SOF_IPC_TYPE_3] = "intel/sof", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-cht.ri", + [SOF_IPC_TYPE_3] = "sof-cht.ri", }, .nocodec_tplg_filename = "sof-cht-nocodec.tplg", .ops = &sof_cht_ops, diff --git a/sound/soc/sof/intel/cnl.c b/sound/soc/sof/intel/cnl.c index a95222e53ecf30..bb1a3aa78da44a 100644 --- a/sound/soc/sof/intel/cnl.c +++ b/sound/soc/sof/intel/cnl.c @@ -386,7 +386,7 @@ int sof_cnl_ops_init(struct snd_sof_dev *sdev) sof_cnl_ops.shutdown = hda_dsp_shutdown; /* ipc */ - if (sdev->pdata->ipc_type == SOF_IPC) { + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_3) { /* doorbell */ sof_cnl_ops.irq_thread = cnl_ipc_irq_thread; @@ -399,7 +399,7 @@ int sof_cnl_ops_init(struct snd_sof_dev *sdev) sof_cnl_ops.set_power_state = hda_dsp_set_power_state_ipc3; } - if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) { + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; sdev->private = devm_kzalloc(sdev->dev, sizeof(*ipc4_data), GFP_KERNEL); diff --git a/sound/soc/sof/intel/hda-dai-ops.c b/sound/soc/sof/intel/hda-dai-ops.c index 24325c22c1ea2d..b8cef34e1601bf 100644 --- a/sound/soc/sof/intel/hda-dai-ops.c +++ b/sound/soc/sof/intel/hda-dai-ops.c @@ -448,7 +448,7 @@ hda_select_dai_widget_ops(struct snd_sof_dev *sdev, struct snd_sof_widget *swidg sdai = swidget->private; switch (sdev->pdata->ipc_type) { - case SOF_IPC: + case SOF_IPC_TYPE_3: { struct sof_dai_private_data *private = sdai->private; @@ -456,7 +456,7 @@ hda_select_dai_widget_ops(struct snd_sof_dev *sdev, struct snd_sof_widget *swidg return &hda_ipc3_dma_ops; break; } - case SOF_INTEL_IPC4: + case SOF_IPC_TYPE_4: { struct sof_ipc4_copier *ipc4_copier = sdai->private; diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c index f4c8d8d28d1d65..67a43b33699599 100644 --- a/sound/soc/sof/intel/hda-dai.c +++ b/sound/soc/sof/intel/hda-dai.c @@ -378,7 +378,7 @@ void hda_set_dai_drv_ops(struct snd_sof_dev *sdev, struct snd_sof_dsp_ops *ops) #endif } - if (sdev->pdata->ipc_type == SOF_INTEL_IPC4 && !hda_use_tplg_nhlt) { + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4 && !hda_use_tplg_nhlt) { struct sof_ipc4_fw_data *ipc4_data = sdev->private; ipc4_data->nhlt = intel_nhlt_init(sdev->dev); @@ -387,7 +387,7 @@ void hda_set_dai_drv_ops(struct snd_sof_dev *sdev, struct snd_sof_dsp_ops *ops) void hda_ops_free(struct snd_sof_dev *sdev) { - if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) { + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data = sdev->private; if (!hda_use_tplg_nhlt) diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c index 50ce6b190002e2..769697bdc3951a 100644 --- a/sound/soc/sof/intel/hda-loader.c +++ b/sound/soc/sof/intel/hda-loader.c @@ -605,7 +605,7 @@ int hda_dsp_post_fw_run(struct snd_sof_dev *sdev) /* Check if IMR boot is usable */ if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT) && (sdev->fw_ready.flags & SOF_IPC_INFO_D3_PERSISTENT || - sdev->pdata->ipc_type == SOF_INTEL_IPC4)) + sdev->pdata->ipc_type == SOF_IPC_TYPE_4)) hdev->imrboot_supported = true; } diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index e92acfd4e2f936..cec30947f9ab69 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -676,7 +676,7 @@ void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags) hda_dsp_get_state(sdev, level); /* The firmware register dump only available with IPC3 */ - if (flags & SOF_DBG_DUMP_REGS && sdev->pdata->ipc_type == SOF_IPC) { + if (flags & SOF_DBG_DUMP_REGS && sdev->pdata->ipc_type == SOF_IPC_TYPE_3) { u32 status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_FW_STATUS); u32 panic = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_FW_TRACEP); diff --git a/sound/soc/sof/intel/icl.c b/sound/soc/sof/intel/icl.c index 0f249efc6a5a28..996efe4da8c752 100644 --- a/sound/soc/sof/intel/icl.c +++ b/sound/soc/sof/intel/icl.c @@ -107,7 +107,7 @@ int sof_icl_ops_init(struct snd_sof_dev *sdev) /* probe/remove/shutdown */ sof_icl_ops.shutdown = hda_dsp_shutdown; - if (sdev->pdata->ipc_type == SOF_IPC) { + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_3) { /* doorbell */ sof_icl_ops.irq_thread = cnl_ipc_irq_thread; @@ -120,7 +120,7 @@ int sof_icl_ops_init(struct snd_sof_dev *sdev) sof_icl_ops.set_power_state = hda_dsp_set_power_state_ipc3; } - if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) { + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; sdev->private = devm_kzalloc(sdev->dev, sizeof(*ipc4_data), GFP_KERNEL); diff --git a/sound/soc/sof/intel/pci-apl.c b/sound/soc/sof/intel/pci-apl.c index 69cad5a6bc724e..0bdd881cac345e 100644 --- a/sound/soc/sof/intel/pci-apl.c +++ b/sound/soc/sof/intel/pci-apl.c @@ -27,23 +27,23 @@ static const struct sof_dev_desc bxt_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &apl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/apl", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/apl", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/apl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/apl", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-apl.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-apl.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-apl-nocodec.tplg", .ops = &sof_apl_ops, @@ -59,23 +59,23 @@ static const struct sof_dev_desc glk_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &apl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/glk", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/glk", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/glk", + [SOF_IPC_TYPE_4] = "intel/avs-lib/glk", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-glk.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-glk.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-glk-nocodec.tplg", .ops = &sof_apl_ops, diff --git a/sound/soc/sof/intel/pci-cnl.c b/sound/soc/sof/intel/pci-cnl.c index 8895508a0be6d7..2a5c88975dab81 100644 --- a/sound/soc/sof/intel/pci-cnl.c +++ b/sound/soc/sof/intel/pci-cnl.c @@ -28,23 +28,23 @@ static const struct sof_dev_desc cnl_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &cnl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/cnl", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/cnl", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/cnl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/cnl", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-cnl.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-cnl.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-cnl-nocodec.tplg", .ops = &sof_cnl_ops, @@ -61,23 +61,23 @@ static const struct sof_dev_desc cfl_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &cnl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/cnl", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/cnl", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/cnl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/cnl", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-cfl.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-cfl.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-cnl-nocodec.tplg", .ops = &sof_cnl_ops, @@ -94,23 +94,23 @@ static const struct sof_dev_desc cml_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &cnl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/cnl", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/cnl", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/cnl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/cnl", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-cml.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-cml.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-cnl-nocodec.tplg", .ops = &sof_cnl_ops, diff --git a/sound/soc/sof/intel/pci-icl.c b/sound/soc/sof/intel/pci-icl.c index 5fb5a820693e4a..a27b062f2c6a7f 100644 --- a/sound/soc/sof/intel/pci-icl.c +++ b/sound/soc/sof/intel/pci-icl.c @@ -28,23 +28,23 @@ static const struct sof_dev_desc icl_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &icl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/icl", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/icl", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/icl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/icl", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-icl.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-icl.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-icl-nocodec.tplg", .ops = &sof_icl_ops, @@ -60,23 +60,23 @@ static const struct sof_dev_desc jsl_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &jsl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/jsl", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/jsl", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/jsl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/jsl", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-jsl.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-jsl.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-jsl-nocodec.tplg", .ops = &sof_cnl_ops, diff --git a/sound/soc/sof/intel/pci-mtl.c b/sound/soc/sof/intel/pci-mtl.c index e276e1e37fed8e..e25f524a7925aa 100644 --- a/sound/soc/sof/intel/pci-mtl.c +++ b/sound/soc/sof/intel/pci-mtl.c @@ -29,20 +29,20 @@ static const struct sof_dev_desc mtl_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &mtl_chip_info, - .ipc_supported_mask = BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_INTEL_IPC4, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_4, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_INTEL_IPC4] = "intel/sof-ipc4/mtl", + [SOF_IPC_TYPE_4] = "intel/sof-ipc4/mtl", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/sof-ipc4-lib/mtl", + [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/mtl", }, .default_tplg_path = { - [SOF_INTEL_IPC4] = "intel/sof-ace-tplg", + [SOF_IPC_TYPE_4] = "intel/sof-ace-tplg", }, .default_fw_filename = { - [SOF_INTEL_IPC4] = "sof-mtl.ri", + [SOF_IPC_TYPE_4] = "sof-mtl.ri", }, .nocodec_tplg_filename = "sof-mtl-nocodec.tplg", .ops = &sof_mtl_ops, diff --git a/sound/soc/sof/intel/pci-skl.c b/sound/soc/sof/intel/pci-skl.c index 5e69af6eed344b..f42f3855f66d5a 100644 --- a/sound/soc/sof/intel/pci-skl.c +++ b/sound/soc/sof/intel/pci-skl.c @@ -24,17 +24,17 @@ static struct sof_dev_desc skl_desc = { .resindex_imr_base = -1, .chip_info = &skl_chip_info, .irqindex_host_ipc = -1, - .ipc_supported_mask = BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_INTEL_IPC4, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_4, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_INTEL_IPC4] = "intel/avs/skl", + [SOF_IPC_TYPE_4] = "intel/avs/skl", }, .default_tplg_path = { - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-skl-nocodec.tplg", .ops = &sof_skl_ops, @@ -49,17 +49,17 @@ static struct sof_dev_desc kbl_desc = { .resindex_imr_base = -1, .chip_info = &skl_chip_info, .irqindex_host_ipc = -1, - .ipc_supported_mask = BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_INTEL_IPC4, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_4, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_INTEL_IPC4] = "intel/avs/kbl", + [SOF_IPC_TYPE_4] = "intel/avs/kbl", }, .default_tplg_path = { - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-kbl-nocodec.tplg", .ops = &sof_skl_ops, diff --git a/sound/soc/sof/intel/pci-tgl.c b/sound/soc/sof/intel/pci-tgl.c index ca37ff1bbd2ae5..613119ec37a25b 100644 --- a/sound/soc/sof/intel/pci-tgl.c +++ b/sound/soc/sof/intel/pci-tgl.c @@ -28,23 +28,23 @@ static const struct sof_dev_desc tgl_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &tgl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/tgl", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/tgl", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/tgl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/tgl", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-tgl.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-tgl.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-tgl-nocodec.tplg", .ops = &sof_tgl_ops, @@ -61,23 +61,23 @@ static const struct sof_dev_desc tglh_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &tglh_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/tgl-h", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/tgl-h", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/tgl-h", + [SOF_IPC_TYPE_4] = "intel/avs-lib/tgl-h", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-tgl-h.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-tgl-h.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-tgl-nocodec.tplg", .ops = &sof_tgl_ops, @@ -93,23 +93,23 @@ static const struct sof_dev_desc ehl_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &ehl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/ehl", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/ehl", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/ehl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/ehl", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-ehl.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-ehl.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-ehl-nocodec.tplg", .ops = &sof_tgl_ops, @@ -126,23 +126,23 @@ static const struct sof_dev_desc adls_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &adls_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/adl-s", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/adl-s", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/adl-s", + [SOF_IPC_TYPE_4] = "intel/avs-lib/adl-s", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-adl-s.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-adl-s.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-adl-nocodec.tplg", .ops = &sof_tgl_ops, @@ -159,23 +159,23 @@ static const struct sof_dev_desc adl_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &tgl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/adl", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/adl", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/adl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/adl", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-adl.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-adl.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-adl-nocodec.tplg", .ops = &sof_tgl_ops, @@ -192,23 +192,23 @@ static const struct sof_dev_desc adl_n_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &tgl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/adl-n", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/adl-n", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/adl-n", + [SOF_IPC_TYPE_4] = "intel/avs-lib/adl-n", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-adl-n.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-adl-n.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-adl-nocodec.tplg", .ops = &sof_tgl_ops, @@ -225,23 +225,23 @@ static const struct sof_dev_desc rpls_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &adls_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/rpl-s", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/rpl-s", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/rpl-s", + [SOF_IPC_TYPE_4] = "intel/avs-lib/rpl-s", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-rpl-s.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-rpl-s.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-rpl-nocodec.tplg", .ops = &sof_tgl_ops, @@ -258,23 +258,23 @@ static const struct sof_dev_desc rpl_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &tgl_chip_info, - .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC] = "intel/sof", - [SOF_INTEL_IPC4] = "intel/avs/rpl", + [SOF_IPC_TYPE_3] = "intel/sof", + [SOF_IPC_TYPE_4] = "intel/avs/rpl", }, .default_lib_path = { - [SOF_INTEL_IPC4] = "intel/avs-lib/rpl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/rpl", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", - [SOF_INTEL_IPC4] = "intel/avs-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", + [SOF_IPC_TYPE_4] = "intel/avs-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-rpl.ri", - [SOF_INTEL_IPC4] = "dsp_basefw.bin", + [SOF_IPC_TYPE_3] = "sof-rpl.ri", + [SOF_IPC_TYPE_4] = "dsp_basefw.bin", }, .nocodec_tplg_filename = "sof-rpl-nocodec.tplg", .ops = &sof_tgl_ops, diff --git a/sound/soc/sof/intel/pci-tng.c b/sound/soc/sof/intel/pci-tng.c index 8c22a00266c06a..e124a36f7e4e66 100644 --- a/sound/soc/sof/intel/pci-tng.c +++ b/sound/soc/sof/intel/pci-tng.c @@ -208,16 +208,16 @@ static const struct sof_dev_desc tng_desc = { .resindex_imr_base = 0, .irqindex_host_ipc = -1, .chip_info = &tng_chip_info, - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "intel/sof", + [SOF_IPC_TYPE_3] = "intel/sof", }, .default_tplg_path = { - [SOF_IPC] = "intel/sof-tplg", + [SOF_IPC_TYPE_3] = "intel/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-byt.ri", + [SOF_IPC_TYPE_3] = "sof-byt.ri", }, .nocodec_tplg_filename = "sof-byt.tplg", .ops = &sof_tng_ops, diff --git a/sound/soc/sof/intel/tgl.c b/sound/soc/sof/intel/tgl.c index 8e2b07e1612b76..c6627deab708d2 100644 --- a/sound/soc/sof/intel/tgl.c +++ b/sound/soc/sof/intel/tgl.c @@ -66,7 +66,7 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev) /* probe/remove/shutdown */ sof_tgl_ops.shutdown = hda_dsp_shutdown_dma_flush; - if (sdev->pdata->ipc_type == SOF_IPC) { + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_3) { /* doorbell */ sof_tgl_ops.irq_thread = cnl_ipc_irq_thread; @@ -79,7 +79,7 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev) sof_tgl_ops.set_power_state = hda_dsp_set_power_state_ipc3; } - if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) { + if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) { struct sof_ipc4_fw_data *ipc4_data; sdev->private = devm_kzalloc(sdev->dev, sizeof(*ipc4_data), GFP_KERNEL); From c984a83d820857bc1112a34fa6b4e039c1e7f55d Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 13 Apr 2023 13:25:58 +0300 Subject: [PATCH 08/27] ASoC: SOF: Intel: pci-lnl: Use generic names for IPC types Use the new SOF_IPC_TYPE_4 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/intel/pci-lnl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/sof/intel/pci-lnl.c b/sound/soc/sof/intel/pci-lnl.c index 2b6756f45e801b..ea443d25f7aec7 100644 --- a/sound/soc/sof/intel/pci-lnl.c +++ b/sound/soc/sof/intel/pci-lnl.c @@ -29,17 +29,17 @@ static const struct sof_dev_desc lnl_desc = { .resindex_imr_base = -1, .irqindex_host_ipc = -1, .chip_info = &lnl_chip_info, - .ipc_supported_mask = BIT(SOF_INTEL_IPC4), - .ipc_default = SOF_INTEL_IPC4, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_4), + .ipc_default = SOF_IPC_TYPE_4, .dspless_mode_supported = true, .default_fw_path = { - [SOF_INTEL_IPC4] = "intel/sof-ipc4/lnl", + [SOF_IPC_TYPE_4] = "intel/sof-ipc4/lnl", }, .default_tplg_path = { - [SOF_INTEL_IPC4] = "intel/sof-ace-tplg", + [SOF_IPC_TYPE_4] = "intel/sof-ace-tplg", }, .default_fw_filename = { - [SOF_INTEL_IPC4] = "sof-lnl.ri", + [SOF_IPC_TYPE_4] = "sof-lnl.ri", }, .nocodec_tplg_filename = "sof-lnl-nocodec.tplg", /* the MTL ops are still used for now */ From a6fbe023547f654b07ab63946e33d65be79940ae Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 13 Apr 2023 13:26:27 +0300 Subject: [PATCH 09/27] ASoC: SOF: mediatek: Use generic names for IPC types Use the new SOF_IPC_TYPE_3 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/mediatek/mt8186/mt8186.c | 20 ++++++++++---------- sound/soc/sof/mediatek/mt8195/mt8195.c | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c index 597cb4476acb41..6391c55fc2cbd4 100644 --- a/sound/soc/sof/mediatek/mt8186/mt8186.c +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c @@ -613,32 +613,32 @@ static struct snd_sof_of_mach sof_mt8186_machs[] = { static const struct sof_dev_desc sof_of_mt8186_desc = { .of_machines = sof_mt8186_machs, - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "mediatek/sof", + [SOF_IPC_TYPE_3] = "mediatek/sof", }, .default_tplg_path = { - [SOF_IPC] = "mediatek/sof-tplg", + [SOF_IPC_TYPE_3] = "mediatek/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-mt8186.ri", + [SOF_IPC_TYPE_3] = "sof-mt8186.ri", }, .nocodec_tplg_filename = "sof-mt8186-nocodec.tplg", .ops = &sof_mt8186_ops, }; static const struct sof_dev_desc sof_of_mt8188_desc = { - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "mediatek/sof", + [SOF_IPC_TYPE_3] = "mediatek/sof", }, .default_tplg_path = { - [SOF_IPC] = "mediatek/sof-tplg", + [SOF_IPC_TYPE_3] = "mediatek/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-mt8188.ri", + [SOF_IPC_TYPE_3] = "sof-mt8188.ri", }, .nocodec_tplg_filename = "sof-mt8188-nocodec.tplg", .ops = &sof_mt8186_ops, diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index 42bae574c87ab2..ce451b0239eaa8 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -669,16 +669,16 @@ static struct snd_sof_of_mach sof_mt8195_machs[] = { static const struct sof_dev_desc sof_of_mt8195_desc = { .of_machines = sof_mt8195_machs, - .ipc_supported_mask = BIT(SOF_IPC), - .ipc_default = SOF_IPC, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, .default_fw_path = { - [SOF_IPC] = "mediatek/sof", + [SOF_IPC_TYPE_3] = "mediatek/sof", }, .default_tplg_path = { - [SOF_IPC] = "mediatek/sof-tplg", + [SOF_IPC_TYPE_3] = "mediatek/sof-tplg", }, .default_fw_filename = { - [SOF_IPC] = "sof-mt8195.ri", + [SOF_IPC_TYPE_3] = "sof-mt8195.ri", }, .nocodec_tplg_filename = "sof-mt8195-nocodec.tplg", .ops = &sof_mt8195_ops, From 903eedfae06f732af6eaaf2f7186f98143083cb7 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 13 Apr 2023 13:28:59 +0300 Subject: [PATCH 10/27] ASoC: SOF: Drop unused IPC type defines The SOF stack now uses the generic names for the IPC type, the defines can be dropped. Signed-off-by: Peter Ujfalusi --- include/sound/sof.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/sound/sof.h b/include/sound/sof.h index 6bc5e56ed3e0c2..bbfbe230c638ff 100644 --- a/include/sound/sof.h +++ b/include/sound/sof.h @@ -57,9 +57,6 @@ enum sof_ipc_type { SOF_IPC_TYPE_COUNT }; -#define SOF_IPC SOF_IPC_TYPE_3 -#define SOF_INTEL_IPC4 SOF_IPC_TYPE_4 - /* * SOF Platform data. */ From bbc97656a815f43afc46c6fbadce61fe3a4a0516 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Mon, 17 Apr 2023 16:01:21 +0300 Subject: [PATCH 11/27] ASoC: SOF: pci-cnl: Align the IPC4 firmware paths for cfl and cml All three platform described by pci-cnl.c (CNL, CFL and CML) uses the same firmware image (sof-cnl.ri). Packaging is handling the different file names by using symbolic links: sof-cfl.ri -> sof-cnl.ri sof-cml.ri -> sof-cnl.ri For IPC4 the firmware and lib path should be: intel/avs/cfl -> intel/avs/cnl intel/avs-lib/cfl -> intel/avs-lib/cnl Signed-off-by: Peter Ujfalusi --- sound/soc/sof/intel/pci-cnl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/sof/intel/pci-cnl.c b/sound/soc/sof/intel/pci-cnl.c index 2a5c88975dab81..3043f98a06020f 100644 --- a/sound/soc/sof/intel/pci-cnl.c +++ b/sound/soc/sof/intel/pci-cnl.c @@ -66,10 +66,10 @@ static const struct sof_dev_desc cfl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/cnl", + [SOF_IPC_TYPE_4] = "intel/avs/cfl", }, .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/cnl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/cfl", }, .default_tplg_path = { [SOF_IPC_TYPE_3] = "intel/sof-tplg", @@ -99,10 +99,10 @@ static const struct sof_dev_desc cml_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/cnl", + [SOF_IPC_TYPE_4] = "intel/avs/cml", }, .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/cnl", + [SOF_IPC_TYPE_4] = "intel/avs-lib/cml", }, .default_tplg_path = { [SOF_IPC_TYPE_3] = "intel/sof-tplg", From fbb6a5b3eba7f7b03a834c96d2b5f6b685d3ab44 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 10:35:12 +0300 Subject: [PATCH 12/27] ASoC: SOF: Add enum and struct for 'firmware layout profile' support The firmware file (and libraries for IPC4) and topology file location is different for IPC versions which works well currently but it also places constraints on file system layout changes since the default paths are wired in the kernel. IPC4 complicates this single set of paths per IPC implementations since on Intel platforms it should be possible to use reference firmware or SOF, both implementing IPC4. With the current implementation it is also problematic to implement seamless fallback to different firmware file layout for the same IPC type and to have means to use other IPC versions in case the default/requested one has not firmware file available. With the proposed firmware profile layout machine descriptors will provide two identification strings: name of the vendor (amd, imx, intel, mediatek), name of the platform (apl, tgl, rmb, imx8, mt8188, etc). From these strings the paths and firmware file name is constructed in a standardized way. Signed-off-by: Peter Ujfalusi --- include/sound/sof.h | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/include/sound/sof.h b/include/sound/sof.h index bbfbe230c638ff..d3433fc543d462 100644 --- a/include/sound/sof.h +++ b/include/sound/sof.h @@ -50,6 +50,36 @@ enum sof_dsp_power_states { SOF_DSP_PM_D3, }; +/** + * enum sof_fw_layout_type - pre-defined file-layout for loadable fw files + * @SOF_FW_LAYOUT_VENDOR_IPC3: + * firmware path: /sof + * firmware name: sof-.ri + * topology path: /sof-tplg/ + * @SOF_FW_LAYOUT_VENDOR_IPC4_SOF: + * firmware path: /sof-ipc4/ + * firmware name: sof-.ri + * firmware lib path: /sof-ipc4-lib/ + * topology path: /sof-ipc4-tplg/ + * @SOF_FW_LAYOUT_VENDOR_IPC4_INTEL_AVS: + * firmware path: intel/avs/ + * firmware name: dsp_basefw.bin + * firmware lib path: intel/avs-lib/ + * topology path: intel/avs-tplg/ + * @SOF_FW_LAYOUT_VENDOR_IPC4_INTEL_ACE: + * firmware path: intel/sof-ipc4/ + * firmware name: sof-.ri + * firmware lib path: intel/sof-ipc4-lib/ + * topology path: intel/sof-ace-tplg/ + */ +enum sof_fw_layout_type { + SOF_FW_LAYOUT_VENDOR_IPC3, + SOF_FW_LAYOUT_VENDOR_IPC4_SOF, + SOF_FW_LAYOUT_VENDOR_IPC4_INTEL_AVS, + SOF_FW_LAYOUT_VENDOR_IPC4_INTEL_ACE, + SOF_FW_LAYOUT_COUNT, +}; + /* Definitions for multiple IPCs */ enum sof_ipc_type { SOF_IPC_TYPE_3, @@ -57,6 +87,22 @@ enum sof_ipc_type { SOF_IPC_TYPE_COUNT }; +/** + * struct sof_fw_layout_profile - Description of a firmware layout and type + * @ipc_type: IPC type of the profile + * @fw_path: Path where the @fw_filename resides + * @fw_lib_path: Path where the external libraries can be found (IPC4 only) + * @fw_name: Name of the frmware file + * @tplg_path: Path where to look for the topology files + */ +struct sof_fw_layout_profile { + enum sof_ipc_type ipc_type; + const char *fw_path; + const char *fw_lib_path; + const char *fw_name; + const char *tplg_path; +}; + /* * SOF Platform data. */ @@ -79,6 +125,8 @@ struct snd_sof_pdata { const struct sof_dev_desc *desc; /* firmware and topology filenames */ + struct sof_fw_layout_profile default_fw_profile; + const char *fw_filename_prefix; const char *fw_filename; const char *tplg_filename_prefix; @@ -143,6 +191,10 @@ struct sof_dev_desc { /* default firmware name */ const char *default_fw_filename[SOF_IPC_TYPE_COUNT]; + /* strings used for the firmware layout path/filename creation */ + const char *vendor; + const char *platform; + struct snd_sof_dsp_ops *ops; int (*ops_init)(struct snd_sof_dev *sdev); void (*ops_free)(struct snd_sof_dev *sdev); From 9192f9e3a7cb1dbd65445cbee364a7457b9ef694 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 10:46:48 +0300 Subject: [PATCH 13/27] ASoC: SOF: Add library file to handle the firmware file profiles The purpose of the library is to craft the paths and firmware file name for the IPC version. After creating the paths we will try to open the default firmware image ad check it's magic number to make sure it is matching with the expected IPC type. The sof_create_default_fw_layout_profile() will try to first create the strings for the requested IPC type. If no layout profile was found for the IPC type then we will try to probe other IPC types as a fallback. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/Makefile | 3 +- sound/soc/sof/fw-file-layout.c | 355 +++++++++++++++++++++++++++++++++ sound/soc/sof/sof-priv.h | 9 + 3 files changed, 366 insertions(+), 1 deletion(-) create mode 100644 sound/soc/sof/fw-file-layout.c diff --git a/sound/soc/sof/Makefile b/sound/soc/sof/Makefile index 75a5a5bb063d12..a2069add19a784 100644 --- a/sound/soc/sof/Makefile +++ b/sound/soc/sof/Makefile @@ -1,7 +1,8 @@ # SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) snd-sof-objs := core.o ops.o loader.o ipc.o pcm.o pm.o debug.o topology.o\ - control.o trace.o iomem-utils.o sof-audio.o stream-ipc.o + control.o trace.o iomem-utils.o sof-audio.o stream-ipc.o\ + fw-file-layout.o # IPC implementations ifneq ($(CONFIG_SND_SOC_SOF_IPC3),) diff --git a/sound/soc/sof/fw-file-layout.c b/sound/soc/sof/fw-file-layout.c new file mode 100644 index 00000000000000..72606c9507cbba --- /dev/null +++ b/sound/soc/sof/fw-file-layout.c @@ -0,0 +1,355 @@ +// 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 Intel Corporation. All rights reserved. +// + +#include +#include +#include +#include "sof-priv.h" + +struct sof_profile_ipc_type_table { + enum sof_fw_layout_type layout_type; + enum sof_ipc_type ipc_type; +}; + +static const enum sof_ipc_type layout_to_ipc_type_map[] = { + [SOF_FW_LAYOUT_VENDOR_IPC3] = SOF_IPC_TYPE_3, + [SOF_FW_LAYOUT_VENDOR_IPC4_SOF] = SOF_IPC_TYPE_4, + [SOF_FW_LAYOUT_VENDOR_IPC4_INTEL_AVS] = SOF_IPC_TYPE_4, + [SOF_FW_LAYOUT_VENDOR_IPC4_INTEL_ACE] = SOF_IPC_TYPE_4, +}; + +static void sof_free_profile_strings(struct device *dev, + struct sof_fw_layout_profile *fw_layout) +{ + devm_kfree(dev, fw_layout->fw_path); + devm_kfree(dev, fw_layout->fw_lib_path); + devm_kfree(dev, fw_layout->fw_name); + devm_kfree(dev, fw_layout->tplg_path); + + fw_layout->fw_path = NULL; + fw_layout->fw_lib_path = NULL; + fw_layout->fw_name = NULL; + fw_layout->tplg_path = NULL; +} + +static int +setup_fw_layout_profile(struct device *dev, + const enum sof_fw_layout_type layout_type, + const char *vendor_name, const char *platform_name, + const char *fw_path_postfix, + struct sof_fw_layout_profile *out_layout) +{ + int ret = -ENOMEM; + const char *str; + + switch (layout_type) { + case SOF_FW_LAYOUT_VENDOR_IPC3: + out_layout->ipc_type = SOF_IPC_TYPE_3; + /* + * firmware path: /sof + * firmware name: sof-.ri + * topology path: /sof-tplg/ + */ + if (fw_path_postfix) + str = devm_kasprintf(dev, GFP_KERNEL, "%s/sof/%s", + vendor_name, fw_path_postfix); + else + str = devm_kasprintf(dev, GFP_KERNEL, "%s/sof", + vendor_name); + if (!str) + return -ENOMEM; + + out_layout->fw_path = str; + + out_layout->fw_name = devm_kasprintf(dev, GFP_KERNEL, + "sof-%s.ri", + platform_name); + if (!out_layout->fw_name) + goto err; + + out_layout->tplg_path = devm_kasprintf(dev, GFP_KERNEL, + "%s/sof-tplg", + vendor_name); + if (!out_layout->tplg_path) + goto err; + break; + case SOF_FW_LAYOUT_VENDOR_IPC4_SOF: + out_layout->ipc_type = SOF_IPC_TYPE_4; + /* + * firmware path: /sof-ipc4/ + * firmware name: sof-.ri + * firmware lib path: /sof-ipc4-lib/ + * topology path: /sof-ipc4-tplg/ + */ + if (fw_path_postfix) + str = devm_kasprintf(dev, GFP_KERNEL, + "%s/sof-ipc4/%s/%s", + vendor_name, platform_name, + fw_path_postfix); + else + str = devm_kasprintf(dev, GFP_KERNEL, "%s/sof-ipc4/%s", + vendor_name, platform_name); + if (!str) + return -ENOMEM; + + out_layout->fw_path = str; + + out_layout->fw_name = devm_kasprintf(dev, GFP_KERNEL, + "sof-%s.ri", + platform_name); + if (!out_layout->fw_name) + goto err; + + if (fw_path_postfix) + str = devm_kasprintf(dev, GFP_KERNEL, + "%s/sof-ipc4-lib/%s/%s", + vendor_name, platform_name, + fw_path_postfix); + else + str = devm_kasprintf(dev, GFP_KERNEL, + "%s/sof-ipc4-lib/%s", + vendor_name, platform_name); + if (!str) + goto err; + + out_layout->fw_lib_path = str; + + out_layout->tplg_path = devm_kasprintf(dev, GFP_KERNEL, + "%s/sof-ace-tplg", + vendor_name); + if (!out_layout->tplg_path) + goto err; + break; + case SOF_FW_LAYOUT_VENDOR_IPC4_INTEL_AVS: + out_layout->ipc_type = SOF_IPC_TYPE_4; + /* + * firmware path: intel/avs/ + * firmware name: dsp_basefw.bin + * firmware lib path: intel/avs-lib/ + * topology path: intel/avs-tplg/ + */ + if (fw_path_postfix) + str = devm_kasprintf(dev, GFP_KERNEL, "intel/avs/%s/%s", + platform_name, fw_path_postfix); + else + str = devm_kasprintf(dev, GFP_KERNEL, "intel/avs/%s", + platform_name); + if (!str) + return -ENOMEM; + + out_layout->fw_path = str; + + out_layout->fw_name = devm_kstrdup(dev, "dsp_basefw.bin", + GFP_KERNEL); + if (!out_layout->fw_name) + goto err; + + if (fw_path_postfix) + str = devm_kasprintf(dev, GFP_KERNEL, + "intel/avs-lib/%s/%s", + platform_name, fw_path_postfix); + else + str = devm_kasprintf(dev, GFP_KERNEL, + "intel/avs-lib/%s", + platform_name); + if (!str) + goto err; + + out_layout->fw_lib_path = str; + + out_layout->tplg_path = devm_kstrdup(dev, "intel/avs-tplg", + GFP_KERNEL); + if (!out_layout->tplg_path) + goto err; + break; + case SOF_FW_LAYOUT_VENDOR_IPC4_INTEL_ACE: + out_layout->ipc_type = SOF_IPC_TYPE_4; + /* + * firmware path: intel/sof-ipc4/ + * firmware name: sof-.ri + * firmware lib path: intel/sof-ipc4-lib/ + * topology path: intel/sof-ace-tplg/ + */ + if (fw_path_postfix) + str = devm_kasprintf(dev, GFP_KERNEL, + "intel/sof-ipc4/%s/%s", + platform_name, fw_path_postfix); + else + str = devm_kasprintf(dev, GFP_KERNEL, + "intel/sof-ipc4/%s", + platform_name); + if (!str) + return -ENOMEM; + + out_layout->fw_path = str; + + out_layout->fw_name = devm_kasprintf(dev, GFP_KERNEL, + "sof-%s.ri", + platform_name); + if (!out_layout->fw_name) + goto err; + + if (fw_path_postfix) + str = devm_kasprintf(dev, GFP_KERNEL, + "intel/sof-ipc4-lib/%s/%s", + platform_name, fw_path_postfix); + else + str = devm_kasprintf(dev, GFP_KERNEL, + "intel/sof-ipc4-lib/%s", + platform_name); + if (!str) + goto err; + + out_layout->fw_lib_path = str; + + out_layout->tplg_path = devm_kstrdup(dev, "intel/sof-ace-tplg", + GFP_KERNEL); + if (!out_layout->tplg_path) + goto err; + break; + default: + dev_err(dev, "Invalid firmware layout type: %d\n", layout_type); + return -EINVAL; + } + + return 0; + +err: + sof_free_profile_strings(dev, out_layout); + + return ret; +} + +static int sof_test_fw_layout(struct device *dev, + struct sof_fw_layout_profile *fw_layout) +{ + enum sof_ipc_type fw_ipc_type; + const struct firmware *fw; + const char *fw_filename; + const u32 *magic; + int ret; + + fw_filename = kasprintf(GFP_KERNEL, "%s/%s", fw_layout->fw_path, + fw_layout->fw_name); + if (!fw_filename) + return -ENOMEM; + + ret = firmware_request_nowarn(&fw, fw_filename, dev); + if (ret < 0) + return ret; + + /* firmware file exists, check the magic number */ + magic = (const u32 *)fw->data; + switch (*magic) { + case SOF_EXT_MAN_MAGIC_NUMBER: + fw_ipc_type = SOF_IPC_TYPE_3; + break; + case SOF_EXT_MAN4_MAGIC_NUMBER: + fw_ipc_type = SOF_IPC_TYPE_4; + break; + default: + dev_err(dev, "Invalid firmware magic: %#x\n", *magic); + ret = -EINVAL; + goto out; + } + + if (fw_ipc_type != fw_layout->ipc_type) { + dev_err(dev, + "ipc type mismatch between file and profile: %d vs %d\n", + fw_ipc_type, fw_layout->ipc_type); + ret = -EINVAL; + } +out: + release_firmware(fw); + + return ret; +} + +static int fw_layout_for_ipc_type(struct device *dev, + const enum sof_ipc_type ipc_type, + const struct sof_dev_desc *desc, + const char *fw_path_postfix, + struct sof_fw_layout_profile *out_layout) +{ + bool found = false; + int i, ret; + + memset(out_layout, 0, sizeof(*out_layout)); + + for (i = 0; i < ARRAY_SIZE(layout_to_ipc_type_map); i++) { + if (layout_to_ipc_type_map[i] != ipc_type) + continue; + + ret = setup_fw_layout_profile(dev, i, desc->vendor, + desc->platform, fw_path_postfix, + out_layout); + if (ret) + return ret; + + ret = sof_test_fw_layout(dev, out_layout); + if (!ret) { + found = true; + break; + } + + sof_free_profile_strings(dev, out_layout); + } + + if (!found) + return -ENOENT; + + dev_dbg(dev, "Default profile type for IPC type %d: %d\n", ipc_type, i); + + return 0; +} + +int sof_create_default_fw_layout_profile(struct device *dev, + const enum sof_ipc_type ipc_type, + const struct sof_dev_desc *desc, + const char *fw_path_postfix, + struct sof_fw_layout_profile *out_layout) +{ + int ret = -ENOENT; + int i; + + memset(out_layout, 0, sizeof(*out_layout)); + + ret = fw_layout_for_ipc_type(dev, ipc_type, desc, fw_path_postfix, + out_layout); + if (!ret) + return 0; + + dev_warn(dev, "No default profile found for requested IPC type %d\n", + ipc_type); + + /* + * No firmware file was found for the requested IPC type, check all + * IPC types as fallback + */ + for (i = 0; i < SOF_IPC_TYPE_COUNT; i++) { + if (i == ipc_type || !(desc->ipc_supported_mask & BIT(i))) + continue; + + ret = fw_layout_for_ipc_type(dev, i, desc, fw_path_postfix, + out_layout); + if (!ret) + break; + + dev_info(dev, "No default profile found for fallback IPC type%d\n", + ipc_type); + } + + if (ret) { + dev_err(dev, "No sof firmware file was found, you might need to\n"); + dev_err(dev, + " download it from https://github.com/thesofproject/sof-bin/\n"); + } + + return ret; +} +EXPORT_SYMBOL(sof_create_default_fw_layout_profile); diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index cd4f6ac126eca7..2982b82e514eae 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -690,6 +690,15 @@ void snd_sof_new_platform_drv(struct snd_sof_dev *sdev); */ extern struct snd_compress_ops sof_compressed_ops; +/* + * Firmware layout profile handling + */ +int sof_create_default_fw_layout_profile(struct device *dev, + const enum sof_ipc_type ipc_type, + const struct sof_dev_desc *desc, + const char *fw_path_postfix, + struct sof_fw_layout_profile *out_layout); + /* * Firmware loading. */ From 1f72386318aea457a5ba022158c49705199262c9 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 10:51:14 +0300 Subject: [PATCH 14/27] ASoC: SOF: amd: Add vendor and platform names for device descriptors Set the vendor and platform names in sof_dev_desc, which will be used to create the default firmware layout profile paths and firmware name. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/amd/pci-rmb.c | 2 ++ sound/soc/sof/amd/pci-rn.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sound/soc/sof/amd/pci-rmb.c b/sound/soc/sof/amd/pci-rmb.c index 5cae889f9b35c2..96da1542d92829 100644 --- a/sound/soc/sof/amd/pci-rmb.c +++ b/sound/soc/sof/amd/pci-rmb.c @@ -47,6 +47,8 @@ static const struct sof_dev_desc rembrandt_desc = { .chip_info = &rembrandt_chip_info, .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = "amd", + .platform = "rmb", .default_fw_path = { [SOF_IPC_TYPE_3] = "amd/sof", }, diff --git a/sound/soc/sof/amd/pci-rn.c b/sound/soc/sof/amd/pci-rn.c index 42170bd9aacc3e..8c605922091fe6 100644 --- a/sound/soc/sof/amd/pci-rn.c +++ b/sound/soc/sof/amd/pci-rn.c @@ -47,6 +47,8 @@ static const struct sof_dev_desc renoir_desc = { .chip_info = &renoir_chip_info, .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = "amd", + .platform = "rn", .default_fw_path = { [SOF_IPC_TYPE_3] = "amd/sof", }, From 38825e03d2ebd5b2966ee9d43568095a464320b5 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 10:51:35 +0300 Subject: [PATCH 15/27] ASoC: SOF: imx: Add vendor and platform names for device descriptors Set the vendor and platform names in sof_dev_desc, which will be used to create the default firmware layout profile paths and firmware name. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/imx/imx8.c | 6 ++++++ sound/soc/sof/imx/imx8m.c | 2 ++ sound/soc/sof/imx/imx8ulp.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index 65a7041cbab9d7..08c04b659bc83b 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -608,9 +608,13 @@ static struct snd_sof_dsp_ops sof_imx8x_ops = { SNDRV_PCM_INFO_NO_PERIOD_WAKEUP }; +static const char vendor_string[] = "imx"; + static struct sof_dev_desc sof_of_imx8qxp_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = vendor_string, + .platform = "imx8x", .default_fw_path = { [SOF_IPC_TYPE_3] = "imx/sof", }, @@ -627,6 +631,8 @@ static struct sof_dev_desc sof_of_imx8qxp_desc = { static struct sof_dev_desc sof_of_imx8qm_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = vendor_string, + .platform = "imx8", .default_fw_path = { [SOF_IPC_TYPE_3] = "imx/sof", }, diff --git a/sound/soc/sof/imx/imx8m.c b/sound/soc/sof/imx/imx8m.c index 9d58dda8f079d1..65155562c38c0c 100644 --- a/sound/soc/sof/imx/imx8m.c +++ b/sound/soc/sof/imx/imx8m.c @@ -473,6 +473,8 @@ static struct snd_sof_dsp_ops sof_imx8m_ops = { static struct sof_dev_desc sof_of_imx8mp_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = "imx", + .platform = "imx8m", .default_fw_path = { [SOF_IPC_TYPE_3] = "imx/sof", }, diff --git a/sound/soc/sof/imx/imx8ulp.c b/sound/soc/sof/imx/imx8ulp.c index 2673c1d4ddea16..5b43ebf315f61e 100644 --- a/sound/soc/sof/imx/imx8ulp.c +++ b/sound/soc/sof/imx/imx8ulp.c @@ -480,6 +480,8 @@ static struct snd_sof_dsp_ops sof_imx8ulp_ops = { static struct sof_dev_desc sof_of_imx8ulp_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = "imx", + .platform = "imx8ulp", .default_fw_path = { [SOF_IPC_TYPE_3] = "imx/sof", }, From a59675ca0c859bfc778da7397da33868c5ff1cc8 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 10:52:28 +0300 Subject: [PATCH 16/27] ASoC: SOF: Intel: Add vendor and platform names for device descriptors Set the vendor and platform names in sof_dev_desc, which will be used to create the default firmware layout profile paths and firmware name. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/intel/bdw.c | 2 ++ sound/soc/sof/intel/byt.c | 8 ++++++++ sound/soc/sof/intel/pci-apl.c | 6 ++++++ sound/soc/sof/intel/pci-cnl.c | 8 ++++++++ sound/soc/sof/intel/pci-icl.c | 6 ++++++ sound/soc/sof/intel/pci-mtl.c | 2 ++ sound/soc/sof/intel/pci-skl.c | 6 ++++++ sound/soc/sof/intel/pci-tgl.c | 18 ++++++++++++++++++ sound/soc/sof/intel/pci-tng.c | 2 ++ 9 files changed, 58 insertions(+) diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c index 511fce8e0e198b..043cca23e98afa 100644 --- a/sound/soc/sof/intel/bdw.c +++ b/sound/soc/sof/intel/bdw.c @@ -641,6 +641,8 @@ static const struct sof_dev_desc sof_acpi_broadwell_desc = { .chip_info = &bdw_chip_info, .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = "intel", + .platform = "bdw", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", }, diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c index a976dc91d2ec69..b32629422dce6a 100644 --- a/sound/soc/sof/intel/byt.c +++ b/sound/soc/sof/intel/byt.c @@ -366,6 +366,8 @@ static const struct sof_intel_dsp_desc cht_chip_info = { .hw_ip_version = SOF_INTEL_BAYTRAIL, }; +static const char vendor_string[] = "intel"; + /* BYTCR uses different IRQ index */ static const struct sof_dev_desc sof_acpi_baytrailcr_desc = { .machines = snd_soc_acpi_intel_baytrail_machines, @@ -376,6 +378,8 @@ static const struct sof_dev_desc sof_acpi_baytrailcr_desc = { .chip_info = &byt_chip_info, .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = vendor_string, + .platform = "byt", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", }, @@ -398,6 +402,8 @@ static const struct sof_dev_desc sof_acpi_baytrail_desc = { .chip_info = &byt_chip_info, .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = vendor_string, + .platform = "byt", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", }, @@ -420,6 +426,8 @@ static const struct sof_dev_desc sof_acpi_cherrytrail_desc = { .chip_info = &cht_chip_info, .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = vendor_string, + .platform = "cht", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", }, diff --git a/sound/soc/sof/intel/pci-apl.c b/sound/soc/sof/intel/pci-apl.c index 0bdd881cac345e..7fa4cfcb2f9952 100644 --- a/sound/soc/sof/intel/pci-apl.c +++ b/sound/soc/sof/intel/pci-apl.c @@ -19,6 +19,8 @@ /* platform specific devices */ #include "hda.h" +static const char vendor_string[] = "intel"; + static const struct sof_dev_desc bxt_desc = { .machines = snd_soc_acpi_intel_bxt_machines, .use_acpi_target_states = true, @@ -30,6 +32,8 @@ static const struct sof_dev_desc bxt_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "apl", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/apl", @@ -62,6 +66,8 @@ static const struct sof_dev_desc glk_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "glk", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/glk", diff --git a/sound/soc/sof/intel/pci-cnl.c b/sound/soc/sof/intel/pci-cnl.c index 3043f98a06020f..78d83bc75b7e03 100644 --- a/sound/soc/sof/intel/pci-cnl.c +++ b/sound/soc/sof/intel/pci-cnl.c @@ -19,6 +19,8 @@ /* platform specific devices */ #include "hda.h" +static const char vendor_string[] = "intel"; + static const struct sof_dev_desc cnl_desc = { .machines = snd_soc_acpi_intel_cnl_machines, .alt_machines = snd_soc_acpi_intel_cnl_sdw_machines, @@ -31,6 +33,8 @@ static const struct sof_dev_desc cnl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "cnl", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/cnl", @@ -64,6 +68,8 @@ static const struct sof_dev_desc cfl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "cfl", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/cfl", @@ -97,6 +103,8 @@ static const struct sof_dev_desc cml_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "cml", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/cml", diff --git a/sound/soc/sof/intel/pci-icl.c b/sound/soc/sof/intel/pci-icl.c index a27b062f2c6a7f..c3a5fcf82723c1 100644 --- a/sound/soc/sof/intel/pci-icl.c +++ b/sound/soc/sof/intel/pci-icl.c @@ -19,6 +19,8 @@ /* platform specific devices */ #include "hda.h" +static const char vendor_string[] = "intel"; + static const struct sof_dev_desc icl_desc = { .machines = snd_soc_acpi_intel_icl_machines, .alt_machines = snd_soc_acpi_intel_icl_sdw_machines, @@ -31,6 +33,8 @@ static const struct sof_dev_desc icl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "icl", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/icl", @@ -63,6 +67,8 @@ static const struct sof_dev_desc jsl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "jsl", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/jsl", diff --git a/sound/soc/sof/intel/pci-mtl.c b/sound/soc/sof/intel/pci-mtl.c index e25f524a7925aa..50e71f79a27806 100644 --- a/sound/soc/sof/intel/pci-mtl.c +++ b/sound/soc/sof/intel/pci-mtl.c @@ -32,6 +32,8 @@ static const struct sof_dev_desc mtl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_4, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = "intel", + .platform = "mtl", .default_fw_path = { [SOF_IPC_TYPE_4] = "intel/sof-ipc4/mtl", }, diff --git a/sound/soc/sof/intel/pci-skl.c b/sound/soc/sof/intel/pci-skl.c index f42f3855f66d5a..65426aad7d6042 100644 --- a/sound/soc/sof/intel/pci-skl.c +++ b/sound/soc/sof/intel/pci-skl.c @@ -17,6 +17,8 @@ /* platform specific devices */ #include "hda.h" +static const char vendor_string[] = "intel"; + static struct sof_dev_desc skl_desc = { .machines = snd_soc_acpi_intel_skl_machines, .resindex_lpe_base = 0, @@ -27,6 +29,8 @@ static struct sof_dev_desc skl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_4, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "skl", .default_fw_path = { [SOF_IPC_TYPE_4] = "intel/avs/skl", }, @@ -52,6 +56,8 @@ static struct sof_dev_desc kbl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_4, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "kbl", .default_fw_path = { [SOF_IPC_TYPE_4] = "intel/avs/kbl", }, diff --git a/sound/soc/sof/intel/pci-tgl.c b/sound/soc/sof/intel/pci-tgl.c index 613119ec37a25b..ca311356763196 100644 --- a/sound/soc/sof/intel/pci-tgl.c +++ b/sound/soc/sof/intel/pci-tgl.c @@ -19,6 +19,8 @@ /* platform specific devices */ #include "hda.h" +static const char vendor_string[] = "intel"; + static const struct sof_dev_desc tgl_desc = { .machines = snd_soc_acpi_intel_tgl_machines, .alt_machines = snd_soc_acpi_intel_tgl_sdw_machines, @@ -31,6 +33,8 @@ static const struct sof_dev_desc tgl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "tgl", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/tgl", @@ -64,6 +68,8 @@ static const struct sof_dev_desc tglh_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "tgl-h", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/tgl-h", @@ -96,6 +102,8 @@ static const struct sof_dev_desc ehl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "ehl", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/ehl", @@ -129,6 +137,8 @@ static const struct sof_dev_desc adls_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "adl-s", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/adl-s", @@ -162,6 +172,8 @@ static const struct sof_dev_desc adl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "adl", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/adl", @@ -195,6 +207,8 @@ static const struct sof_dev_desc adl_n_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "adl-n", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/adl-n", @@ -228,6 +242,8 @@ static const struct sof_dev_desc rpls_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "rpl-s", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/rpl-s", @@ -261,6 +277,8 @@ static const struct sof_dev_desc rpl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_3, .dspless_mode_supported = true, /* Only supported for HDaudio */ + .vendor = vendor_string, + .platform = "rpl", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", [SOF_IPC_TYPE_4] = "intel/avs/rpl", diff --git a/sound/soc/sof/intel/pci-tng.c b/sound/soc/sof/intel/pci-tng.c index e124a36f7e4e66..d664bb21805680 100644 --- a/sound/soc/sof/intel/pci-tng.c +++ b/sound/soc/sof/intel/pci-tng.c @@ -210,6 +210,8 @@ static const struct sof_dev_desc tng_desc = { .chip_info = &tng_chip_info, .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = "intel", + .platform = "byt", .default_fw_path = { [SOF_IPC_TYPE_3] = "intel/sof", }, From 2d3c6556bb0b16c776f6a2fc9d9dbe55dc8fb4e7 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 10:52:46 +0300 Subject: [PATCH 17/27] ASoC: SOF: Intel: pci-lnl: Add vendor and platform names for device descriptors Set the vendor and platform names in sof_dev_desc, which will be used to create the default firmware layout profile paths and firmware name. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/intel/pci-lnl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/sof/intel/pci-lnl.c b/sound/soc/sof/intel/pci-lnl.c index ea443d25f7aec7..4ac0050b24dd1a 100644 --- a/sound/soc/sof/intel/pci-lnl.c +++ b/sound/soc/sof/intel/pci-lnl.c @@ -32,6 +32,8 @@ static const struct sof_dev_desc lnl_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_4, .dspless_mode_supported = true, + .vendor = "intel", + .platform = "lnl", .default_fw_path = { [SOF_IPC_TYPE_4] = "intel/sof-ipc4/lnl", }, From c4f63cb270080476a48db6bd607da791c2b79f43 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 10:53:05 +0300 Subject: [PATCH 18/27] ASoC: SOF: mediatek: Add vendor and platform names for device descriptors Set the vendor and platform names in sof_dev_desc, which will be used to create the default firmware layout profile paths and firmware name. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/mediatek/mt8186/mt8186.c | 6 ++++++ sound/soc/sof/mediatek/mt8195/mt8195.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c index 6391c55fc2cbd4..a4999253dc7d6d 100644 --- a/sound/soc/sof/mediatek/mt8186/mt8186.c +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c @@ -611,10 +611,14 @@ static struct snd_sof_of_mach sof_mt8186_machs[] = { {} }; +static const char vendor_string[] = "mediatek"; + static const struct sof_dev_desc sof_of_mt8186_desc = { .of_machines = sof_mt8186_machs, .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = vendor_string, + .platform = "mt8186", .default_fw_path = { [SOF_IPC_TYPE_3] = "mediatek/sof", }, @@ -631,6 +635,8 @@ static const struct sof_dev_desc sof_of_mt8186_desc = { static const struct sof_dev_desc sof_of_mt8188_desc = { .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = vendor_string, + .platform = "mt8188", .default_fw_path = { [SOF_IPC_TYPE_3] = "mediatek/sof", }, diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index ce451b0239eaa8..47820fdcb692d3 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -671,6 +671,8 @@ static const struct sof_dev_desc sof_of_mt8195_desc = { .of_machines = sof_mt8195_machs, .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), .ipc_default = SOF_IPC_TYPE_3, + .vendor = "mediatek", + .platform = "mt8195", .default_fw_path = { [SOF_IPC_TYPE_3] = "mediatek/sof", }, From d8bc08cd8c1d06cc1beec391a54d395fb2126605 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 10:55:46 +0300 Subject: [PATCH 19/27] ASoC: SOF: sof-acpi-dev: Create and use the default firmware layout profile Create the default firmware layout profile based on the vendor and platform strings in descriptors and use the default profile for paths and firmware name. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/sof-acpi-dev.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/sof-acpi-dev.c b/sound/soc/sof/sof-acpi-dev.c index 5c4e5ab31abff7..f3563eac943aec 100644 --- a/sound/soc/sof/sof-acpi-dev.c +++ b/sound/soc/sof/sof-acpi-dev.c @@ -58,8 +58,10 @@ static void sof_acpi_probe_complete(struct device *dev) int sof_acpi_probe(struct platform_device *pdev, const struct sof_dev_desc *desc) { + struct sof_fw_layout_profile *fw_profile; struct device *dev = &pdev->dev; struct snd_sof_pdata *sof_pdata; + int ret; dev_dbg(dev, "ACPI DSP detected"); @@ -74,18 +76,26 @@ 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_IPC_TYPE_3]; + sof_pdata->ipc_type = desc->ipc_default; + + fw_profile = &sof_pdata->default_fw_profile; + ret = sof_create_default_fw_layout_profile(dev, sof_pdata->ipc_type, + desc, NULL, fw_profile); + if (ret) + return ret; + + sof_pdata->fw_filename = fw_profile->fw_name; /* alternate fw and tplg filenames ? */ if (fw_path) sof_pdata->fw_filename_prefix = fw_path; else - sof_pdata->fw_filename_prefix = desc->default_fw_path[SOF_IPC_TYPE_3]; + sof_pdata->fw_filename_prefix = fw_profile->fw_path; if (tplg_path) sof_pdata->tplg_filename_prefix = tplg_path; else - sof_pdata->tplg_filename_prefix = desc->default_tplg_path[SOF_IPC_TYPE_3]; + sof_pdata->tplg_filename_prefix = fw_profile->tplg_path; /* set callback to be called on successful device probe to enable runtime_pm */ sof_pdata->sof_probe_complete = sof_acpi_probe_complete; From c383b0fa994ca045ebc5ce1b1539db140da011d7 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 10:56:21 +0300 Subject: [PATCH 20/27] ASoC: SOF: sof-of-dev: Create and use the default firmware layout profile Create the default firmware layout profile based on the vendor and platform strings in descriptors and use the default profile for paths and firmware name. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/sof-of-dev.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/sof-of-dev.c b/sound/soc/sof/sof-of-dev.c index b0e8bd06f78ae5..2ca70e7dd4330c 100644 --- a/sound/soc/sof/sof-of-dev.c +++ b/sound/soc/sof/sof-of-dev.c @@ -43,9 +43,11 @@ static void sof_of_probe_complete(struct device *dev) int sof_of_probe(struct platform_device *pdev) { + struct sof_fw_layout_profile *fw_profile; struct device *dev = &pdev->dev; const struct sof_dev_desc *desc; struct snd_sof_pdata *sof_pdata; + int ret; dev_info(&pdev->dev, "DT DSP detected"); @@ -64,17 +66,26 @@ 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_IPC_TYPE_3]; + sof_pdata->ipc_type = desc->ipc_default; + fw_profile = &sof_pdata->default_fw_profile; + ret = sof_create_default_fw_layout_profile(dev, sof_pdata->ipc_type, + desc, NULL, fw_profile); + if (ret) + return ret; + + sof_pdata->fw_filename = fw_profile->fw_name; + + /* alternate fw and tplg filenames ? */ if (fw_path) sof_pdata->fw_filename_prefix = fw_path; else - sof_pdata->fw_filename_prefix = desc->default_fw_path[SOF_IPC_TYPE_3]; + sof_pdata->fw_filename_prefix = fw_profile->fw_path; if (tplg_path) sof_pdata->tplg_filename_prefix = tplg_path; else - sof_pdata->tplg_filename_prefix = desc->default_tplg_path[SOF_IPC_TYPE_3]; + sof_pdata->tplg_filename_prefix = fw_profile->tplg_path; /* set callback to be called on successful device probe to enable runtime_pm */ sof_pdata->sof_probe_complete = sof_of_probe_complete; From 3426a38a8b706c3e178819530c0e4109db1f6fe3 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 10:57:05 +0300 Subject: [PATCH 21/27] ASoC: SOF: sof-pci-dev: Create and use the default firmware layout profile Create the default firmware layout profile based on the vendor and platform strings in descriptors and use the default profile for paths and firmware name. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/sof-pci-dev.c | 66 ++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c index 54932f163b3924..498efe410bc7e5 100644 --- a/sound/soc/sof/sof-pci-dev.c +++ b/sound/soc/sof/sof-pci-dev.c @@ -183,10 +183,12 @@ static void sof_pci_probe_complete(struct device *dev) int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { + struct sof_fw_layout_profile *fw_profile; struct device *dev = &pci->dev; const struct sof_dev_desc *desc = (const struct sof_dev_desc *)pci_id->driver_data; struct snd_sof_pdata *sof_pdata; + char *fw_path_postfix = NULL; int ret; dev_dbg(&pci->dev, "PCI DSP detected"); @@ -217,8 +219,6 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) sof_pdata->desc = desc; sof_pdata->dev = dev; - sof_pdata->ipc_type = desc->ipc_default; - if (sof_pci_ipc_type < 0) { sof_pdata->ipc_type = desc->ipc_default; } else { @@ -238,13 +238,41 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) sof_pdata->ipc_type = sof_pci_ipc_type; } + if (dmi_check_system(community_key_platforms) && sof_dmi_use_community_key) { + fw_path_postfix = "community"; + dev_dbg(dev, + "Platform uses community key, changing paths accordingly\n"); + } + + fw_profile = &sof_pdata->default_fw_profile; + ret = sof_create_default_fw_layout_profile(dev, sof_pdata->ipc_type, + desc, fw_path_postfix, + fw_profile); + if (!ret) { + if (sof_pdata->ipc_type != fw_profile->ipc_type) { + dev_info(dev, + "IPC type %d is not supported, using IPC type %d\n", + sof_pdata->ipc_type, fw_profile->ipc_type); + sof_pdata->ipc_type = fw_profile->ipc_type; + } + dev_dbg(dev, "Default firmware paths, filename:\n"); + dev_dbg(dev, "firmware path:\t\t%s\n", fw_profile->fw_path); + if (fw_profile->fw_lib_path) + dev_dbg(dev, "firmware library path:\t%s\n", + fw_profile->fw_lib_path); + dev_dbg(dev, "topology path:\t\t%s\n", fw_profile->tplg_path); + dev_dbg(dev, "firmware name:\t\t%s\n", fw_profile->fw_name); + } else { + goto out; + } + if (fw_filename) { sof_pdata->fw_filename = fw_filename; dev_dbg(dev, "Module parameter used, changed fw filename to %s\n", sof_pdata->fw_filename); } else { - sof_pdata->fw_filename = desc->default_fw_filename[sof_pdata->ipc_type]; + sof_pdata->fw_filename = fw_profile->fw_name; } /* @@ -261,19 +289,8 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) dev_dbg(dev, "Module parameter used, changed fw path to %s\n", sof_pdata->fw_filename_prefix); - - } else if (dmi_check_system(community_key_platforms) && sof_dmi_use_community_key) { - sof_pdata->fw_filename_prefix = - devm_kasprintf(dev, GFP_KERNEL, "%s/%s", - sof_pdata->desc->default_fw_path[sof_pdata->ipc_type], - "community"); - - dev_dbg(dev, - "Platform uses community key, changed fw path to %s\n", - sof_pdata->fw_filename_prefix); } else { - sof_pdata->fw_filename_prefix = - sof_pdata->desc->default_fw_path[sof_pdata->ipc_type]; + sof_pdata->fw_filename_prefix = fw_profile->fw_path; } if (lib_path) { @@ -282,27 +299,14 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) dev_dbg(dev, "Module parameter used, changed fw_lib path to %s\n", sof_pdata->fw_lib_prefix); - } else if (sof_pdata->desc->default_lib_path[sof_pdata->ipc_type]) { - if (dmi_check_system(community_key_platforms) && sof_dmi_use_community_key) { - sof_pdata->fw_lib_prefix = - devm_kasprintf(dev, GFP_KERNEL, "%s/%s", - sof_pdata->desc->default_lib_path[sof_pdata->ipc_type], - "community"); - - dev_dbg(dev, - "Platform uses community key, changed fw_lib path to %s\n", - sof_pdata->fw_lib_prefix); - } else { - sof_pdata->fw_lib_prefix = - sof_pdata->desc->default_lib_path[sof_pdata->ipc_type]; - } + } else { + sof_pdata->fw_lib_prefix = fw_profile->fw_lib_path; } if (tplg_path) sof_pdata->tplg_filename_prefix = tplg_path; else - sof_pdata->tplg_filename_prefix = - sof_pdata->desc->default_tplg_path[sof_pdata->ipc_type]; + sof_pdata->tplg_filename_prefix = fw_profile->tplg_path; /* * the topology filename will be provided in the machine descriptor, unless From f2bf0eedd11a3b250eaf2717348de2aa599d5cda Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 11:13:23 +0300 Subject: [PATCH 22/27] ASoC: SOF: amd: Drop default fw_path, tplg_path and fw_filename from descriptor The core no longer uses the default_fw_path, default_tplg_path and default_fw_filename. The paths and filename is created based on the vendor and platform strings. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/amd/pci-rmb.c | 9 --------- sound/soc/sof/amd/pci-rn.c | 9 --------- 2 files changed, 18 deletions(-) diff --git a/sound/soc/sof/amd/pci-rmb.c b/sound/soc/sof/amd/pci-rmb.c index 96da1542d92829..a64e135b0420d7 100644 --- a/sound/soc/sof/amd/pci-rmb.c +++ b/sound/soc/sof/amd/pci-rmb.c @@ -49,15 +49,6 @@ static const struct sof_dev_desc rembrandt_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = "amd", .platform = "rmb", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "amd/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "amd/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-rmb.ri", - }, .nocodec_tplg_filename = "sof-acp.tplg", .ops = &sof_rembrandt_ops, .ops_init = sof_rembrandt_ops_init, diff --git a/sound/soc/sof/amd/pci-rn.c b/sound/soc/sof/amd/pci-rn.c index 8c605922091fe6..2a1210910e521d 100644 --- a/sound/soc/sof/amd/pci-rn.c +++ b/sound/soc/sof/amd/pci-rn.c @@ -49,15 +49,6 @@ static const struct sof_dev_desc renoir_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = "amd", .platform = "rn", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "amd/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "amd/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-rn.ri", - }, .nocodec_tplg_filename = "sof-acp.tplg", .ops = &sof_renoir_ops, .ops_init = sof_renoir_ops_init, From e84d6354f233065c18b2bf036675eec99a5a1384 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 11:13:43 +0300 Subject: [PATCH 23/27] ASoC: SOF: imx: Drop default fw_path, tplg_path and fw_filename from descriptor The core no longer uses the default_fw_path, default_tplg_path and default_fw_filename. The paths and filename is created based on the vendor and platform strings. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/imx/imx8.c | 18 ------------------ sound/soc/sof/imx/imx8m.c | 9 --------- sound/soc/sof/imx/imx8ulp.c | 9 --------- 3 files changed, 36 deletions(-) diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index 08c04b659bc83b..d3b667aae34dd7 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -615,15 +615,6 @@ static struct sof_dev_desc sof_of_imx8qxp_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = vendor_string, .platform = "imx8x", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "imx/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "imx/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-imx8x.ri", - }, .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", .ops = &sof_imx8x_ops, }; @@ -633,15 +624,6 @@ static struct sof_dev_desc sof_of_imx8qm_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = vendor_string, .platform = "imx8", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "imx/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "imx/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-imx8.ri", - }, .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", .ops = &sof_imx8_ops, }; diff --git a/sound/soc/sof/imx/imx8m.c b/sound/soc/sof/imx/imx8m.c index 65155562c38c0c..02d2c4fb8de379 100644 --- a/sound/soc/sof/imx/imx8m.c +++ b/sound/soc/sof/imx/imx8m.c @@ -475,15 +475,6 @@ static struct sof_dev_desc sof_of_imx8mp_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = "imx", .platform = "imx8m", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "imx/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "imx/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-imx8m.ri", - }, .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", .ops = &sof_imx8m_ops, }; diff --git a/sound/soc/sof/imx/imx8ulp.c b/sound/soc/sof/imx/imx8ulp.c index 5b43ebf315f61e..41961b91a01a40 100644 --- a/sound/soc/sof/imx/imx8ulp.c +++ b/sound/soc/sof/imx/imx8ulp.c @@ -482,15 +482,6 @@ static struct sof_dev_desc sof_of_imx8ulp_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = "imx", .platform = "imx8ulp", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "imx/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "imx/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-imx8ulp.ri", - }, .nocodec_tplg_filename = "sof-imx8ulp-nocodec.tplg", .ops = &sof_imx8ulp_ops, }; From 55ba3b63f711aa3f3566e28edbeae4911076b032 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 11:14:15 +0300 Subject: [PATCH 24/27] ASoC: SOF: Intel: Drop default fw_path, tplg_path and fw_filename from descriptor The core no longer uses the default_fw_path, default_tplg_path and default_fw_filename. The paths and filename is created based on the vendor and platform strings. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/intel/bdw.c | 9 --- sound/soc/sof/intel/byt.c | 27 -------- sound/soc/sof/intel/pci-apl.c | 30 --------- sound/soc/sof/intel/pci-cnl.c | 45 ------------- sound/soc/sof/intel/pci-icl.c | 30 --------- sound/soc/sof/intel/pci-mtl.c | 12 ---- sound/soc/sof/intel/pci-skl.c | 18 ----- sound/soc/sof/intel/pci-tgl.c | 120 ---------------------------------- sound/soc/sof/intel/pci-tng.c | 9 --- 9 files changed, 300 deletions(-) diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c index 043cca23e98afa..84fda61b95aa41 100644 --- a/sound/soc/sof/intel/bdw.c +++ b/sound/soc/sof/intel/bdw.c @@ -643,15 +643,6 @@ static const struct sof_dev_desc sof_acpi_broadwell_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = "intel", .platform = "bdw", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-bdw.ri", - }, .nocodec_tplg_filename = "sof-bdw-nocodec.tplg", .ops = &sof_bdw_ops, }; diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c index b32629422dce6a..e1c7d694aabb8a 100644 --- a/sound/soc/sof/intel/byt.c +++ b/sound/soc/sof/intel/byt.c @@ -380,15 +380,6 @@ static const struct sof_dev_desc sof_acpi_baytrailcr_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = vendor_string, .platform = "byt", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-byt.ri", - }, .nocodec_tplg_filename = "sof-byt-nocodec.tplg", .ops = &sof_byt_ops, }; @@ -404,15 +395,6 @@ static const struct sof_dev_desc sof_acpi_baytrail_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = vendor_string, .platform = "byt", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-byt.ri", - }, .nocodec_tplg_filename = "sof-byt-nocodec.tplg", .ops = &sof_byt_ops, }; @@ -428,15 +410,6 @@ static const struct sof_dev_desc sof_acpi_cherrytrail_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = vendor_string, .platform = "cht", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-cht.ri", - }, .nocodec_tplg_filename = "sof-cht-nocodec.tplg", .ops = &sof_cht_ops, }; diff --git a/sound/soc/sof/intel/pci-apl.c b/sound/soc/sof/intel/pci-apl.c index 7fa4cfcb2f9952..a6cf777a2967d0 100644 --- a/sound/soc/sof/intel/pci-apl.c +++ b/sound/soc/sof/intel/pci-apl.c @@ -34,21 +34,6 @@ static const struct sof_dev_desc bxt_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "apl", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/apl", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/apl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-apl.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-apl-nocodec.tplg", .ops = &sof_apl_ops, .ops_init = sof_apl_ops_init, @@ -68,21 +53,6 @@ static const struct sof_dev_desc glk_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "glk", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/glk", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/glk", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-glk.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-glk-nocodec.tplg", .ops = &sof_apl_ops, .ops_init = sof_apl_ops_init, diff --git a/sound/soc/sof/intel/pci-cnl.c b/sound/soc/sof/intel/pci-cnl.c index 78d83bc75b7e03..21e3b9affe851e 100644 --- a/sound/soc/sof/intel/pci-cnl.c +++ b/sound/soc/sof/intel/pci-cnl.c @@ -35,21 +35,6 @@ static const struct sof_dev_desc cnl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "cnl", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/cnl", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/cnl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-cnl.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-cnl-nocodec.tplg", .ops = &sof_cnl_ops, .ops_init = sof_cnl_ops_init, @@ -70,21 +55,6 @@ static const struct sof_dev_desc cfl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "cfl", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/cfl", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/cfl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-cfl.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-cnl-nocodec.tplg", .ops = &sof_cnl_ops, .ops_init = sof_cnl_ops_init, @@ -105,21 +75,6 @@ static const struct sof_dev_desc cml_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "cml", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/cml", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/cml", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-cml.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-cnl-nocodec.tplg", .ops = &sof_cnl_ops, .ops_init = sof_cnl_ops_init, diff --git a/sound/soc/sof/intel/pci-icl.c b/sound/soc/sof/intel/pci-icl.c index c3a5fcf82723c1..f41bfd8a85b8fd 100644 --- a/sound/soc/sof/intel/pci-icl.c +++ b/sound/soc/sof/intel/pci-icl.c @@ -35,21 +35,6 @@ static const struct sof_dev_desc icl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "icl", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/icl", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/icl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-icl.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-icl-nocodec.tplg", .ops = &sof_icl_ops, .ops_init = sof_icl_ops_init, @@ -69,21 +54,6 @@ static const struct sof_dev_desc jsl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "jsl", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/jsl", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/jsl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-jsl.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-jsl-nocodec.tplg", .ops = &sof_cnl_ops, .ops_init = sof_cnl_ops_init, diff --git a/sound/soc/sof/intel/pci-mtl.c b/sound/soc/sof/intel/pci-mtl.c index 50e71f79a27806..16438290d6c66a 100644 --- a/sound/soc/sof/intel/pci-mtl.c +++ b/sound/soc/sof/intel/pci-mtl.c @@ -34,18 +34,6 @@ static const struct sof_dev_desc mtl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = "intel", .platform = "mtl", - .default_fw_path = { - [SOF_IPC_TYPE_4] = "intel/sof-ipc4/mtl", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/mtl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_4] = "intel/sof-ace-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_4] = "sof-mtl.ri", - }, .nocodec_tplg_filename = "sof-mtl-nocodec.tplg", .ops = &sof_mtl_ops, .ops_init = sof_mtl_ops_init, diff --git a/sound/soc/sof/intel/pci-skl.c b/sound/soc/sof/intel/pci-skl.c index 65426aad7d6042..c779f1d1966ba7 100644 --- a/sound/soc/sof/intel/pci-skl.c +++ b/sound/soc/sof/intel/pci-skl.c @@ -31,15 +31,6 @@ static struct sof_dev_desc skl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "skl", - .default_fw_path = { - [SOF_IPC_TYPE_4] = "intel/avs/skl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-skl-nocodec.tplg", .ops = &sof_skl_ops, .ops_init = sof_skl_ops_init, @@ -58,15 +49,6 @@ static struct sof_dev_desc kbl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "kbl", - .default_fw_path = { - [SOF_IPC_TYPE_4] = "intel/avs/kbl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-kbl-nocodec.tplg", .ops = &sof_skl_ops, .ops_init = sof_skl_ops_init, diff --git a/sound/soc/sof/intel/pci-tgl.c b/sound/soc/sof/intel/pci-tgl.c index ca311356763196..d9c2d6868ed6bd 100644 --- a/sound/soc/sof/intel/pci-tgl.c +++ b/sound/soc/sof/intel/pci-tgl.c @@ -35,21 +35,6 @@ static const struct sof_dev_desc tgl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "tgl", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/tgl", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/tgl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-tgl.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-tgl-nocodec.tplg", .ops = &sof_tgl_ops, .ops_init = sof_tgl_ops_init, @@ -70,21 +55,6 @@ static const struct sof_dev_desc tglh_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "tgl-h", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/tgl-h", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/tgl-h", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-tgl-h.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-tgl-nocodec.tplg", .ops = &sof_tgl_ops, .ops_init = sof_tgl_ops_init, @@ -104,21 +74,6 @@ static const struct sof_dev_desc ehl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "ehl", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/ehl", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/ehl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-ehl.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-ehl-nocodec.tplg", .ops = &sof_tgl_ops, .ops_init = sof_tgl_ops_init, @@ -139,21 +94,6 @@ static const struct sof_dev_desc adls_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "adl-s", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/adl-s", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/adl-s", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-adl-s.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-adl-nocodec.tplg", .ops = &sof_tgl_ops, .ops_init = sof_tgl_ops_init, @@ -174,21 +114,6 @@ static const struct sof_dev_desc adl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "adl", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/adl", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/adl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-adl.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-adl-nocodec.tplg", .ops = &sof_tgl_ops, .ops_init = sof_tgl_ops_init, @@ -209,21 +134,6 @@ static const struct sof_dev_desc adl_n_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "adl-n", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/adl-n", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/adl-n", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-adl-n.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-adl-nocodec.tplg", .ops = &sof_tgl_ops, .ops_init = sof_tgl_ops_init, @@ -244,21 +154,6 @@ static const struct sof_dev_desc rpls_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "rpl-s", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/rpl-s", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/rpl-s", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-rpl-s.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-rpl-nocodec.tplg", .ops = &sof_tgl_ops, .ops_init = sof_tgl_ops_init, @@ -279,21 +174,6 @@ static const struct sof_dev_desc rpl_desc = { .dspless_mode_supported = true, /* Only supported for HDaudio */ .vendor = vendor_string, .platform = "rpl", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - [SOF_IPC_TYPE_4] = "intel/avs/rpl", - }, - .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/avs-lib/rpl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - [SOF_IPC_TYPE_4] = "intel/avs-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-rpl.ri", - [SOF_IPC_TYPE_4] = "dsp_basefw.bin", - }, .nocodec_tplg_filename = "sof-rpl-nocodec.tplg", .ops = &sof_tgl_ops, .ops_init = sof_tgl_ops_init, diff --git a/sound/soc/sof/intel/pci-tng.c b/sound/soc/sof/intel/pci-tng.c index d664bb21805680..82bda665b5aa57 100644 --- a/sound/soc/sof/intel/pci-tng.c +++ b/sound/soc/sof/intel/pci-tng.c @@ -212,15 +212,6 @@ static const struct sof_dev_desc tng_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = "intel", .platform = "byt", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "intel/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "intel/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-byt.ri", - }, .nocodec_tplg_filename = "sof-byt.tplg", .ops = &sof_tng_ops, }; From 8bd8d5442f98b18fd0b66c63b098521cf9c29c74 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 11:14:29 +0300 Subject: [PATCH 25/27] ASoC: SOF: Intel: pci-lnl: Drop default fw_path, tplg_path and fw_filename from descriptor The core no longer uses the default_fw_path, default_tplg_path and default_fw_filename. The paths and filename is created based on the vendor and platform strings. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/intel/pci-lnl.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sound/soc/sof/intel/pci-lnl.c b/sound/soc/sof/intel/pci-lnl.c index 4ac0050b24dd1a..be7f28131fd843 100644 --- a/sound/soc/sof/intel/pci-lnl.c +++ b/sound/soc/sof/intel/pci-lnl.c @@ -34,15 +34,6 @@ static const struct sof_dev_desc lnl_desc = { .dspless_mode_supported = true, .vendor = "intel", .platform = "lnl", - .default_fw_path = { - [SOF_IPC_TYPE_4] = "intel/sof-ipc4/lnl", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_4] = "intel/sof-ace-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_4] = "sof-lnl.ri", - }, .nocodec_tplg_filename = "sof-lnl-nocodec.tplg", /* the MTL ops are still used for now */ .ops = &sof_mtl_ops, From 45603ac545ed20295fcc1ca8203dfd21340f90e8 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 11:14:42 +0300 Subject: [PATCH 26/27] ASoC: SOF: mediatek: Drop default fw_path, tplg_path and fw_filename from descriptor The core no longer uses the default_fw_path, default_tplg_path and default_fw_filename. The paths and filename is created based on the vendor and platform strings. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/mediatek/mt8186/mt8186.c | 18 ------------------ sound/soc/sof/mediatek/mt8195/mt8195.c | 9 --------- 2 files changed, 27 deletions(-) diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c index a4999253dc7d6d..2ab66dd70b5eb8 100644 --- a/sound/soc/sof/mediatek/mt8186/mt8186.c +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c @@ -619,15 +619,6 @@ static const struct sof_dev_desc sof_of_mt8186_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = vendor_string, .platform = "mt8186", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "mediatek/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "mediatek/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-mt8186.ri", - }, .nocodec_tplg_filename = "sof-mt8186-nocodec.tplg", .ops = &sof_mt8186_ops, }; @@ -637,15 +628,6 @@ static const struct sof_dev_desc sof_of_mt8188_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = vendor_string, .platform = "mt8188", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "mediatek/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "mediatek/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-mt8188.ri", - }, .nocodec_tplg_filename = "sof-mt8188-nocodec.tplg", .ops = &sof_mt8186_ops, }; diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index 47820fdcb692d3..57deacc989defb 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -673,15 +673,6 @@ static const struct sof_dev_desc sof_of_mt8195_desc = { .ipc_default = SOF_IPC_TYPE_3, .vendor = "mediatek", .platform = "mt8195", - .default_fw_path = { - [SOF_IPC_TYPE_3] = "mediatek/sof", - }, - .default_tplg_path = { - [SOF_IPC_TYPE_3] = "mediatek/sof-tplg", - }, - .default_fw_filename = { - [SOF_IPC_TYPE_3] = "sof-mt8195.ri", - }, .nocodec_tplg_filename = "sof-mt8195-nocodec.tplg", .ops = &sof_mt8195_ops, .ipc_timeout = 1000, From cbcdda87022f896669e4057a92759d58a36ed9f6 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 18 Apr 2023 11:16:33 +0300 Subject: [PATCH 27/27] ASoC: SOF: Remove the string arrays used for default paths and firmware name The default_fw_path, default_tplg_path, default_lib_path and default_fw_filename are no longer used, they can be removed from sof_dev_desc. Signed-off-by: Peter Ujfalusi --- include/sound/sof.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/sound/sof.h b/include/sound/sof.h index d3433fc543d462..30fe18ac0be2c3 100644 --- a/include/sound/sof.h +++ b/include/sound/sof.h @@ -183,14 +183,6 @@ struct sof_dev_desc { /* The platform supports DSPless mode */ bool dspless_mode_supported; - /* defaults paths for firmware, library and topology files */ - const char *default_fw_path[SOF_IPC_TYPE_COUNT]; - const char *default_lib_path[SOF_IPC_TYPE_COUNT]; - const char *default_tplg_path[SOF_IPC_TYPE_COUNT]; - - /* default firmware name */ - const char *default_fw_filename[SOF_IPC_TYPE_COUNT]; - /* strings used for the firmware layout path/filename creation */ const char *vendor; const char *platform;