ASoC: SOF: debug/ops: Move the IPC and DSP dump functions out from the header
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Wed, 6 Oct 2021 11:06:33 +0000 (14:06 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 7 Oct 2021 14:45:28 +0000 (15:45 +0100)
To be usable in platform code, move the IPC and DSP dump function to
debug.c and export it in a similar way as the snd_sof_handle_fw_exception()

Make the snd_sof_ipc_dump() static as it is only used in debug.c

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/debug.c
sound/soc/sof/ops.h

index 221808a8e759ac2179b6e140a6e87e88eceb6f3b..9ed6728c2017239967302a011713c083fa64c895 100644 (file)
@@ -822,6 +822,29 @@ void snd_sof_free_debug(struct snd_sof_dev *sdev)
 }
 EXPORT_SYMBOL_GPL(snd_sof_free_debug);
 
+void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags)
+{
+       if (sof_ops(sdev)->dbg_dump && !sdev->dbg_dump_printed) {
+               dev_err(sdev->dev, "------------[ DSP dump start ]------------\n");
+               sof_ops(sdev)->dbg_dump(sdev, flags);
+               dev_err(sdev->dev, "------------[ DSP dump end ]------------\n");
+               if (!(sof_core_debug & SOF_DBG_PRINT_ALL_DUMPS))
+                       sdev->dbg_dump_printed = true;
+       }
+}
+EXPORT_SYMBOL(snd_sof_dsp_dbg_dump);
+
+static void snd_sof_ipc_dump(struct snd_sof_dev *sdev)
+{
+       if (sof_ops(sdev)->ipc_dump  && !sdev->ipc_dump_printed) {
+               dev_err(sdev->dev, "------------[ IPC dump start ]------------\n");
+               sof_ops(sdev)->ipc_dump(sdev);
+               dev_err(sdev->dev, "------------[ IPC dump end ]------------\n");
+               if (!(sof_core_debug & SOF_DBG_PRINT_ALL_DUMPS))
+                       sdev->ipc_dump_printed = true;
+       }
+}
+
 void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev)
 {
        if (IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_RETAIN_DSP_CONTEXT) ||
index c7670514aa68fa627f1b565fd396d89c5fdd107a..290e32a8a7d40d1d14c3a2956f64d6c9e7362911 100644 (file)
@@ -241,27 +241,7 @@ snd_sof_dsp_set_power_state(struct snd_sof_dev *sdev,
 }
 
 /* debug */
-static inline void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags)
-{
-       if (sof_ops(sdev)->dbg_dump && !sdev->dbg_dump_printed) {
-               dev_err(sdev->dev, "------------[ DSP dump start ]------------\n");
-               sof_ops(sdev)->dbg_dump(sdev, flags);
-               dev_err(sdev->dev, "------------[ DSP dump end ]------------\n");
-               if (!(sof_core_debug & SOF_DBG_PRINT_ALL_DUMPS))
-                       sdev->dbg_dump_printed = true;
-       }
-}
-
-static inline void snd_sof_ipc_dump(struct snd_sof_dev *sdev)
-{
-       if (sof_ops(sdev)->ipc_dump  && !sdev->ipc_dump_printed) {
-               dev_err(sdev->dev, "------------[ IPC dump start ]------------\n");
-               sof_ops(sdev)->ipc_dump(sdev);
-               dev_err(sdev->dev, "------------[ IPC dump end ]------------\n");
-               if (!(sof_core_debug & SOF_DBG_PRINT_ALL_DUMPS))
-                       sdev->ipc_dump_printed = true;
-       }
-}
+void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags);
 
 static inline int snd_sof_debugfs_add_region_item(struct snd_sof_dev *sdev,
                enum snd_sof_fw_blk_type blk_type, u32 offset, size_t size,