Lines Matching full:rtd
157 static void acp63_config_dma(struct pdm_stream_instance *rtd, int direction) in acp63_config_dma() argument
163 addr = rtd->dma_addr; in acp63_config_dma()
167 writel(ACP_SRAM_PTE_OFFSET | BIT(31), rtd->acp63_base + ACPAXI2AXI_ATU_BASE_ADDR_GRP_1); in acp63_config_dma()
168 writel(PAGE_SIZE_4K_ENABLE, rtd->acp63_base + ACPAXI2AXI_ATU_PAGE_SIZE_GRP_1); in acp63_config_dma()
169 for (page_idx = 0; page_idx < rtd->num_pages; page_idx++) { in acp63_config_dma()
174 writel(low, rtd->acp63_base + ACP_SCRATCH_REG_0 + val); in acp63_config_dma()
176 writel(high, rtd->acp63_base + ACP_SCRATCH_REG_0 + val + 4); in acp63_config_dma()
221 struct pdm_stream_instance *rtd; in acp63_pdm_dma_hw_params() local
224 rtd = substream->runtime->private_data; in acp63_pdm_dma_hw_params()
225 if (!rtd) in acp63_pdm_dma_hw_params()
229 rtd->dma_addr = substream->runtime->dma_addr; in acp63_pdm_dma_hw_params()
230 rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); in acp63_pdm_dma_hw_params()
231 acp63_config_dma(rtd, substream->stream); in acp63_pdm_dma_hw_params()
233 period_bytes, rtd->acp63_base); in acp63_pdm_dma_hw_params()
237 static u64 acp63_pdm_get_byte_count(struct pdm_stream_instance *rtd, in acp63_pdm_get_byte_count() argument
243 high = readl(rtd->acp63_base + ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH); in acp63_pdm_get_byte_count()
245 low = readl(rtd->acp63_base + ACP_WOV_RX_LINEARPOSITIONCNTR_LOW); in acp63_pdm_get_byte_count()
253 struct pdm_stream_instance *rtd; in acp63_pdm_dma_pointer() local
257 rtd = stream->runtime->private_data; in acp63_pdm_dma_pointer()
260 bytescount = acp63_pdm_get_byte_count(rtd, stream->stream); in acp63_pdm_dma_pointer()
261 if (bytescount > rtd->bytescount) in acp63_pdm_dma_pointer()
262 bytescount -= rtd->bytescount; in acp63_pdm_dma_pointer()
268 struct snd_soc_pcm_runtime *rtd) in acp63_pdm_dma_new() argument
272 snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, in acp63_pdm_dma_new()
292 struct pdm_stream_instance *rtd; in acp63_pdm_dai_trigger() local
297 rtd = substream->runtime->private_data; in acp63_pdm_dai_trigger()
310 writel(ch_mask, rtd->acp63_base + ACP_WOV_PDM_NO_OF_CHANNELS); in acp63_pdm_dai_trigger()
311 writel(PDM_DECIMATION_FACTOR, rtd->acp63_base + ACP_WOV_PDM_DECIMATION_FACTOR); in acp63_pdm_dai_trigger()
312 rtd->bytescount = acp63_pdm_get_byte_count(rtd, substream->stream); in acp63_pdm_dai_trigger()
313 pdm_status = acp63_check_pdm_dma_status(rtd->acp63_base); in acp63_pdm_dai_trigger()
315 ret = acp63_start_pdm_dma(rtd->acp63_base); in acp63_pdm_dai_trigger()
320 pdm_status = acp63_check_pdm_dma_status(rtd->acp63_base); in acp63_pdm_dai_trigger()
322 ret = acp63_stop_pdm_dma(rtd->acp63_base); in acp63_pdm_dai_trigger()
409 struct pdm_stream_instance *rtd; in acp63_pdm_resume() local
415 rtd = runtime->private_data; in acp63_pdm_resume()
418 acp63_config_dma(rtd, SNDRV_PCM_STREAM_CAPTURE); in acp63_pdm_resume()