]> www.infradead.org Git - users/hch/misc.git/commitdiff
ASoC: Intel: avs: Separate debug symbols
authorCezary Rojewski <cezary.rojewski@intel.com>
Mon, 18 Aug 2025 10:41:23 +0000 (12:41 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 18 Aug 2025 12:10:05 +0000 (13:10 +0100)
Make it clear what is part of debug functionality and what is not by
separating debug symbols away from the common header file.

Apart from changing avs_probe_platform_register() to return -ENOTSUPP
when CONFIG_DEBUG_FS is disabled, status quo is achieved.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250818104126.526442-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 files changed:
sound/soc/intel/avs/apl.c
sound/soc/intel/avs/avs.h
sound/soc/intel/avs/board_selection.c
sound/soc/intel/avs/cnl.c
sound/soc/intel/avs/core.c
sound/soc/intel/avs/debug.h [new file with mode: 0644]
sound/soc/intel/avs/debugfs.c
sound/soc/intel/avs/icl.c
sound/soc/intel/avs/ipc.c
sound/soc/intel/avs/lnl.c
sound/soc/intel/avs/mtl.c
sound/soc/intel/avs/probes.c
sound/soc/intel/avs/ptl.c
sound/soc/intel/avs/skl.c
sound/soc/intel/avs/tgl.c

index 3dccf0a57a3a1180557c1046b62a9d87ecba4b18..b922eeaba843bf19caaad43e15bb5f8726f898fd 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/slab.h>
 #include <sound/hdaudio_ext.h>
 #include "avs.h"
+#include "debug.h"
 #include "messages.h"
 #include "path.h"
 #include "registers.h"
index 4c096afc5848ee4bf0432115ebbb4b1e904adeaf..2be35c19d6ee868ceb128ad4229697a494fde613 100644 (file)
@@ -359,80 +359,7 @@ int avs_hda_platform_register(struct avs_dev *adev, const char *name);
 int avs_register_all_boards(struct avs_dev *adev);
 void avs_unregister_all_boards(struct avs_dev *adev);
 
-/* Firmware tracing helpers */
-
-#define avs_log_buffer_size(adev) \
-       ((adev)->fw_cfg.trace_log_bytes / (adev)->hw_cfg.dsp_cores)
-
-#define avs_log_buffer_addr(adev, core) \
-({ \
-       s32 __offset = avs_dsp_op(adev, log_buffer_offset, core); \
-       (__offset < 0) ? NULL : \
-                        (avs_sram_addr(adev, AVS_DEBUG_WINDOW) + __offset); \
-})
-
-static inline int avs_log_buffer_status_locked(struct avs_dev *adev, union avs_notify_msg *msg)
-{
-       unsigned long flags;
-       int ret;
-
-       spin_lock_irqsave(&adev->trace_lock, flags);
-       ret = avs_dsp_op(adev, log_buffer_status, msg);
-       spin_unlock_irqrestore(&adev->trace_lock, flags);
-
-       return ret;
-}
-
-struct avs_apl_log_buffer_layout {
-       u32 read_ptr;
-       u32 write_ptr;
-       u8 buffer[];
-} __packed;
-static_assert(sizeof(struct avs_apl_log_buffer_layout) == 8);
-
-#define avs_apl_log_payload_size(adev) \
-       (avs_log_buffer_size(adev) - sizeof(struct avs_apl_log_buffer_layout))
-
-#define avs_apl_log_payload_addr(addr) \
-       (addr + sizeof(struct avs_apl_log_buffer_layout))
-
-#ifdef CONFIG_DEBUG_FS
-#define AVS_SET_ENABLE_LOGS_OP(name) \
-       .enable_logs = avs_##name##_enable_logs
-
-bool avs_logging_fw(struct avs_dev *adev);
-void avs_dump_fw_log(struct avs_dev *adev, const void __iomem *src, unsigned int len);
-void avs_dump_fw_log_wakeup(struct avs_dev *adev, const void __iomem *src, unsigned int len);
-
-int avs_probe_platform_register(struct avs_dev *adev, const char *name);
-
-void avs_debugfs_init(struct avs_dev *adev);
-void avs_debugfs_exit(struct avs_dev *adev);
-#else
-#define AVS_SET_ENABLE_LOGS_OP(name)
-
-static inline bool avs_logging_fw(struct avs_dev *adev)
-{
-       return false;
-}
-
-static inline void avs_dump_fw_log(struct avs_dev *adev, const void __iomem *src, unsigned int len)
-{
-}
-
-static inline void
-avs_dump_fw_log_wakeup(struct avs_dev *adev, const void __iomem *src, unsigned int len)
-{
-}
-
-static inline int avs_probe_platform_register(struct avs_dev *adev, const char *name)
-{
-       return 0;
-}
-
-static inline void avs_debugfs_init(struct avs_dev *adev) { }
-static inline void avs_debugfs_exit(struct avs_dev *adev) { }
-#endif
+int avs_parse_sched_cfg(struct avs_dev *adev, const char *buf, size_t len);
 
 /* Filesystems integration */
 
index fb49167f5fc4ba4ed3581b3b58d5d156c4aee4aa..9eb59d5a73f70c626ab6c67f6ce77166d602eab4 100644 (file)
@@ -17,6 +17,7 @@
 #include <sound/soc-acpi.h>
 #include <sound/soc-component.h>
 #include "avs.h"
+#include "debug.h"
 #include "utils.h"
 
 static char *i2s_test;
index 03f8fb0dc187f529b64489de1a25b9195b3038d0..5b5359e9128b8025943fe5ee1ed4eda15b021776 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <sound/hdaudio_ext.h>
 #include "avs.h"
+#include "debug.h"
 #include "messages.h"
 #include "registers.h"
 
index 5ebadba07ecc00fc5648314e86be0ea5da20edad..6e0e65584c7f8c44c0af0a81e00ae3889aa712aa 100644 (file)
@@ -27,6 +27,7 @@
 #include "../../codecs/hda.h"
 #include "avs.h"
 #include "cldma.h"
+#include "debug.h"
 #include "messages.h"
 #include "pcm.h"
 
diff --git a/sound/soc/intel/avs/debug.h b/sound/soc/intel/avs/debug.h
new file mode 100644 (file)
index 0000000..9f0f6f3
--- /dev/null
@@ -0,0 +1,91 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright(c) 2024-2025 Intel Corporation
+ *
+ * Authors: Cezary Rojewski <cezary.rojewski@intel.com>
+ *          Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com>
+ */
+
+#ifndef __SOUND_SOC_INTEL_AVS_DEBUG_H
+#define __SOUND_SOC_INTEL_AVS_DEBUG_H
+
+#include "messages.h"
+#include "registers.h"
+
+struct avs_dev;
+
+#define avs_log_buffer_size(adev) \
+       ((adev)->fw_cfg.trace_log_bytes / (adev)->hw_cfg.dsp_cores)
+
+#define avs_log_buffer_addr(adev, core) \
+({                                                                             \
+       s32 __offset = avs_dsp_op(adev, log_buffer_offset, core);               \
+       (__offset < 0) ? NULL :                                                 \
+                        (avs_sram_addr(adev, AVS_DEBUG_WINDOW) + __offset);    \
+})
+
+static inline int avs_log_buffer_status_locked(struct avs_dev *adev, union avs_notify_msg *msg)
+{
+       unsigned long flags;
+       int ret;
+
+       spin_lock_irqsave(&adev->trace_lock, flags);
+       ret = avs_dsp_op(adev, log_buffer_status, msg);
+       spin_unlock_irqrestore(&adev->trace_lock, flags);
+
+       return ret;
+}
+
+struct avs_apl_log_buffer_layout {
+       u32 read_ptr;
+       u32 write_ptr;
+       u8 buffer[];
+} __packed;
+static_assert(sizeof(struct avs_apl_log_buffer_layout) == 8);
+
+#define avs_apl_log_payload_size(adev) \
+       (avs_log_buffer_size(adev) - sizeof(struct avs_apl_log_buffer_layout))
+
+#define avs_apl_log_payload_addr(addr) \
+       (addr + sizeof(struct avs_apl_log_buffer_layout))
+
+#ifdef CONFIG_DEBUG_FS
+int avs_probe_platform_register(struct avs_dev *adev, const char *name);
+
+#define AVS_SET_ENABLE_LOGS_OP(name) \
+       .enable_logs = avs_##name##_enable_logs
+
+bool avs_logging_fw(struct avs_dev *adev);
+void avs_dump_fw_log(struct avs_dev *adev, const void __iomem *src, unsigned int len);
+void avs_dump_fw_log_wakeup(struct avs_dev *adev, const void __iomem *src, unsigned int len);
+
+void avs_debugfs_init(struct avs_dev *adev);
+void avs_debugfs_exit(struct avs_dev *adev);
+
+#else
+static inline int avs_probe_platform_register(struct avs_dev *adev, const char *name)
+{
+       return -EOPNOTSUPP;
+}
+
+#define AVS_SET_ENABLE_LOGS_OP(name)
+
+static inline bool avs_logging_fw(struct avs_dev *adev)
+{
+       return false;
+}
+
+static inline void avs_dump_fw_log(struct avs_dev *adev, const void __iomem *src, unsigned int len)
+{
+}
+
+static inline void avs_dump_fw_log_wakeup(struct avs_dev *adev, const void __iomem *src,
+                                         unsigned int len)
+{
+}
+
+static inline void avs_debugfs_init(struct avs_dev *adev) { }
+static inline void avs_debugfs_exit(struct avs_dev *adev) { }
+#endif
+
+#endif
index f508f215ecd2b6170c6359f10091cb7446774f82..3534de46f9e45b6529e38222b66181df3e548b14 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/string_helpers.h>
 #include <sound/soc.h>
 #include "avs.h"
+#include "debug.h"
 #include "messages.h"
 
 static unsigned int __kfifo_fromio(struct kfifo *fifo, const void __iomem *src, unsigned int len)
index f8d327ea2656e8c945effe566f0d47d4f20b0824..d655e727bebdf43a7cce7037a951e18fde7068e9 100644 (file)
@@ -10,6 +10,7 @@
 #include <sound/hdaudio.h>
 #include <sound/hdaudio_ext.h>
 #include "avs.h"
+#include "debug.h"
 #include "messages.h"
 
 #define ICL_VS_LTRP_GB_ICCMAX  95
index 6bfb9d1a1ca8185cf21c66ad09cb59a367c4257e..c0feb9edd7f6b661992b2c3fd2fa40df60596539 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/slab.h>
 #include <sound/hdaudio_ext.h>
 #include "avs.h"
+#include "debug.h"
 #include "messages.h"
 #include "registers.h"
 #include "trace.h"
index 03208596dfb1cafd4d75206107cc06eef6ec2738..4fbc62bfd6c5ef1cce6e3f922a19a1b9893307e6 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <sound/hdaudio_ext.h>
 #include "avs.h"
+#include "debug.h"
 #include "registers.h"
 
 int avs_lnl_core_stall(struct avs_dev *adev, u32 core_mask, bool stall)
index e7b7915b2a82cea127e46d8d9a234b3373f32e82..d8bdd03275d7f73df96c170d0defa676499b43ab 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <sound/hdaudio_ext.h>
 #include "avs.h"
+#include "debug.h"
 #include "registers.h"
 #include "trace.h"
 
index a42736b9aa55b7b41fce0011898d112b66d31c8e..505ca4975e61c358cc8445ec00cced36430dbb4d 100644 (file)
@@ -11,6 +11,7 @@
 #include <sound/hdaudio.h>
 #include <sound/soc.h>
 #include "avs.h"
+#include "debug.h"
 #include "messages.h"
 
 static int avs_dsp_init_probe(struct avs_dev *adev, union avs_connector_node_id node_id,
index 2be4b545c91dd481c2bed1cbd94c5cad93e1d3b7..07da9b0aa2b845b0ce6d208c9092fb733df9ebd4 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <sound/hdaudio_ext.h>
 #include "avs.h"
+#include "debug.h"
 #include "registers.h"
 #include "trace.h"
 
index d66ef000de9ee765ecb0a00b5b24cbd2e2978c2a..8fb86f364ff3fe49d91262015f1831b2cc507905 100644 (file)
@@ -11,6 +11,7 @@
 #include <sound/hdaudio_ext.h>
 #include "avs.h"
 #include "cldma.h"
+#include "debug.h"
 #include "messages.h"
 #include "registers.h"
 
index 9dbb3ad0954a015824ee3c8f0699a366f21946cd..afb066516101011231e016f46ddd455203c41ff0 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <linux/pci.h>
 #include "avs.h"
+#include "debug.h"
 #include "messages.h"
 
 #define CPUID_TSC_LEAF 0x15