Lines Matching refs:rtd

147 static void acp62_config_dma(struct pdm_stream_instance *rtd, int direction)  in acp62_config_dma()  argument
153 addr = rtd->dma_addr; in acp62_config_dma()
157 acp62_writel(ACP_SRAM_PTE_OFFSET | BIT(31), rtd->acp62_base + in acp62_config_dma()
159 acp62_writel(PAGE_SIZE_4K_ENABLE, rtd->acp62_base + in acp62_config_dma()
161 for (page_idx = 0; page_idx < rtd->num_pages; page_idx++) { in acp62_config_dma()
166 acp62_writel(low, rtd->acp62_base + ACP_SCRATCH_REG_0 + val); in acp62_config_dma()
168 acp62_writel(high, rtd->acp62_base + ACP_SCRATCH_REG_0 + val + 4); in acp62_config_dma()
213 struct pdm_stream_instance *rtd; in acp62_pdm_dma_hw_params() local
216 rtd = substream->runtime->private_data; in acp62_pdm_dma_hw_params()
217 if (!rtd) in acp62_pdm_dma_hw_params()
221 rtd->dma_addr = substream->runtime->dma_addr; in acp62_pdm_dma_hw_params()
222 rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); in acp62_pdm_dma_hw_params()
223 acp62_config_dma(rtd, substream->stream); in acp62_pdm_dma_hw_params()
225 period_bytes, rtd->acp62_base); in acp62_pdm_dma_hw_params()
229 static u64 acp62_pdm_get_byte_count(struct pdm_stream_instance *rtd, in acp62_pdm_get_byte_count() argument
235 high = acp62_readl(rtd->acp62_base + ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH); in acp62_pdm_get_byte_count()
237 low = acp62_readl(rtd->acp62_base + ACP_WOV_RX_LINEARPOSITIONCNTR_LOW); in acp62_pdm_get_byte_count()
245 struct pdm_stream_instance *rtd; in acp62_pdm_dma_pointer() local
249 rtd = stream->runtime->private_data; in acp62_pdm_dma_pointer()
252 bytescount = acp62_pdm_get_byte_count(rtd, stream->stream); in acp62_pdm_dma_pointer()
253 if (bytescount > rtd->bytescount) in acp62_pdm_dma_pointer()
254 bytescount -= rtd->bytescount; in acp62_pdm_dma_pointer()
260 struct snd_soc_pcm_runtime *rtd) in acp62_pdm_dma_new() argument
264 snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, in acp62_pdm_dma_new()
284 struct pdm_stream_instance *rtd; in acp62_pdm_dai_trigger() local
289 rtd = substream->runtime->private_data; in acp62_pdm_dai_trigger()
302 acp62_writel(ch_mask, rtd->acp62_base + ACP_WOV_PDM_NO_OF_CHANNELS); in acp62_pdm_dai_trigger()
303 acp62_writel(PDM_DECIMATION_FACTOR, rtd->acp62_base + in acp62_pdm_dai_trigger()
305 rtd->bytescount = acp62_pdm_get_byte_count(rtd, substream->stream); in acp62_pdm_dai_trigger()
306 pdm_status = acp62_check_pdm_dma_status(rtd->acp62_base); in acp62_pdm_dai_trigger()
308 ret = acp62_start_pdm_dma(rtd->acp62_base); in acp62_pdm_dai_trigger()
313 pdm_status = acp62_check_pdm_dma_status(rtd->acp62_base); in acp62_pdm_dai_trigger()
315 ret = acp62_stop_pdm_dma(rtd->acp62_base); in acp62_pdm_dai_trigger()
398 struct pdm_stream_instance *rtd; in acp62_pdm_resume() local
404 rtd = runtime->private_data; in acp62_pdm_resume()
407 acp62_config_dma(rtd, SNDRV_PCM_STREAM_CAPTURE); in acp62_pdm_resume()