Lines Matching full:rtd
170 static void config_acp_dma(struct pdm_stream_instance *rtd, int direction) in config_acp_dma() argument
176 addr = rtd->dma_addr; in config_acp_dma()
180 rn_writel(ACP_SRAM_PTE_OFFSET | BIT(31), rtd->acp_base + in config_acp_dma()
182 rn_writel(PAGE_SIZE_4K_ENABLE, rtd->acp_base + in config_acp_dma()
185 for (page_idx = 0; page_idx < rtd->num_pages; page_idx++) { in config_acp_dma()
190 rn_writel(low, rtd->acp_base + ACP_SCRATCH_REG_0 + val); in config_acp_dma()
192 rn_writel(high, rtd->acp_base + ACP_SCRATCH_REG_0 + val + 4); in config_acp_dma()
237 struct pdm_stream_instance *rtd; in acp_pdm_dma_hw_params() local
240 rtd = substream->runtime->private_data; in acp_pdm_dma_hw_params()
241 if (!rtd) in acp_pdm_dma_hw_params()
245 rtd->dma_addr = substream->runtime->dma_addr; in acp_pdm_dma_hw_params()
246 rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); in acp_pdm_dma_hw_params()
247 config_acp_dma(rtd, substream->stream); in acp_pdm_dma_hw_params()
249 rtd->acp_base); in acp_pdm_dma_hw_params()
253 static u64 acp_pdm_get_byte_count(struct pdm_stream_instance *rtd, in acp_pdm_get_byte_count() argument
259 rn_readl(rtd->acp_base + in acp_pdm_get_byte_count()
262 rn_readl(rtd->acp_base + in acp_pdm_get_byte_count()
270 struct pdm_stream_instance *rtd; in acp_pdm_dma_pointer() local
274 rtd = stream->runtime->private_data; in acp_pdm_dma_pointer()
277 bytescount = acp_pdm_get_byte_count(rtd, stream->stream); in acp_pdm_dma_pointer()
278 if (bytescount > rtd->bytescount) in acp_pdm_dma_pointer()
279 bytescount -= rtd->bytescount; in acp_pdm_dma_pointer()
285 struct snd_soc_pcm_runtime *rtd) in acp_pdm_dma_new() argument
289 snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, in acp_pdm_dma_new()
307 struct pdm_stream_instance *rtd; in acp_pdm_dai_trigger() local
312 rtd = substream->runtime->private_data; in acp_pdm_dai_trigger()
325 rn_writel(ch_mask, rtd->acp_base + ACP_WOV_PDM_NO_OF_CHANNELS); in acp_pdm_dai_trigger()
326 rn_writel(PDM_DECIMATION_FACTOR, rtd->acp_base + in acp_pdm_dai_trigger()
328 rtd->bytescount = acp_pdm_get_byte_count(rtd, in acp_pdm_dai_trigger()
330 pdm_status = check_pdm_dma_status(rtd->acp_base); in acp_pdm_dai_trigger()
332 ret = start_pdm_dma(rtd->acp_base); in acp_pdm_dai_trigger()
337 pdm_status = check_pdm_dma_status(rtd->acp_base); in acp_pdm_dai_trigger()
339 ret = stop_pdm_dma(rtd->acp_base); in acp_pdm_dai_trigger()
442 struct pdm_stream_instance *rtd; in acp_pdm_resume() local
448 rtd = runtime->private_data; in acp_pdm_resume()
451 config_acp_dma(rtd, SNDRV_PCM_STREAM_CAPTURE); in acp_pdm_resume()