Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: dmaengine_pcm: Add port_window_size to DAI dma data struct

The port_window_size is a struct member of dma slave channel runtime
config. It's the length of the register area in words the data need to
be accessed on the device side. It is only used for devices which is
using an area instead of a single register to send or receive the data.
Typically the DMA loops in this area in order to transfer the data.

It's useful for cases that reading/writing multiple registers in DMA
transactions.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20250808061741.187414-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Chancel Liu and committed by
Mark Brown
32dffd4c 605d902b

+7
+5
include/sound/dmaengine_pcm.h
··· 69 69 * @peripheral_config: peripheral configuration for programming peripheral 70 70 * for dmaengine transfer 71 71 * @peripheral_size: peripheral configuration buffer size 72 + * @port_window_size: The length of the register area in words the data need 73 + * to be accessed on the device side. It is only used for devices which is using 74 + * an area instead of a single register to send/receive the data. Typically the 75 + * DMA loops in this area in order to transfer the data. 72 76 */ 73 77 struct snd_dmaengine_dai_dma_data { 74 78 dma_addr_t addr; ··· 84 80 unsigned int flags; 85 81 void *peripheral_config; 86 82 size_t peripheral_size; 83 + u32 port_window_size; 87 84 }; 88 85 89 86 void snd_dmaengine_pcm_set_config_from_dai_data(
+2
sound/core/pcm_dmaengine.c
··· 111 111 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 112 112 slave_config->dst_addr = dma_data->addr; 113 113 slave_config->dst_maxburst = dma_data->maxburst; 114 + slave_config->dst_port_window_size = dma_data->port_window_size; 114 115 if (dma_data->flags & SND_DMAENGINE_PCM_DAI_FLAG_PACK) 115 116 slave_config->dst_addr_width = 116 117 DMA_SLAVE_BUSWIDTH_UNDEFINED; ··· 120 119 } else { 121 120 slave_config->src_addr = dma_data->addr; 122 121 slave_config->src_maxburst = dma_data->maxburst; 122 + slave_config->src_port_window_size = dma_data->port_window_size; 123 123 if (dma_data->flags & SND_DMAENGINE_PCM_DAI_FLAG_PACK) 124 124 slave_config->src_addr_width = 125 125 DMA_SLAVE_BUSWIDTH_UNDEFINED;