Lines Matching refs:rtd

153 static void acp6x_config_dma(struct pdm_stream_instance *rtd, int direction)  in acp6x_config_dma()  argument
159 addr = rtd->dma_addr; in acp6x_config_dma()
163 acp6x_writel(ACP_SRAM_PTE_OFFSET | BIT(31), rtd->acp6x_base + in acp6x_config_dma()
165 acp6x_writel(PAGE_SIZE_4K_ENABLE, rtd->acp6x_base + in acp6x_config_dma()
167 for (page_idx = 0; page_idx < rtd->num_pages; page_idx++) { in acp6x_config_dma()
172 acp6x_writel(low, rtd->acp6x_base + ACP_SCRATCH_REG_0 + val); in acp6x_config_dma()
174 acp6x_writel(high, rtd->acp6x_base + ACP_SCRATCH_REG_0 + val + 4); in acp6x_config_dma()
219 struct pdm_stream_instance *rtd; in acp6x_pdm_dma_hw_params() local
222 rtd = substream->runtime->private_data; in acp6x_pdm_dma_hw_params()
223 if (!rtd) in acp6x_pdm_dma_hw_params()
227 rtd->dma_addr = substream->runtime->dma_addr; in acp6x_pdm_dma_hw_params()
228 rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); in acp6x_pdm_dma_hw_params()
229 acp6x_config_dma(rtd, substream->stream); in acp6x_pdm_dma_hw_params()
231 period_bytes, rtd->acp6x_base); in acp6x_pdm_dma_hw_params()
235 static u64 acp6x_pdm_get_byte_count(struct pdm_stream_instance *rtd, in acp6x_pdm_get_byte_count() argument
241 acp6x_readl(rtd->acp6x_base + ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH); in acp6x_pdm_get_byte_count()
243 acp6x_readl(rtd->acp6x_base + ACP_WOV_RX_LINEARPOSITIONCNTR_LOW); in acp6x_pdm_get_byte_count()
250 struct pdm_stream_instance *rtd; in acp6x_pdm_dma_pointer() local
254 rtd = stream->runtime->private_data; in acp6x_pdm_dma_pointer()
257 bytescount = acp6x_pdm_get_byte_count(rtd, stream->stream); in acp6x_pdm_dma_pointer()
258 if (bytescount > rtd->bytescount) in acp6x_pdm_dma_pointer()
259 bytescount -= rtd->bytescount; in acp6x_pdm_dma_pointer()
265 struct snd_soc_pcm_runtime *rtd) in acp6x_pdm_dma_new() argument
269 snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, in acp6x_pdm_dma_new()
287 struct pdm_stream_instance *rtd; in acp6x_pdm_dai_trigger() local
292 rtd = substream->runtime->private_data; in acp6x_pdm_dai_trigger()
305 acp6x_writel(ch_mask, rtd->acp6x_base + ACP_WOV_PDM_NO_OF_CHANNELS); in acp6x_pdm_dai_trigger()
306 acp6x_writel(PDM_DECIMATION_FACTOR, rtd->acp6x_base + in acp6x_pdm_dai_trigger()
308 rtd->bytescount = acp6x_pdm_get_byte_count(rtd, substream->stream); in acp6x_pdm_dai_trigger()
309 pdm_status = acp6x_check_pdm_dma_status(rtd->acp6x_base); in acp6x_pdm_dai_trigger()
311 ret = acp6x_start_pdm_dma(rtd->acp6x_base); in acp6x_pdm_dai_trigger()
316 pdm_status = acp6x_check_pdm_dma_status(rtd->acp6x_base); in acp6x_pdm_dai_trigger()
318 ret = acp6x_stop_pdm_dma(rtd->acp6x_base); in acp6x_pdm_dai_trigger()
401 struct pdm_stream_instance *rtd; in acp6x_pdm_resume() local
407 rtd = runtime->private_data; in acp6x_pdm_resume()
410 acp6x_config_dma(rtd, SNDRV_PCM_STREAM_CAPTURE); in acp6x_pdm_resume()