Lines Matching refs:rtd
107 static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction) in config_acp3x_dma() argument
114 addr = rtd->dma_addr; in config_acp3x_dma()
117 switch (rtd->i2s_instance) { in config_acp3x_dma()
126 switch (rtd->i2s_instance) { in config_acp3x_dma()
136 rv_writel(ACP_SRAM_PTE_OFFSET | BIT(31), rtd->acp3x_base + in config_acp3x_dma()
138 rv_writel(PAGE_SIZE_4K_ENABLE, rtd->acp3x_base + in config_acp3x_dma()
141 for (page_idx = 0; page_idx < rtd->num_pages; page_idx++) { in config_acp3x_dma()
146 rv_writel(low, rtd->acp3x_base + mmACP_SCRATCH_REG_0 + val); in config_acp3x_dma()
148 rv_writel(high, rtd->acp3x_base + mmACP_SCRATCH_REG_0 + val in config_acp3x_dma()
156 switch (rtd->i2s_instance) { in config_acp3x_dma()
164 rtd->acp3x_base + mmACP_BT_TX_RINGBUFADDR); in config_acp3x_dma()
175 rtd->acp3x_base + mmACP_I2S_TX_RINGBUFADDR); in config_acp3x_dma()
178 switch (rtd->i2s_instance) { in config_acp3x_dma()
186 rtd->acp3x_base + mmACP_BT_RX_RINGBUFADDR); in config_acp3x_dma()
197 rtd->acp3x_base + mmACP_I2S_RX_RINGBUFADDR); in config_acp3x_dma()
200 rv_writel(DMA_SIZE, rtd->acp3x_base + reg_dma_size); in config_acp3x_dma()
201 rv_writel(acp_fifo_addr, rtd->acp3x_base + reg_fifo_addr); in config_acp3x_dma()
202 rv_writel(FIFO_SIZE, rtd->acp3x_base + reg_fifo_size); in config_acp3x_dma()
205 rtd->acp3x_base + mmACP_EXTERNAL_INTR_CNTL); in config_acp3x_dma()
248 struct i2s_stream_instance *rtd; in acp3x_dma_hw_params() local
259 rtd = substream->runtime->private_data; in acp3x_dma_hw_params()
260 if (!rtd) in acp3x_dma_hw_params()
265 rtd->i2s_instance = pinfo->play_i2s_instance; in acp3x_dma_hw_params()
266 switch (rtd->i2s_instance) { in acp3x_dma_hw_params()
275 rtd->i2s_instance = pinfo->cap_i2s_instance; in acp3x_dma_hw_params()
276 switch (rtd->i2s_instance) { in acp3x_dma_hw_params()
289 rtd->dma_addr = substream->runtime->dma_addr; in acp3x_dma_hw_params()
290 rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); in acp3x_dma_hw_params()
291 config_acp3x_dma(rtd, substream->stream); in acp3x_dma_hw_params()
298 struct i2s_stream_instance *rtd; in acp3x_dma_pointer() local
303 rtd = substream->runtime->private_data; in acp3x_dma_pointer()
307 bytescount = acp_get_byte_count(rtd, substream->stream); in acp3x_dma_pointer()
308 if (bytescount > rtd->bytescount) in acp3x_dma_pointer()
309 bytescount -= rtd->bytescount; in acp3x_dma_pointer()
315 struct snd_soc_pcm_runtime *rtd) in acp3x_dma_new() argument
318 snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, in acp3x_dma_new()
440 struct i2s_stream_instance *rtd = in acp3x_resume() local
442 config_acp3x_dma(rtd, SNDRV_PCM_STREAM_PLAYBACK); in acp3x_resume()
443 switch (rtd->i2s_instance) { in acp3x_resume()
453 rv_writel((rtd->xfer_resolution << 3), in acp3x_resume()
454 rtd->acp3x_base + reg_val); in acp3x_resume()
457 struct i2s_stream_instance *rtd = in acp3x_resume() local
459 config_acp3x_dma(rtd, SNDRV_PCM_STREAM_CAPTURE); in acp3x_resume()
460 switch (rtd->i2s_instance) { in acp3x_resume()
470 rv_writel((rtd->xfer_resolution << 3), in acp3x_resume()
471 rtd->acp3x_base + reg_val); in acp3x_resume()