Lines Matching full:rtd

176 static void config_acp_dma(struct pdm_stream_instance *rtd, int direction)  in config_acp_dma()  argument
182 addr = rtd->dma_addr; in config_acp_dma()
186 rn_writel(ACP_SRAM_PTE_OFFSET | BIT(31), rtd->acp_base + in config_acp_dma()
188 rn_writel(PAGE_SIZE_4K_ENABLE, rtd->acp_base + in config_acp_dma()
191 for (page_idx = 0; page_idx < rtd->num_pages; page_idx++) { in config_acp_dma()
196 rn_writel(low, rtd->acp_base + ACP_SCRATCH_REG_0 + val); in config_acp_dma()
198 rn_writel(high, rtd->acp_base + ACP_SCRATCH_REG_0 + val + 4); in config_acp_dma()
243 struct pdm_stream_instance *rtd; in acp_pdm_dma_hw_params() local
246 rtd = substream->runtime->private_data; in acp_pdm_dma_hw_params()
247 if (!rtd) in acp_pdm_dma_hw_params()
251 rtd->dma_addr = substream->runtime->dma_addr; in acp_pdm_dma_hw_params()
252 rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); in acp_pdm_dma_hw_params()
253 config_acp_dma(rtd, substream->stream); in acp_pdm_dma_hw_params()
255 rtd->acp_base); in acp_pdm_dma_hw_params()
259 static u64 acp_pdm_get_byte_count(struct pdm_stream_instance *rtd, in acp_pdm_get_byte_count() argument
265 rn_readl(rtd->acp_base + in acp_pdm_get_byte_count()
268 rn_readl(rtd->acp_base + in acp_pdm_get_byte_count()
276 struct pdm_stream_instance *rtd; in acp_pdm_dma_pointer() local
280 rtd = stream->runtime->private_data; in acp_pdm_dma_pointer()
283 bytescount = acp_pdm_get_byte_count(rtd, stream->stream); in acp_pdm_dma_pointer()
284 if (bytescount > rtd->bytescount) in acp_pdm_dma_pointer()
285 bytescount -= rtd->bytescount; in acp_pdm_dma_pointer()
291 struct snd_soc_pcm_runtime *rtd) in acp_pdm_dma_new() argument
295 snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, in acp_pdm_dma_new()
313 struct pdm_stream_instance *rtd; in acp_pdm_dai_trigger() local
318 rtd = substream->runtime->private_data; in acp_pdm_dai_trigger()
331 rn_writel(ch_mask, rtd->acp_base + ACP_WOV_PDM_NO_OF_CHANNELS); in acp_pdm_dai_trigger()
332 rn_writel(PDM_DECIMATION_FACTOR, rtd->acp_base + in acp_pdm_dai_trigger()
334 rtd->bytescount = acp_pdm_get_byte_count(rtd, in acp_pdm_dai_trigger()
336 pdm_status = check_pdm_dma_status(rtd->acp_base); in acp_pdm_dai_trigger()
338 ret = start_pdm_dma(rtd->acp_base); in acp_pdm_dai_trigger()
343 pdm_status = check_pdm_dma_status(rtd->acp_base); in acp_pdm_dai_trigger()
345 ret = stop_pdm_dma(rtd->acp_base); in acp_pdm_dai_trigger()
448 struct pdm_stream_instance *rtd; in acp_pdm_resume() local
454 rtd = runtime->private_data; in acp_pdm_resume()
457 config_acp_dma(rtd, SNDRV_PCM_STREAM_CAPTURE); in acp_pdm_resume()