Re: [PATCH v7 07/10] ASoC: qcom: Add QAIF PCM operations
From: Mark Brown
Date: Wed Sep 23 2026 - 05:54:38 EST
On Wed, Sep 23, 2026 at 12:18:27PM +0530, Harendra Gautam wrote:
> Add the PCM platform callbacks needed to use QAIF DAIs for playback
> and capture.
> +static int qaif_platform_pcmops_open(struct snd_soc_component *component,
> + struct snd_pcm_substream *substream)
> +{
> + dma_mem_info->alloc_size = qaif_platform_hardware.buffer_bytes_max;
> + dma_mem_info->vaddr = dma_alloc_coherent(component->dev,
> + dma_mem_info->alloc_size,
> + &dma_mem_info->dma_addr,
> + GFP_KERNEL);
snd_pcm_set_managed_buffer().
> +static int qaif_platform_copy(struct snd_soc_component *component,
> + struct snd_pcm_substream *substream,
> + int channel, unsigned long pos,
> + struct iov_iter *buf, unsigned long bytes)
> +{
> + struct snd_pcm_runtime *rt = substream->runtime;
> + size_t buffer_bytes = snd_pcm_lib_buffer_bytes(substream);
> + size_t channel_bytes = buffer_bytes / rt->channels;
> + unsigned long offset;
> + void *dma_buf;
> + size_t copied;
If the buffers are already memory mapped why do we need a copy()
operation?
Attachment:
signature.asc
Description: PGP signature