summaryrefslogtreecommitdiff
path: root/sound/soc/sof/sof-utils.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-11-21 17:22:21 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-11-21 17:22:21 -0800
commit4843f6873f7c4835e62f2c73ba0fd538e57a2f22 (patch)
treeee620501a1ffbad9a83141e3a70154e1fe641040 /sound/soc/sof/sof-utils.h
downloadlinux-master.tar.gz
linux-master.zip
Merge tag 'sysctl-7.04-fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctlgraftedHEADmaster
Pull sysctl fix from Joel Granados: "Fix sysctl jiffy / milliseconds conversion: - Writing a previously read value "X" shall keep the same "X" value - Remove truncation that was causing incorrect saturation of valid timeouts" * tag 'sysctl-7.04-fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl: sysctl: Do jiffy / ms conversion in ulong space
Diffstat (limited to 'sound/soc/sof/sof-utils.h')
-rw-r--r--sound/soc/sof/sof-utils.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/sound/soc/sof/sof-utils.h b/sound/soc/sof/sof-utils.h
new file mode 100644
index 000000000..58e5822a6
--- /dev/null
+++ b/sound/soc/sof/sof-utils.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
+/*
+ * This file is provided under a dual BSD/GPLv2 license. When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * Copyright(c) 2022 Intel Corporation
+ */
+
+#ifndef __SOC_SOF_UTILS_H
+#define __SOC_SOF_UTILS_H
+
+struct snd_dma_buffer;
+struct device;
+
+/*
+ * Number of PFNs which can be stored in a page table of @bytes size.
+ * The PFNs are compressed to 2.5 bytes each but they are written with 32 bit
+ * accesses, therefore the last PFN can reach up to 3 bytes past the space it
+ * needs for itself.
+ */
+#define SOF_PAGE_TABLE_MAX_PFNS(bytes) \
+ (((((bytes) - sizeof(u32)) << 1) + 1) / 5 + 1)
+
+int snd_sof_create_page_table(struct device *dev,
+ struct snd_dma_buffer *dmab,
+ struct snd_dma_buffer *page_table, size_t size);
+
+#endif