Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: SOF: add IPC-dependent file names

To avoid misleading file names, use different names for INTEL_IPC4
firmware files.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Chao Song <chao.song@intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Pierre-Louis Bossart and committed by
Mark Brown
a97abb3c 0cf8ff05

+88 -30
+1 -1
include/sound/sof.h
··· 133 133 const char *default_tplg_path[SOF_IPC_TYPE_COUNT]; 134 134 135 135 /* default firmware name */ 136 - const char *default_fw_filename; 136 + const char *default_fw_filename[SOF_IPC_TYPE_COUNT]; 137 137 138 138 const struct snd_sof_dsp_ops *ops; 139 139 };
+3 -1
sound/soc/sof/amd/pci-rn.c
··· 62 62 .default_tplg_path = { 63 63 [SOF_IPC] = "amd/sof-tplg", 64 64 }, 65 - .default_fw_filename = "sof-rn.ri", 65 + .default_fw_filename = { 66 + [SOF_IPC] = "sof-rn.ri", 67 + }, 66 68 .nocodec_tplg_filename = "sof-acp.tplg", 67 69 .ops = &sof_renoir_ops, 68 70 };
+6 -2
sound/soc/sof/imx/imx8.c
··· 621 621 .default_tplg_path = { 622 622 [SOF_IPC] = "imx/sof-tplg", 623 623 }, 624 - .default_fw_filename = "sof-imx8x.ri", 624 + .default_fw_filename = { 625 + [SOF_IPC] = "sof-imx8x.ri", 626 + }, 625 627 .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", 626 628 .ops = &sof_imx8x_ops, 627 629 }; ··· 637 635 .default_tplg_path = { 638 636 [SOF_IPC] = "imx/sof-tplg", 639 637 }, 640 - .default_fw_filename = "sof-imx8.ri", 638 + .default_fw_filename = { 639 + [SOF_IPC] = "sof-imx8.ri", 640 + }, 641 641 .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", 642 642 .ops = &sof_imx8_ops, 643 643 };
+3 -1
sound/soc/sof/imx/imx8m.c
··· 481 481 .default_tplg_path = { 482 482 [SOF_IPC] = "imx/sof-tplg", 483 483 }, 484 - .default_fw_filename = "sof-imx8m.ri", 484 + .default_fw_filename = { 485 + [SOF_IPC] = "sof-imx8m.ri", 486 + }, 485 487 .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", 486 488 .ops = &sof_imx8m_ops, 487 489 };
+3 -1
sound/soc/sof/intel/bdw.c
··· 654 654 .default_tplg_path = { 655 655 [SOF_IPC] = "intel/sof-tplg", 656 656 }, 657 - .default_fw_filename = "sof-bdw.ri", 657 + .default_fw_filename = { 658 + [SOF_IPC] = "sof-bdw.ri", 659 + }, 658 660 .nocodec_tplg_filename = "sof-bdw-nocodec.tplg", 659 661 .ops = &sof_bdw_ops, 660 662 };
+9 -3
sound/soc/sof/intel/byt.c
··· 396 396 .default_tplg_path = { 397 397 [SOF_IPC] = "intel/sof-tplg", 398 398 }, 399 - .default_fw_filename = "sof-byt.ri", 399 + .default_fw_filename = { 400 + [SOF_IPC] = "sof-byt.ri", 401 + }, 400 402 .nocodec_tplg_filename = "sof-byt-nocodec.tplg", 401 403 .ops = &sof_byt_ops, 402 404 }; ··· 418 416 .default_tplg_path = { 419 417 [SOF_IPC] = "intel/sof-tplg", 420 418 }, 421 - .default_fw_filename = "sof-byt.ri", 419 + .default_fw_filename = { 420 + [SOF_IPC] = "sof-byt.ri", 421 + }, 422 422 .nocodec_tplg_filename = "sof-byt-nocodec.tplg", 423 423 .ops = &sof_byt_ops, 424 424 }; ··· 440 436 .default_tplg_path = { 441 437 [SOF_IPC] = "intel/sof-tplg", 442 438 }, 443 - .default_fw_filename = "sof-cht.ri", 439 + .default_fw_filename = { 440 + [SOF_IPC] = "sof-cht.ri", 441 + }, 444 442 .nocodec_tplg_filename = "sof-cht-nocodec.tplg", 445 443 .ops = &sof_cht_ops, 446 444 };
+1 -1
sound/soc/sof/intel/hda.c
··· 1274 1274 mach->mach_params.links = mach->links; 1275 1275 mach->mach_params.link_mask = mach->link_mask; 1276 1276 mach->mach_params.platform = dev_name(sdev->dev); 1277 - pdata->fw_filename = pdata->desc->default_fw_filename; 1277 + pdata->fw_filename = pdata->desc->default_fw_filename[pdata->ipc_type]; 1278 1278 pdata->tplg_filename = mach->sof_tplg_filename; 1279 1279 1280 1280 /*
+8 -2
sound/soc/sof/intel/pci-apl.c
··· 37 37 [SOF_IPC] = "intel/sof-tplg", 38 38 [SOF_INTEL_IPC4] = "intel/avs-tplg", 39 39 }, 40 - .default_fw_filename = "sof-apl.ri", 40 + .default_fw_filename = { 41 + [SOF_IPC] = "sof-apl.ri", 42 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 43 + }, 41 44 .nocodec_tplg_filename = "sof-apl-nocodec.tplg", 42 45 .ops = &sof_apl_ops, 43 46 }; ··· 63 60 [SOF_IPC] = "intel/sof-tplg", 64 61 [SOF_INTEL_IPC4] = "intel/avs-tplg", 65 62 }, 66 - .default_fw_filename = "sof-glk.ri", 63 + .default_fw_filename = { 64 + [SOF_IPC] = "sof-glk.ri", 65 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 66 + }, 67 67 .nocodec_tplg_filename = "sof-glk-nocodec.tplg", 68 68 .ops = &sof_apl_ops, 69 69 };
+12 -3
sound/soc/sof/intel/pci-cnl.c
··· 38 38 [SOF_IPC] = "intel/sof-tplg", 39 39 [SOF_INTEL_IPC4] = "intel/avs-tplg", 40 40 }, 41 - .default_fw_filename = "sof-cnl.ri", 41 + .default_fw_filename = { 42 + [SOF_IPC] = "sof-cnl.ri", 43 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 44 + }, 42 45 .nocodec_tplg_filename = "sof-cnl-nocodec.tplg", 43 46 .ops = &sof_cnl_ops, 44 47 }; ··· 65 62 [SOF_IPC] = "intel/sof-tplg", 66 63 [SOF_INTEL_IPC4] = "intel/avs-tplg", 67 64 }, 68 - .default_fw_filename = "sof-cfl.ri", 65 + .default_fw_filename = { 66 + [SOF_IPC] = "sof-cfl.ri", 67 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 68 + }, 69 69 .nocodec_tplg_filename = "sof-cnl-nocodec.tplg", 70 70 .ops = &sof_cnl_ops, 71 71 }; ··· 92 86 [SOF_IPC] = "intel/sof-tplg", 93 87 [SOF_INTEL_IPC4] = "intel/avs-tplg", 94 88 }, 95 - .default_fw_filename = "sof-cml.ri", 89 + .default_fw_filename = { 90 + [SOF_IPC] = "sof-cml.ri", 91 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 92 + }, 96 93 .nocodec_tplg_filename = "sof-cnl-nocodec.tplg", 97 94 .ops = &sof_cnl_ops, 98 95 };
+8 -2
sound/soc/sof/intel/pci-icl.c
··· 38 38 [SOF_IPC] = "intel/sof-tplg", 39 39 [SOF_INTEL_IPC4] = "intel/avs-tplg", 40 40 }, 41 - .default_fw_filename = "sof-icl.ri", 41 + .default_fw_filename = { 42 + [SOF_IPC] = "sof-icl.ri", 43 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 44 + }, 42 45 .nocodec_tplg_filename = "sof-icl-nocodec.tplg", 43 46 .ops = &sof_icl_ops, 44 47 }; ··· 64 61 [SOF_IPC] = "intel/sof-tplg", 65 62 [SOF_INTEL_IPC4] = "intel/avs-tplg", 66 63 }, 67 - .default_fw_filename = "sof-jsl.ri", 64 + .default_fw_filename = { 65 + [SOF_IPC] = "sof-jsl.ri", 66 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 67 + }, 68 68 .nocodec_tplg_filename = "sof-jsl-nocodec.tplg", 69 69 .ops = &sof_cnl_ops, 70 70 };
+20 -5
sound/soc/sof/intel/pci-tgl.c
··· 38 38 [SOF_IPC] = "intel/sof-tplg", 39 39 [SOF_INTEL_IPC4] = "intel/avs-tplg", 40 40 }, 41 - .default_fw_filename = "sof-tgl.ri", 41 + .default_fw_filename = { 42 + [SOF_IPC] = "sof-tgl.ri", 43 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 44 + }, 42 45 .nocodec_tplg_filename = "sof-tgl-nocodec.tplg", 43 46 .ops = &sof_tgl_ops, 44 47 }; ··· 65 62 [SOF_IPC] = "intel/sof-tplg", 66 63 [SOF_INTEL_IPC4] = "intel/avs-tplg", 67 64 }, 68 - .default_fw_filename = "sof-tgl-h.ri", 65 + .default_fw_filename = { 66 + [SOF_IPC] = "sof-tgl-h.ri", 67 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 68 + }, 69 69 .nocodec_tplg_filename = "sof-tgl-nocodec.tplg", 70 70 .ops = &sof_tgl_ops, 71 71 }; ··· 91 85 [SOF_IPC] = "intel/sof-tplg", 92 86 [SOF_INTEL_IPC4] = "intel/avs-tplg", 93 87 }, 94 - .default_fw_filename = "sof-ehl.ri", 88 + .default_fw_filename = { 89 + [SOF_IPC] = "sof-ehl.ri", 90 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 91 + }, 95 92 .nocodec_tplg_filename = "sof-ehl-nocodec.tplg", 96 93 .ops = &sof_tgl_ops, 97 94 }; ··· 118 109 [SOF_IPC] = "intel/sof-tplg", 119 110 [SOF_INTEL_IPC4] = "intel/avs-tplg", 120 111 }, 121 - .default_fw_filename = "sof-adl-s.ri", 112 + .default_fw_filename = { 113 + [SOF_IPC] = "sof-adl-s.ri", 114 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 115 + }, 122 116 .nocodec_tplg_filename = "sof-adl-nocodec.tplg", 123 117 .ops = &sof_tgl_ops, 124 118 }; ··· 145 133 [SOF_IPC] = "intel/sof-tplg", 146 134 [SOF_INTEL_IPC4] = "intel/avs-tplg", 147 135 }, 148 - .default_fw_filename = "sof-adl.ri", 136 + .default_fw_filename = { 137 + [SOF_IPC] = "sof-adl.ri", 138 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 139 + }, 149 140 .nocodec_tplg_filename = "sof-adl-nocodec.tplg", 150 141 .ops = &sof_tgl_ops, 151 142 };
+3 -1
sound/soc/sof/intel/pci-tng.c
··· 227 227 .default_tplg_path = { 228 228 [SOF_IPC] = "intel/sof-tplg", 229 229 }, 230 - .default_fw_filename = "sof-byt.ri", 230 + .default_fw_filename = { 231 + [SOF_IPC] = "sof-byt.ri", 232 + }, 231 233 .nocodec_tplg_filename = "sof-byt.tplg", 232 234 .ops = &sof_tng_ops, 233 235 };
+3 -1
sound/soc/sof/mediatek/mt8195/mt8195.c
··· 448 448 .default_tplg_path = { 449 449 [SOF_IPC] = "mediatek/sof-tplg", 450 450 }, 451 - .default_fw_filename = "sof-mt8195.ri", 451 + .default_fw_filename = { 452 + [SOF_IPC] = "sof-mt8195.ri", 453 + }, 452 454 .nocodec_tplg_filename = "sof-mt8195-nocodec.tplg", 453 455 .ops = &sof_mt8195_ops, 454 456 };
+1 -1
sound/soc/sof/sof-acpi-dev.c
··· 74 74 75 75 sof_pdata->desc = desc; 76 76 sof_pdata->dev = &pdev->dev; 77 - sof_pdata->fw_filename = desc->default_fw_filename; 77 + sof_pdata->fw_filename = desc->default_fw_filename[SOF_IPC]; 78 78 79 79 /* alternate fw and tplg filenames ? */ 80 80 if (fw_path)
+1 -1
sound/soc/sof/sof-of-dev.c
··· 64 64 65 65 sof_pdata->desc = desc; 66 66 sof_pdata->dev = &pdev->dev; 67 - sof_pdata->fw_filename = desc->default_fw_filename; 67 + sof_pdata->fw_filename = desc->default_fw_filename[SOF_IPC]; 68 68 69 69 if (fw_path) 70 70 sof_pdata->fw_filename_prefix = fw_path;
+6 -4
sound/soc/sof/sof-pci-dev.c
··· 173 173 sof_pdata->name = pci_name(pci); 174 174 sof_pdata->desc = desc; 175 175 sof_pdata->dev = dev; 176 - sof_pdata->fw_filename = desc->default_fw_filename; 176 + 177 + sof_pdata->ipc_type = desc->ipc_default; 178 + sof_pdata->fw_filename = desc->default_fw_filename[sof_pdata->ipc_type]; 177 179 178 180 /* 179 181 * for platforms using the SOF community key, change the ··· 195 193 } else if (dmi_check_system(community_key_platforms)) { 196 194 sof_pdata->fw_filename_prefix = 197 195 devm_kasprintf(dev, GFP_KERNEL, "%s/%s", 198 - sof_pdata->desc->default_fw_path[SOF_IPC], 196 + sof_pdata->desc->default_fw_path[sof_pdata->ipc_type], 199 197 "community"); 200 198 201 199 dev_dbg(dev, ··· 203 201 sof_pdata->fw_filename_prefix); 204 202 } else { 205 203 sof_pdata->fw_filename_prefix = 206 - sof_pdata->desc->default_fw_path[SOF_IPC]; 204 + sof_pdata->desc->default_fw_path[sof_pdata->ipc_type]; 207 205 } 208 206 209 207 if (tplg_path) 210 208 sof_pdata->tplg_filename_prefix = tplg_path; 211 209 else 212 210 sof_pdata->tplg_filename_prefix = 213 - sof_pdata->desc->default_tplg_path[SOF_IPC]; 211 + sof_pdata->desc->default_tplg_path[sof_pdata->ipc_type]; 214 212 215 213 dmi_check_system(sof_tplg_table); 216 214 if (sof_override_tplg_name)