Commit 12b401f4 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: SOF: Use sof_debug_check_flag() instead of sof_core_debug directly

The sof_debug_check_flag() is available for checking flags set in
sof_core_debug.

sof_core_debug can be marked static in core.c
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211223113628.18582-5-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f902b21a
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#endif #endif
/* see SOF_DBG_ flags */ /* see SOF_DBG_ flags */
int sof_core_debug = IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_FIRMWARE_TRACE); static int sof_core_debug = IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_FIRMWARE_TRACE);
module_param_named(sof_debug, sof_core_debug, int, 0444); module_param_named(sof_debug, sof_core_debug, int, 0444);
MODULE_PARM_DESC(sof_debug, "SOF core debug options (0x0 all off)"); MODULE_PARM_DESC(sof_debug, "SOF core debug options (0x0 all off)");
...@@ -218,7 +218,7 @@ static int sof_probe_continue(struct snd_sof_dev *sdev) ...@@ -218,7 +218,7 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
goto fw_run_err; goto fw_run_err;
} }
if (sof_core_debug & SOF_DBG_ENABLE_TRACE) { if (sof_debug_check_flag(SOF_DBG_ENABLE_TRACE)) {
sdev->dtrace_is_supported = true; sdev->dtrace_is_supported = true;
/* init DMA trace */ /* init DMA trace */
......
...@@ -957,7 +957,7 @@ static void snd_sof_dbg_print_fw_state(struct snd_sof_dev *sdev) ...@@ -957,7 +957,7 @@ static void snd_sof_dbg_print_fw_state(struct snd_sof_dev *sdev)
void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags) void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags)
{ {
bool print_all = !!(sof_core_debug & SOF_DBG_PRINT_ALL_DUMPS); bool print_all = sof_debug_check_flag(SOF_DBG_PRINT_ALL_DUMPS);
if (flags & SOF_DBG_DUMP_OPTIONAL && !print_all) if (flags & SOF_DBG_DUMP_OPTIONAL && !print_all)
return; return;
...@@ -979,7 +979,7 @@ static void snd_sof_ipc_dump(struct snd_sof_dev *sdev) ...@@ -979,7 +979,7 @@ static void snd_sof_ipc_dump(struct snd_sof_dev *sdev)
dev_err(sdev->dev, "------------[ IPC dump start ]------------\n"); dev_err(sdev->dev, "------------[ IPC dump start ]------------\n");
sof_ops(sdev)->ipc_dump(sdev); sof_ops(sdev)->ipc_dump(sdev);
dev_err(sdev->dev, "------------[ IPC dump end ]------------\n"); dev_err(sdev->dev, "------------[ IPC dump end ]------------\n");
if (!(sof_core_debug & SOF_DBG_PRINT_ALL_DUMPS)) if (!sof_debug_check_flag(SOF_DBG_PRINT_ALL_DUMPS))
sdev->ipc_dump_printed = true; sdev->ipc_dump_printed = true;
} }
} }
...@@ -987,7 +987,7 @@ static void snd_sof_ipc_dump(struct snd_sof_dev *sdev) ...@@ -987,7 +987,7 @@ static void snd_sof_ipc_dump(struct snd_sof_dev *sdev)
void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev) void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev)
{ {
if (IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_RETAIN_DSP_CONTEXT) || if (IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_RETAIN_DSP_CONTEXT) ||
(sof_core_debug & SOF_DBG_RETAIN_CTX)) { sof_debug_check_flag(SOF_DBG_RETAIN_CTX)) {
/* should we prevent DSP entering D3 ? */ /* should we prevent DSP entering D3 ? */
if (!sdev->ipc_dump_printed) if (!sdev->ipc_dump_printed)
dev_info(sdev->dev, dev_info(sdev->dev,
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#define SOF_DBG_DUMP_OPTIONAL BIT(4) /* only dump if SOF_DBG_PRINT_ALL_DUMPS is set */ #define SOF_DBG_DUMP_OPTIONAL BIT(4) /* only dump if SOF_DBG_PRINT_ALL_DUMPS is set */
/* global debug state set by SOF_DBG_ flags */ /* global debug state set by SOF_DBG_ flags */
extern int sof_core_debug;
bool sof_debug_check_flag(int mask); bool sof_debug_check_flag(int mask);
/* max BARs mmaped devices can use */ /* max BARs mmaped devices can use */
......
...@@ -1695,12 +1695,12 @@ static int sof_widget_load_pipeline(struct snd_soc_component *scomp, int index, ...@@ -1695,12 +1695,12 @@ static int sof_widget_load_pipeline(struct snd_soc_component *scomp, int index,
goto err; goto err;
} }
if (sof_core_debug & SOF_DBG_DISABLE_MULTICORE) if (sof_debug_check_flag(SOF_DBG_DISABLE_MULTICORE))
pipeline->core = SOF_DSP_PRIMARY_CORE; pipeline->core = SOF_DSP_PRIMARY_CORE;
if (sof_core_debug & SOF_DBG_DYNAMIC_PIPELINES_OVERRIDE) if (sof_debug_check_flag(SOF_DBG_DYNAMIC_PIPELINES_OVERRIDE))
swidget->dynamic_pipeline_widget = sof_core_debug & swidget->dynamic_pipeline_widget =
SOF_DBG_DYNAMIC_PIPELINES_ENABLE; sof_debug_check_flag(SOF_DBG_DYNAMIC_PIPELINES_ENABLE);
dev_dbg(scomp->dev, "pipeline %s: period %d pri %d mips %d core %d frames %d dynamic %d\n", dev_dbg(scomp->dev, "pipeline %s: period %d pri %d mips %d core %d frames %d dynamic %d\n",
swidget->widget->name, pipeline->period, pipeline->priority, swidget->widget->name, pipeline->period, pipeline->priority,
...@@ -2295,7 +2295,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, ...@@ -2295,7 +2295,7 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
return ret; return ret;
} }
if (sof_core_debug & SOF_DBG_DISABLE_MULTICORE) if (sof_debug_check_flag(SOF_DBG_DISABLE_MULTICORE))
comp.core = SOF_DSP_PRIMARY_CORE; comp.core = SOF_DSP_PRIMARY_CORE;
swidget->core = comp.core; swidget->core = comp.core;
...@@ -3542,7 +3542,7 @@ static int sof_complete(struct snd_soc_component *scomp) ...@@ -3542,7 +3542,7 @@ static int sof_complete(struct snd_soc_component *scomp)
} }
/* verify topology components loading including dynamic pipelines */ /* verify topology components loading including dynamic pipelines */
if (sof_core_debug & SOF_DBG_VERIFY_TPLG) { if (sof_debug_check_flag(SOF_DBG_VERIFY_TPLG)) {
ret = sof_set_up_pipelines(sdev, true); ret = sof_set_up_pipelines(sdev, true);
if (ret < 0) { if (ret < 0) {
dev_err(sdev->dev, "error: topology verification failed %d\n", ret); dev_err(sdev->dev, "error: topology verification failed %d\n", ret);
......
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