summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/core.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2021-12-23 13:36:11 +0200
committerMark Brown <broonie@kernel.org>2021-12-23 13:38:10 +0000
commitf902b21adba98f28eaa1cf5e509d99eaa7b1b36e (patch)
tree1ce86ba941fde420f543d041d4044a86cc496403 /sound/soc/sof/core.c
parentb2539ef00e4427350b26896540ccabd98e88c7bb (diff)
downloadlinux-stable-f902b21adba98f28eaa1cf5e509d99eaa7b1b36e.tar.gz
linux-stable-f902b21adba98f28eaa1cf5e509d99eaa7b1b36e.tar.bz2
linux-stable-f902b21adba98f28eaa1cf5e509d99eaa7b1b36e.zip
ASoC: SOF: core: Add simple wrapper to check flags in sof_core_debug
The sof_debug_check_flag() can be used to check a flag or a combination of them in sof_core_debug. 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> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20211223113628.18582-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/core.c')
-rw-r--r--sound/soc/sof/core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index 40549cdd6d58..1224a7da053a 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -27,6 +27,22 @@ MODULE_PARM_DESC(sof_debug, "SOF core debug options (0x0 all off)");
#define TIMEOUT_DEFAULT_IPC_MS 500
#define TIMEOUT_DEFAULT_BOOT_MS 2000
+/**
+ * sof_debug_check_flag - check if a given flag(s) is set in sof_core_debug
+ * @mask: Flag or combination of flags to check
+ *
+ * Returns true if all bits set in mask is also set in sof_core_debug, otherwise
+ * false
+ */
+bool sof_debug_check_flag(int mask)
+{
+ if ((sof_core_debug & mask) == mask)
+ return true;
+
+ return false;
+}
+EXPORT_SYMBOL(sof_debug_check_flag);
+
/*
* FW Panic/fault handling.
*/