Re: [RFC PATCH v2 3/3] ASoC: codecs: Initialise PCM hardware tables at boot for page size

From: Mark Brown

Date: Wed Dec 02 2026 - 12:40:29 EST


> The snd_pcm_hardware tables in cros_ec_codec.c and rt5514-spi.c use
> PAGE_SIZE in their initialisers. That is not a constant expression with
> arm64 boot-time page size selection, so the tables cannot be static
> initialisers.

> +static DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST(struct snd_pcm_hardware, hw_param, {
> + .info = SNDRV_PCM_INFO_MMAP |
> + SNDRV_PCM_INFO_INTERLEAVED |
> + SNDRV_PCM_INFO_MMAP_VALID,
> + .formats = SNDRV_PCM_FMTBIT_S16_LE,
> + .rates = SNDRV_PCM_RATE_16000,
> + .channels_min = 1,
> + .channels_max = 1,
> + .period_bytes_min = PAGE_SIZE,
> + .period_bytes_max = 0x20000 / 8,

These numbers don't work for 64k pages, we have a minimum of 64k and a
maximum lower than that.

--
Mark Brown <broonie@xxxxxxxxxx>