diff --git a/sound/soc/sof/debug-dsp-ops.c b/sound/soc/sof/debug-dsp-ops.c index 9f62fa4ab4fdfb..02215f124cb5ad 100644 --- a/sound/soc/sof/debug-dsp-ops.c +++ b/sound/soc/sof/debug-dsp-ops.c @@ -48,6 +48,15 @@ static int sof_dsp_ops_set_power_state(struct snd_sof_dev *sdev, char *state) return 0; } +static int sof_dsp_ops_trace_init(struct snd_sof_dev *sdev, bool init) +{ + if (init) + return sof_fw_trace_init(sdev); + + sof_fw_trace_free(sdev); + return 0; +} + static void sof_dsp_ops_unload_firmware(struct snd_sof_dev *sdev) { /* release the currently loaded firmware */ @@ -202,6 +211,13 @@ static ssize_t sof_dsp_ops_tester_dfs_write(struct file *file, const char __user size_t size; char *string; + + if (!strcmp(dentry->d_name.name, "init_trace")) + return sof_dsp_ops_trace_init(sdev, true); + + if (!strcmp(dentry->d_name.name, "free_trace")) + return sof_dsp_ops_trace_init(sdev, false); + if (!strcmp(dentry->d_name.name, "unload_fw")) { string = kzalloc(count + 1, GFP_KERNEL); if (!string) @@ -330,5 +346,13 @@ int sof_dbg_dsp_ops_test_init(struct snd_sof_dev *sdev) if (ret < 0) return ret; - return sof_dsp_dsp_ops_create_dfse(sdev, "unload_fw", dsp_ops_debugfs, 0222); + ret = sof_dsp_dsp_ops_create_dfse(sdev, "unload_fw", dsp_ops_debugfs, 0222); + if (ret < 0) + return ret; + + ret = sof_dsp_dsp_ops_create_dfse(sdev, "init_trace", dsp_ops_debugfs, 0222); + if (ret < 0) + return ret; + + return sof_dsp_dsp_ops_create_dfse(sdev, "free_trace", dsp_ops_debugfs, 0222); }