Linux Tegra architecture development
 help / color / mirror / Atom feed
* [RFC PATCH v2 2/3] ASoC: tegra: Initialise PCM hardware limits at boot for page size
       [not found] <20261202031733.1704898-1-ericcurtin17@gmail.com>
@ 2026-12-02  3:17 ` Eric Curtin
  0 siblings, 0 replies; only message in thread
From: Eric Curtin @ 2026-12-02  3:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ryan Roberts, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Thierry Reding, Jonathan Hunter, linux-sound,
	linux-tegra

From: Ryan Roberts <ryan.roberts@arm.com>

tegra_pcm_hardware and tegra_dmaengine_pcm_config use PAGE_SIZE in their
initialisers, which is not a constant expression with arm64 boot-time
page size selection.

Define both with DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST(), which keeps a
normal const initialiser for a fixed page size and otherwise fills them
in once the page size is known at boot.

Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Eric Curtin <eric.curtin@docker.com>
---
 sound/soc/tegra/tegra_pcm.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index c490a9e66858..4fe019433f9a 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -24,7 +24,8 @@
 #include <sound/dmaengine_pcm.h>
 #include "tegra_pcm.h"
 
-static const struct snd_pcm_hardware tegra_pcm_hardware = {
+static DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST(struct snd_pcm_hardware,
+						tegra_pcm_hardware, {
 	.info			= SNDRV_PCM_INFO_MMAP |
 				  SNDRV_PCM_INFO_MMAP_VALID |
 				  SNDRV_PCM_INFO_INTERLEAVED,
@@ -34,13 +35,14 @@ static const struct snd_pcm_hardware tegra_pcm_hardware = {
 	.periods_max		= 8,
 	.buffer_bytes_max	= PAGE_SIZE * 8,
 	.fifo_size		= 4,
-};
+});
 
-static const struct snd_dmaengine_pcm_config tegra_dmaengine_pcm_config = {
+static DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST(struct snd_dmaengine_pcm_config,
+						tegra_dmaengine_pcm_config, {
 	.pcm_hardware = &tegra_pcm_hardware,
 	.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
 	.prealloc_buffer_size = PAGE_SIZE * 8,
-};
+});
 
 int tegra_pcm_platform_register(struct device *dev)
 {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-02  3:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261202031733.1704898-1-ericcurtin17@gmail.com>
2026-12-02  3:17 ` [RFC PATCH v2 2/3] ASoC: tegra: Initialise PCM hardware limits at boot for page size Eric Curtin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox