Lines Matching refs:pchan
252 struct sun6i_pchan *pchan) in sun6i_dma_dump_chan_regs() argument
263 pchan->idx, in sun6i_dma_dump_chan_regs()
265 readl(pchan->base + DMA_CHAN_ENABLE), in sun6i_dma_dump_chan_regs()
267 readl(pchan->base + DMA_CHAN_PAUSE), in sun6i_dma_dump_chan_regs()
269 readl(pchan->base + DMA_CHAN_LLI_ADDR), in sun6i_dma_dump_chan_regs()
271 readl(pchan->base + DMA_CHAN_CUR_CFG), in sun6i_dma_dump_chan_regs()
273 readl(pchan->base + DMA_CHAN_CUR_SRC), in sun6i_dma_dump_chan_regs()
275 readl(pchan->base + DMA_CHAN_CUR_DST), in sun6i_dma_dump_chan_regs()
277 readl(pchan->base + DMA_CHAN_CUR_CNT), in sun6i_dma_dump_chan_regs()
279 readl(pchan->base + DMA_CHAN_CUR_PARA)); in sun6i_dma_dump_chan_regs()
349 static size_t sun6i_get_chan_size(struct sun6i_pchan *pchan) in sun6i_get_chan_size() argument
351 struct sun6i_desc *txd = pchan->desc; in sun6i_get_chan_size()
356 pos = readl(pchan->base + DMA_CHAN_LLI_ADDR); in sun6i_get_chan_size()
357 bytes = readl(pchan->base + DMA_CHAN_CUR_CNT); in sun6i_get_chan_size()
438 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_start_desc() local
441 if (!pchan) in sun6i_dma_start_desc()
445 pchan->desc = NULL; in sun6i_dma_start_desc()
446 pchan->done = NULL; in sun6i_dma_start_desc()
452 pchan->desc = to_sun6i_desc(&desc->tx); in sun6i_dma_start_desc()
453 pchan->done = NULL; in sun6i_dma_start_desc()
455 sun6i_dma_dump_lli(vchan, pchan->desc->v_lli, pchan->desc->p_lli); in sun6i_dma_start_desc()
457 irq_reg = pchan->idx / DMA_IRQ_CHAN_NR; in sun6i_dma_start_desc()
458 irq_offset = pchan->idx % DMA_IRQ_CHAN_NR; in sun6i_dma_start_desc()
468 writel(pchan->desc->p_lli, pchan->base + DMA_CHAN_LLI_ADDR); in sun6i_dma_start_desc()
469 writel(DMA_CHAN_ENABLE_START, pchan->base + DMA_CHAN_ENABLE); in sun6i_dma_start_desc()
472 sun6i_dma_dump_chan_regs(sdev, pchan); in sun6i_dma_start_desc()
481 struct sun6i_pchan *pchan; in sun6i_dma_tasklet() local
488 pchan = vchan->phy; in sun6i_dma_tasklet()
490 if (pchan && pchan->done) { in sun6i_dma_tasklet()
496 pchan->idx); in sun6i_dma_tasklet()
500 pchan->vchan = NULL; in sun6i_dma_tasklet()
508 pchan = &sdev->pchans[pchan_idx]; in sun6i_dma_tasklet()
510 if (pchan->vchan || list_empty(&sdev->pending)) in sun6i_dma_tasklet()
521 pchan->vchan = vchan; in sun6i_dma_tasklet()
522 vchan->phy = pchan; in sun6i_dma_tasklet()
524 pchan->idx, &vchan->vc); in sun6i_dma_tasklet()
532 pchan = sdev->pchans + pchan_idx; in sun6i_dma_tasklet()
533 vchan = pchan->vchan; in sun6i_dma_tasklet()
546 struct sun6i_pchan *pchan; in sun6i_dma_interrupt() local
561 pchan = sdev->pchans + j; in sun6i_dma_interrupt()
562 vchan = pchan->vchan; in sun6i_dma_interrupt()
565 vchan_cyclic_callback(&pchan->desc->vd); in sun6i_dma_interrupt()
568 vchan_cookie_complete(&pchan->desc->vd); in sun6i_dma_interrupt()
569 pchan->done = pchan->desc; in sun6i_dma_interrupt()
868 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_pause() local
872 if (pchan) { in sun6i_dma_pause()
874 pchan->base + DMA_CHAN_PAUSE); in sun6i_dma_pause()
888 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_resume() local
895 if (pchan) { in sun6i_dma_resume()
897 pchan->base + DMA_CHAN_PAUSE); in sun6i_dma_resume()
913 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_terminate_all() local
925 if (pchan && pchan->desc) { in sun6i_dma_terminate_all()
926 struct virt_dma_desc *vd = &pchan->desc->vd; in sun6i_dma_terminate_all()
935 if (pchan) { in sun6i_dma_terminate_all()
936 writel(DMA_CHAN_ENABLE_STOP, pchan->base + DMA_CHAN_ENABLE); in sun6i_dma_terminate_all()
937 writel(DMA_CHAN_PAUSE_RESUME, pchan->base + DMA_CHAN_PAUSE); in sun6i_dma_terminate_all()
940 pchan->vchan = NULL; in sun6i_dma_terminate_all()
941 pchan->desc = NULL; in sun6i_dma_terminate_all()
942 pchan->done = NULL; in sun6i_dma_terminate_all()
957 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_tx_status() local
977 } else if (!pchan || !pchan->desc) { in sun6i_dma_tx_status()
980 bytes = sun6i_get_chan_size(pchan); in sun6i_dma_tx_status()
1399 struct sun6i_pchan *pchan = &sdc->pchans[i]; in sun6i_dma_probe() local
1401 pchan->idx = i; in sun6i_dma_probe()
1402 pchan->base = sdc->base + 0x100 + i * 0x40; in sun6i_dma_probe()