Commit 25b17da6 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: SOF: Rename dtrace_is_supported flag to fw_trace_is_supported

Rename the internal flag to not limit it's use for dma-trace, but to be
used for generic firmware tracing functionality.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220516104711.26115-3-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0cfbaee2
...@@ -250,7 +250,7 @@ static int sof_probe_continue(struct snd_sof_dev *sdev) ...@@ -250,7 +250,7 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
} }
if (sof_debug_check_flag(SOF_DBG_ENABLE_TRACE)) { if (sof_debug_check_flag(SOF_DBG_ENABLE_TRACE)) {
sdev->dtrace_is_supported = true; sdev->fw_trace_is_supported = true;
/* init DMA trace */ /* init DMA trace */
ret = snd_sof_init_trace(sdev); ret = snd_sof_init_trace(sdev);
......
...@@ -432,7 +432,7 @@ static int hda_dsp_set_D0_state(struct snd_sof_dev *sdev, ...@@ -432,7 +432,7 @@ static int hda_dsp_set_D0_state(struct snd_sof_dev *sdev,
* when the DSP enters D0I3 while the system is in S0 * when the DSP enters D0I3 while the system is in S0
* for debug purpose. * for debug purpose.
*/ */
if (!sdev->dtrace_is_supported || if (!sdev->fw_trace_is_supported ||
!hda_enable_trace_D0I3_S0 || !hda_enable_trace_D0I3_S0 ||
sdev->system_suspend_target != SOF_SUSPEND_NONE) sdev->system_suspend_target != SOF_SUSPEND_NONE)
flags = HDA_PM_NO_DMA_TRACE; flags = HDA_PM_NO_DMA_TRACE;
......
...@@ -546,13 +546,15 @@ struct snd_sof_dev { ...@@ -546,13 +546,15 @@ struct snd_sof_dev {
int ipc_timeout; int ipc_timeout;
int boot_timeout; int boot_timeout;
/* firmwre tracing */
bool fw_trace_is_supported; /* set with Kconfig or module parameter */
/* DMA for Trace */ /* DMA for Trace */
struct snd_dma_buffer dmatb; struct snd_dma_buffer dmatb;
struct snd_dma_buffer dmatp; struct snd_dma_buffer dmatp;
int dma_trace_pages; int dma_trace_pages;
wait_queue_head_t trace_sleep; wait_queue_head_t trace_sleep;
u32 host_offset; u32 host_offset;
bool dtrace_is_supported; /* set with Kconfig or module parameter */
bool dtrace_error; bool dtrace_error;
bool dtrace_draining; bool dtrace_draining;
enum sof_dtrace_state dtrace_state; enum sof_dtrace_state dtrace_state;
......
...@@ -392,7 +392,7 @@ static int snd_sof_enable_trace(struct snd_sof_dev *sdev) ...@@ -392,7 +392,7 @@ static int snd_sof_enable_trace(struct snd_sof_dev *sdev)
struct sof_ipc_reply ipc_reply; struct sof_ipc_reply ipc_reply;
int ret; int ret;
if (!sdev->dtrace_is_supported) if (!sdev->fw_trace_is_supported)
return 0; return 0;
if (sdev->dtrace_state == SOF_DTRACE_ENABLED || !sdev->dma_trace_pages) if (sdev->dtrace_state == SOF_DTRACE_ENABLED || !sdev->dma_trace_pages)
...@@ -459,9 +459,9 @@ int snd_sof_init_trace(struct snd_sof_dev *sdev) ...@@ -459,9 +459,9 @@ int snd_sof_init_trace(struct snd_sof_dev *sdev)
/* dtrace is only supported with SOF_IPC */ /* dtrace is only supported with SOF_IPC */
if (sdev->pdata->ipc_type != SOF_IPC) if (sdev->pdata->ipc_type != SOF_IPC)
sdev->dtrace_is_supported = false; sdev->fw_trace_is_supported = false;
if (!sdev->dtrace_is_supported) if (!sdev->fw_trace_is_supported)
return 0; return 0;
/* set false before start initialization */ /* set false before start initialization */
...@@ -521,7 +521,7 @@ EXPORT_SYMBOL(snd_sof_init_trace); ...@@ -521,7 +521,7 @@ EXPORT_SYMBOL(snd_sof_init_trace);
int snd_sof_trace_update_pos(struct snd_sof_dev *sdev, int snd_sof_trace_update_pos(struct snd_sof_dev *sdev,
struct sof_ipc_dma_trace_posn *posn) struct sof_ipc_dma_trace_posn *posn)
{ {
if (!sdev->dtrace_is_supported) if (!sdev->fw_trace_is_supported)
return 0; return 0;
if (sdev->dtrace_state == SOF_DTRACE_ENABLED && if (sdev->dtrace_state == SOF_DTRACE_ENABLED &&
...@@ -541,7 +541,7 @@ int snd_sof_trace_update_pos(struct snd_sof_dev *sdev, ...@@ -541,7 +541,7 @@ int snd_sof_trace_update_pos(struct snd_sof_dev *sdev,
/* an error has occurred within the DSP that prevents further trace */ /* an error has occurred within the DSP that prevents further trace */
void snd_sof_trace_notify_for_error(struct snd_sof_dev *sdev) void snd_sof_trace_notify_for_error(struct snd_sof_dev *sdev)
{ {
if (!sdev->dtrace_is_supported) if (!sdev->fw_trace_is_supported)
return; return;
if (sdev->dtrace_state == SOF_DTRACE_ENABLED) { if (sdev->dtrace_state == SOF_DTRACE_ENABLED) {
...@@ -559,7 +559,7 @@ static void snd_sof_release_trace(struct snd_sof_dev *sdev, bool only_stop) ...@@ -559,7 +559,7 @@ static void snd_sof_release_trace(struct snd_sof_dev *sdev, bool only_stop)
struct sof_ipc_reply ipc_reply; struct sof_ipc_reply ipc_reply;
int ret; int ret;
if (!sdev->dtrace_is_supported || sdev->dtrace_state == SOF_DTRACE_DISABLED) if (!sdev->fw_trace_is_supported || sdev->dtrace_state == SOF_DTRACE_DISABLED)
return; return;
ret = snd_sof_dma_trace_trigger(sdev, SNDRV_PCM_TRIGGER_STOP); ret = snd_sof_dma_trace_trigger(sdev, SNDRV_PCM_TRIGGER_STOP);
...@@ -611,7 +611,7 @@ EXPORT_SYMBOL(snd_sof_trace_resume); ...@@ -611,7 +611,7 @@ EXPORT_SYMBOL(snd_sof_trace_resume);
void snd_sof_free_trace(struct snd_sof_dev *sdev) void snd_sof_free_trace(struct snd_sof_dev *sdev)
{ {
if (!sdev->dtrace_is_supported) if (!sdev->fw_trace_is_supported)
return; return;
/* release trace */ /* release trace */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment