Lines Matching refs:acp_base
50 val = rn_readl(rn_pdm_data->acp_base + ACP_EXTERNAL_INTR_STAT); in pdm_irq_handler()
52 rn_writel(BIT(PDM_DMA_STAT), rn_pdm_data->acp_base + in pdm_irq_handler()
67 void __iomem *acp_base) in init_pdm_ring_buffer() argument
69 rn_writel(physical_addr, acp_base + ACP_WOV_RX_RINGBUFADDR); in init_pdm_ring_buffer()
70 rn_writel(buffer_size, acp_base + ACP_WOV_RX_RINGBUFSIZE); in init_pdm_ring_buffer()
71 rn_writel(watermark_size, acp_base + ACP_WOV_RX_INTR_WATERMARK_SIZE); in init_pdm_ring_buffer()
72 rn_writel(0x01, acp_base + ACPAXI2AXI_ATU_CTRL); in init_pdm_ring_buffer()
75 static void enable_pdm_clock(void __iomem *acp_base) in enable_pdm_clock() argument
81 rn_writel(pdm_clk_enable, acp_base + ACP_WOV_CLK_CTRL); in enable_pdm_clock()
82 pdm_ctrl = rn_readl(acp_base + ACP_WOV_MISC_CTRL); in enable_pdm_clock()
84 rn_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL); in enable_pdm_clock()
87 static void enable_pdm_interrupts(void __iomem *acp_base) in enable_pdm_interrupts() argument
91 ext_int_ctrl = rn_readl(acp_base + ACP_EXTERNAL_INTR_CNTL); in enable_pdm_interrupts()
93 rn_writel(ext_int_ctrl, acp_base + ACP_EXTERNAL_INTR_CNTL); in enable_pdm_interrupts()
96 static void disable_pdm_interrupts(void __iomem *acp_base) in disable_pdm_interrupts() argument
100 ext_int_ctrl = rn_readl(acp_base + ACP_EXTERNAL_INTR_CNTL); in disable_pdm_interrupts()
102 rn_writel(ext_int_ctrl, acp_base + ACP_EXTERNAL_INTR_CNTL); in disable_pdm_interrupts()
105 static bool check_pdm_dma_status(void __iomem *acp_base) in check_pdm_dma_status() argument
111 pdm_enable = rn_readl(acp_base + ACP_WOV_PDM_ENABLE); in check_pdm_dma_status()
112 pdm_dma_enable = rn_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); in check_pdm_dma_status()
119 static int start_pdm_dma(void __iomem *acp_base) in start_pdm_dma() argument
128 enable_pdm_clock(acp_base); in start_pdm_dma()
129 rn_writel(pdm_enable, acp_base + ACP_WOV_PDM_ENABLE); in start_pdm_dma()
130 rn_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE); in start_pdm_dma()
133 pdm_dma_enable = rn_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); in start_pdm_dma()
141 static int stop_pdm_dma(void __iomem *acp_base) in stop_pdm_dma() argument
146 pdm_enable = rn_readl(acp_base + ACP_WOV_PDM_ENABLE); in stop_pdm_dma()
147 pdm_dma_enable = rn_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE); in stop_pdm_dma()
150 rn_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE); in stop_pdm_dma()
153 pdm_dma_enable = rn_readl(acp_base + in stop_pdm_dma()
164 rn_writel(pdm_enable, acp_base + ACP_WOV_PDM_ENABLE); in stop_pdm_dma()
166 rn_writel(0x01, acp_base + ACP_WOV_PDM_FIFO_FLUSH); in stop_pdm_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()
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()
223 enable_pdm_interrupts(adata->acp_base); in acp_pdm_dma_open()
228 pdm_data->acp_base = adata->acp_base; in acp_pdm_dma_open()
249 rtd->acp_base); in acp_pdm_dma_hw_params()
259 rn_readl(rtd->acp_base + in acp_pdm_get_byte_count()
262 rn_readl(rtd->acp_base + in acp_pdm_get_byte_count()
299 disable_pdm_interrupts(adata->acp_base); in acp_pdm_dma_close()
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()
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()
397 adata->acp_base = devm_ioremap(&pdev->dev, res->start, in acp_pdm_audio_probe()
399 if (!adata->acp_base) in acp_pdm_audio_probe()
454 adata->acp_base); in acp_pdm_resume()
456 enable_pdm_interrupts(adata->acp_base); in acp_pdm_resume()
465 disable_pdm_interrupts(adata->acp_base); in acp_pdm_runtime_suspend()
475 enable_pdm_interrupts(adata->acp_base); in acp_pdm_runtime_resume()