Skip to content

Commit

Permalink
ASoC: SOF: debug-dsp-ops: Add ops for trace init/free
Browse files Browse the repository at this point in the history
These will be used to debugging purposes when testing the different DSP
ops.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
  • Loading branch information
ranj063 authored and plbossart committed Jul 30, 2024
1 parent 07f1b50 commit 7df4fc1
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion sound/soc/sof/debug-dsp-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}

0 comments on commit 7df4fc1

Please sign in to comment.