Skip to content

Commit 17f4041

Browse files
plbossartbroonie
authored andcommitted
ASoC: SOF: debug: show firmware/topology prefix/names
The SOF driver has multiple profiles to select firmware/topology prefix/names depending on the platform and ipc_type, and each of those fields can be overridden with kernel parameters. This results in some cases in confusion on what configuration is actually used in a given test. We currently log the firmware and topology names in the kernel logs, but there's been an ask to add the information in debugfs to simplify test scripts used by developers and CI. This isn't meant to be a stable ABI used by apps, changes will be allowed as needed. Closes: thesofproject#3867 Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Reviewed-by: Bard Liao <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 90a2353 commit 17f4041

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

sound/soc/sof/debug.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,32 @@ EXPORT_SYMBOL_GPL(snd_sof_dbg_memory_info_init);
330330

331331
int snd_sof_dbg_init(struct snd_sof_dev *sdev)
332332
{
333+
struct snd_sof_pdata *plat_data = sdev->pdata;
333334
struct snd_sof_dsp_ops *ops = sof_ops(sdev);
334335
const struct snd_sof_debugfs_map *map;
336+
struct dentry *fw_profile;
335337
int i;
336338
int err;
337339

338340
/* use "sof" as top level debugFS dir */
339341
sdev->debugfs_root = debugfs_create_dir("sof", NULL);
340342

343+
/* expose firmware/topology prefix/names for test purposes */
344+
fw_profile = debugfs_create_dir("fw_profile", sdev->debugfs_root);
345+
346+
debugfs_create_str("fw_path", 0444, fw_profile,
347+
(char **)&plat_data->fw_filename_prefix);
348+
debugfs_create_str("fw_lib_path", 0444, fw_profile,
349+
(char **)&plat_data->fw_lib_prefix);
350+
debugfs_create_str("tplg_path", 0444, fw_profile,
351+
(char **)&plat_data->tplg_filename_prefix);
352+
debugfs_create_str("fw_name", 0444, fw_profile,
353+
(char **)&plat_data->fw_filename);
354+
debugfs_create_str("tplg_name", 0444, fw_profile,
355+
(char **)&plat_data->tplg_filename);
356+
debugfs_create_u32("ipc_type", 0444, fw_profile,
357+
(u32 *)&plat_data->ipc_type);
358+
341359
/* init dfsentry list */
342360
INIT_LIST_HEAD(&sdev->dfsentry_list);
343361

0 commit comments

Comments
 (0)