diff mbox series

[2/6] ASoC: Intel: avs: Use generic size defines

Message ID 20230929112436.787058-3-amadeuszx.slawinski@linux.intel.com (mailing list archive)
State Accepted
Commit 7eb878e768fd952739a03bf4bbd021496a818eb9
Headers show
Series ASoC: Intel: avs: QoL fixes | expand

Commit Message

Amadeusz Sławiński Sept. 29, 2023, 11:24 a.m. UTC
Instead of using PAGE_SIZE as base of definitions in headers, use
generic size defines. While x86 platforms use 4096 as page size, there
are platforms which use different page sizes. Two of changed defines are
for memory windows on DSP side, which have fixed size independent of
host side page size. Another one is for CLDMA buffer which also doesn't
need to change with page size.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
 sound/soc/intel/avs/cldma.h     | 4 +++-
 sound/soc/intel/avs/messages.h  | 4 +++-
 sound/soc/intel/avs/registers.h | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/intel/avs/cldma.h b/sound/soc/intel/avs/cldma.h
index 754fcf9ee585..223d3431ab81 100644
--- a/sound/soc/intel/avs/cldma.h
+++ b/sound/soc/intel/avs/cldma.h
@@ -8,7 +8,9 @@ 
 #ifndef __SOUND_SOC_INTEL_AVS_CLDMA_H
 #define __SOUND_SOC_INTEL_AVS_CLDMA_H
 
-#define AVS_CL_DEFAULT_BUFFER_SIZE	(32 * PAGE_SIZE)
+#include <linux/sizes.h>
+
+#define AVS_CL_DEFAULT_BUFFER_SIZE	SZ_128K
 
 struct hda_cldma;
 extern struct hda_cldma code_loader;
diff --git a/sound/soc/intel/avs/messages.h b/sound/soc/intel/avs/messages.h
index 7f23a304b4a9..d0344e242e5b 100644
--- a/sound/soc/intel/avs/messages.h
+++ b/sound/soc/intel/avs/messages.h
@@ -9,9 +9,11 @@ 
 #ifndef __SOUND_SOC_INTEL_AVS_MSGS_H
 #define __SOUND_SOC_INTEL_AVS_MSGS_H
 
+#include <linux/sizes.h>
+
 struct avs_dev;
 
-#define AVS_MAILBOX_SIZE 4096
+#define AVS_MAILBOX_SIZE SZ_4K
 
 enum avs_msg_target {
 	AVS_FW_GEN_MSG = 0,
diff --git a/sound/soc/intel/avs/registers.h b/sound/soc/intel/avs/registers.h
index 2b464e466ed5..078a0ebafa42 100644
--- a/sound/soc/intel/avs/registers.h
+++ b/sound/soc/intel/avs/registers.h
@@ -9,6 +9,8 @@ 
 #ifndef __SOUND_SOC_INTEL_AVS_REGS_H
 #define __SOUND_SOC_INTEL_AVS_REGS_H
 
+#include <linux/sizes.h>
+
 #define AZX_PCIREG_PGCTL		0x44
 #define AZX_PCIREG_CGCTL		0x48
 #define AZX_PGCTL_LSRMD_MASK		BIT(4)
@@ -59,7 +61,7 @@ 
 #define AVS_FW_REG_STATUS(adev)		(AVS_FW_REG_BASE(adev) + 0x0)
 #define AVS_FW_REG_ERROR_CODE(adev)	(AVS_FW_REG_BASE(adev) + 0x4)
 
-#define AVS_WINDOW_CHUNK_SIZE		PAGE_SIZE
+#define AVS_WINDOW_CHUNK_SIZE		SZ_4K
 #define AVS_FW_REGS_SIZE		AVS_WINDOW_CHUNK_SIZE
 #define AVS_FW_REGS_WINDOW		0
 /* DSP -> HOST communication window */