Lines Matching refs:vchan

180 	struct sun6i_vchan	*vchan;  member
395 static inline void sun6i_dma_dump_lli(struct sun6i_vchan *vchan, in sun6i_dma_dump_lli() argument
399 dev_dbg(chan2dev(&vchan->vc.chan), in sun6i_dma_dump_lli()
434 static int sun6i_dma_start_desc(struct sun6i_vchan *vchan) in sun6i_dma_start_desc() argument
436 struct sun6i_dma_dev *sdev = to_sun6i_dma_dev(vchan->vc.chan.device); in sun6i_dma_start_desc()
437 struct virt_dma_desc *desc = vchan_next_desc(&vchan->vc); in sun6i_dma_start_desc()
438 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_start_desc()
455 sun6i_dma_dump_lli(vchan, pchan->desc->v_lli, pchan->desc->p_lli); in sun6i_dma_start_desc()
460 vchan->irq_type = vchan->cyclic ? DMA_IRQ_PKG : DMA_IRQ_QUEUE; in sun6i_dma_start_desc()
465 irq_val |= vchan->irq_type << (irq_offset * DMA_IRQ_CHAN_WIDTH); in sun6i_dma_start_desc()
480 struct sun6i_vchan *vchan; in sun6i_dma_tasklet() local
485 list_for_each_entry(vchan, &sdev->slave.channels, vc.chan.device_node) { in sun6i_dma_tasklet()
486 spin_lock_irq(&vchan->vc.lock); in sun6i_dma_tasklet()
488 pchan = vchan->phy; in sun6i_dma_tasklet()
491 if (sun6i_dma_start_desc(vchan)) { in sun6i_dma_tasklet()
499 vchan->phy = NULL; in sun6i_dma_tasklet()
500 pchan->vchan = NULL; in sun6i_dma_tasklet()
503 spin_unlock_irq(&vchan->vc.lock); in sun6i_dma_tasklet()
510 if (pchan->vchan || list_empty(&sdev->pending)) in sun6i_dma_tasklet()
513 vchan = list_first_entry(&sdev->pending, in sun6i_dma_tasklet()
517 list_del_init(&vchan->node); 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()
533 vchan = pchan->vchan; in sun6i_dma_tasklet()
534 if (vchan) { in sun6i_dma_tasklet()
535 spin_lock_irq(&vchan->vc.lock); in sun6i_dma_tasklet()
536 sun6i_dma_start_desc(vchan); in sun6i_dma_tasklet()
537 spin_unlock_irq(&vchan->vc.lock); in sun6i_dma_tasklet()
545 struct sun6i_vchan *vchan; in sun6i_dma_interrupt() local
562 vchan = pchan->vchan; in sun6i_dma_interrupt()
563 if (vchan && (status & vchan->irq_type)) { in sun6i_dma_interrupt()
564 if (vchan->cyclic) { in sun6i_dma_interrupt()
567 spin_lock(&vchan->vc.lock); in sun6i_dma_interrupt()
570 spin_unlock(&vchan->vc.lock); in sun6i_dma_interrupt()
653 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_prep_dma_memcpy() local
661 __func__, vchan->vc.chan.chan_id, &dest, &src, len, flags); in sun6i_dma_prep_dma_memcpy()
691 sun6i_dma_dump_lli(vchan, v_lli, p_lli); in sun6i_dma_prep_dma_memcpy()
693 return vchan_tx_prep(&vchan->vc, &txd->vd, flags); in sun6i_dma_prep_dma_memcpy()
706 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_prep_slave_sg() local
707 struct dma_slave_config *sconfig = &vchan->cfg; in sun6i_dma_prep_slave_sg()
741 sdev->cfg->set_drq(&v_lli->cfg, DRQ_SDRAM, vchan->port); in sun6i_dma_prep_slave_sg()
746 __func__, vchan->vc.chan.chan_id, in sun6i_dma_prep_slave_sg()
755 sdev->cfg->set_drq(&v_lli->cfg, vchan->port, DRQ_SDRAM); in sun6i_dma_prep_slave_sg()
760 __func__, vchan->vc.chan.chan_id, in sun6i_dma_prep_slave_sg()
771 sun6i_dma_dump_lli(vchan, v_lli, p_lli); in sun6i_dma_prep_slave_sg()
773 return vchan_tx_prep(&vchan->vc, &txd->vd, flags); in sun6i_dma_prep_slave_sg()
792 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_prep_dma_cyclic() local
793 struct dma_slave_config *sconfig = &vchan->cfg; in sun6i_dma_prep_dma_cyclic()
826 sdev->cfg->set_drq(&v_lli->cfg, DRQ_SDRAM, vchan->port); in sun6i_dma_prep_dma_cyclic()
833 sdev->cfg->set_drq(&v_lli->cfg, vchan->port, DRQ_SDRAM); in sun6i_dma_prep_dma_cyclic()
842 vchan->cyclic = true; in sun6i_dma_prep_dma_cyclic()
844 return vchan_tx_prep(&vchan->vc, &txd->vd, flags); in sun6i_dma_prep_dma_cyclic()
857 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_config() local
859 memcpy(&vchan->cfg, config, sizeof(*config)); in sun6i_dma_config()
867 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_pause() local
868 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_pause()
870 dev_dbg(chan2dev(chan), "vchan %p: pause\n", &vchan->vc); in sun6i_dma_pause()
877 list_del_init(&vchan->node); in sun6i_dma_pause()
887 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_resume() local
888 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_resume()
891 dev_dbg(chan2dev(chan), "vchan %p: resume\n", &vchan->vc); in sun6i_dma_resume()
893 spin_lock_irqsave(&vchan->vc.lock, flags); in sun6i_dma_resume()
898 } else if (!list_empty(&vchan->vc.desc_issued)) { in sun6i_dma_resume()
900 list_add_tail(&vchan->node, &sdev->pending); in sun6i_dma_resume()
904 spin_unlock_irqrestore(&vchan->vc.lock, flags); in sun6i_dma_resume()
912 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_terminate_all() local
913 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_terminate_all()
918 list_del_init(&vchan->node); in sun6i_dma_terminate_all()
921 spin_lock_irqsave(&vchan->vc.lock, flags); in sun6i_dma_terminate_all()
923 if (vchan->cyclic) { in sun6i_dma_terminate_all()
924 vchan->cyclic = false; in sun6i_dma_terminate_all()
927 struct virt_dma_chan *vc = &vchan->vc; in sun6i_dma_terminate_all()
933 vchan_get_all_descriptors(&vchan->vc, &head); in sun6i_dma_terminate_all()
939 vchan->phy = NULL; in sun6i_dma_terminate_all()
940 pchan->vchan = NULL; in sun6i_dma_terminate_all()
945 spin_unlock_irqrestore(&vchan->vc.lock, flags); in sun6i_dma_terminate_all()
947 vchan_dma_desc_free_list(&vchan->vc, &head); in sun6i_dma_terminate_all()
956 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_tx_status() local
957 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_tx_status()
969 spin_lock_irqsave(&vchan->vc.lock, flags); in sun6i_dma_tx_status()
971 vd = vchan_find_desc(&vchan->vc, cookie); in sun6i_dma_tx_status()
983 spin_unlock_irqrestore(&vchan->vc.lock, flags); in sun6i_dma_tx_status()
993 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_issue_pending() local
996 spin_lock_irqsave(&vchan->vc.lock, flags); in sun6i_dma_issue_pending()
998 if (vchan_issue_pending(&vchan->vc)) { in sun6i_dma_issue_pending()
1001 if (!vchan->phy && list_empty(&vchan->node)) { in sun6i_dma_issue_pending()
1002 list_add_tail(&vchan->node, &sdev->pending); in sun6i_dma_issue_pending()
1005 &vchan->vc); in sun6i_dma_issue_pending()
1011 &vchan->vc); in sun6i_dma_issue_pending()
1014 spin_unlock_irqrestore(&vchan->vc.lock, flags); in sun6i_dma_issue_pending()
1020 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_free_chan_resources() local
1024 list_del_init(&vchan->node); in sun6i_dma_free_chan_resources()
1027 vchan_free_chan_resources(&vchan->vc); in sun6i_dma_free_chan_resources()
1034 struct sun6i_vchan *vchan; in sun6i_dma_of_xlate() local
1045 vchan = to_sun6i_vchan(chan); in sun6i_dma_of_xlate()
1046 vchan->port = port; in sun6i_dma_of_xlate()
1072 struct sun6i_vchan *vchan = &sdev->vchans[i]; in sun6i_dma_free() local
1074 list_del(&vchan->vc.chan.device_node); in sun6i_dma_free()
1075 tasklet_kill(&vchan->vc.task); in sun6i_dma_free()
1406 struct sun6i_vchan *vchan = &sdc->vchans[i]; in sun6i_dma_probe() local
1408 INIT_LIST_HEAD(&vchan->node); in sun6i_dma_probe()
1409 vchan->vc.desc_free = sun6i_dma_free_desc; in sun6i_dma_probe()
1410 vchan_init(&vchan->vc, &sdc->slave); in sun6i_dma_probe()