• Home
  • Raw
  • Download

Lines Matching refs:vchan

191 	struct owl_dma_vchan	*vchan;  member
380 static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan, in owl_dma_cfg_lli() argument
387 struct owl_dma *od = to_owl_dma(vchan->vc.chan.device); in owl_dma_cfg_lli()
400 mode |= OWL_DMA_MODE_TS(vchan->drq) in owl_dma_cfg_lli()
413 mode |= OWL_DMA_MODE_TS(vchan->drq) in owl_dma_cfg_lli()
468 struct owl_dma_vchan *vchan) in owl_dma_get_pchan() argument
478 if (!pchan->vchan) { in owl_dma_get_pchan()
479 pchan->vchan = vchan; in owl_dma_get_pchan()
519 pchan->vchan = NULL; in owl_dma_terminate_pchan()
534 static int owl_dma_start_next_txd(struct owl_dma_vchan *vchan) in owl_dma_start_next_txd() argument
536 struct owl_dma *od = to_owl_dma(vchan->vc.chan.device); in owl_dma_start_next_txd()
537 struct virt_dma_desc *vd = vchan_next_desc(&vchan->vc); in owl_dma_start_next_txd()
538 struct owl_dma_pchan *pchan = vchan->pchan; in owl_dma_start_next_txd()
546 vchan->txd = txd; in owl_dma_start_next_txd()
575 dev_dbg(chan2dev(&vchan->vc.chan), "starting pchan %d\n", pchan->id); in owl_dma_start_next_txd()
583 static void owl_dma_phy_free(struct owl_dma *od, struct owl_dma_vchan *vchan) in owl_dma_phy_free() argument
586 owl_dma_terminate_pchan(od, vchan->pchan); in owl_dma_phy_free()
588 vchan->pchan = NULL; in owl_dma_phy_free()
594 struct owl_dma_vchan *vchan; in owl_dma_interrupt() local
644 vchan = pchan->vchan; in owl_dma_interrupt()
645 if (!vchan) { in owl_dma_interrupt()
651 spin_lock(&vchan->vc.lock); in owl_dma_interrupt()
653 txd = vchan->txd; in owl_dma_interrupt()
655 vchan->txd = NULL; in owl_dma_interrupt()
663 if (vchan_next_desc(&vchan->vc)) in owl_dma_interrupt()
664 owl_dma_start_next_txd(vchan); in owl_dma_interrupt()
666 owl_dma_phy_free(od, vchan); in owl_dma_interrupt()
669 spin_unlock(&vchan->vc.lock); in owl_dma_interrupt()
699 struct owl_dma_vchan *vchan = to_owl_vchan(chan); in owl_dma_terminate_all() local
703 spin_lock_irqsave(&vchan->vc.lock, flags); in owl_dma_terminate_all()
705 if (vchan->pchan) in owl_dma_terminate_all()
706 owl_dma_phy_free(od, vchan); in owl_dma_terminate_all()
708 if (vchan->txd) { in owl_dma_terminate_all()
709 owl_dma_desc_free(&vchan->txd->vd); in owl_dma_terminate_all()
710 vchan->txd = NULL; in owl_dma_terminate_all()
713 vchan_get_all_descriptors(&vchan->vc, &head); in owl_dma_terminate_all()
715 spin_unlock_irqrestore(&vchan->vc.lock, flags); in owl_dma_terminate_all()
717 vchan_dma_desc_free_list(&vchan->vc, &head); in owl_dma_terminate_all()
725 struct owl_dma_vchan *vchan = to_owl_vchan(chan); in owl_dma_config() local
732 memcpy(&vchan->cfg, config, sizeof(struct dma_slave_config)); in owl_dma_config()
739 struct owl_dma_vchan *vchan = to_owl_vchan(chan); in owl_dma_pause() local
742 spin_lock_irqsave(&vchan->vc.lock, flags); in owl_dma_pause()
744 owl_dma_pause_pchan(vchan->pchan); in owl_dma_pause()
746 spin_unlock_irqrestore(&vchan->vc.lock, flags); in owl_dma_pause()
753 struct owl_dma_vchan *vchan = to_owl_vchan(chan); in owl_dma_resume() local
756 if (!vchan->pchan && !vchan->txd) in owl_dma_resume()
759 dev_dbg(chan2dev(chan), "vchan %p: resume\n", &vchan->vc); in owl_dma_resume()
761 spin_lock_irqsave(&vchan->vc.lock, flags); in owl_dma_resume()
763 owl_dma_resume_pchan(vchan->pchan); in owl_dma_resume()
765 spin_unlock_irqrestore(&vchan->vc.lock, flags); in owl_dma_resume()
770 static u32 owl_dma_getbytes_chan(struct owl_dma_vchan *vchan) in owl_dma_getbytes_chan() argument
778 pchan = vchan->pchan; in owl_dma_getbytes_chan()
779 txd = vchan->txd; in owl_dma_getbytes_chan()
807 struct owl_dma_vchan *vchan = to_owl_vchan(chan); in owl_dma_tx_status() local
819 spin_lock_irqsave(&vchan->vc.lock, flags); in owl_dma_tx_status()
821 vd = vchan_find_desc(&vchan->vc, cookie); in owl_dma_tx_status()
827 bytes = owl_dma_getbytes_chan(vchan); in owl_dma_tx_status()
830 spin_unlock_irqrestore(&vchan->vc.lock, flags); in owl_dma_tx_status()
837 static void owl_dma_phy_alloc_and_start(struct owl_dma_vchan *vchan) in owl_dma_phy_alloc_and_start() argument
839 struct owl_dma *od = to_owl_dma(vchan->vc.chan.device); in owl_dma_phy_alloc_and_start()
842 pchan = owl_dma_get_pchan(od, vchan); in owl_dma_phy_alloc_and_start()
848 vchan->pchan = pchan; in owl_dma_phy_alloc_and_start()
849 owl_dma_start_next_txd(vchan); in owl_dma_phy_alloc_and_start()
854 struct owl_dma_vchan *vchan = to_owl_vchan(chan); in owl_dma_issue_pending() local
857 spin_lock_irqsave(&vchan->vc.lock, flags); in owl_dma_issue_pending()
858 if (vchan_issue_pending(&vchan->vc)) { in owl_dma_issue_pending()
859 if (!vchan->pchan) in owl_dma_issue_pending()
860 owl_dma_phy_alloc_and_start(vchan); in owl_dma_issue_pending()
862 spin_unlock_irqrestore(&vchan->vc.lock, flags); in owl_dma_issue_pending()
871 struct owl_dma_vchan *vchan = to_owl_vchan(chan); in owl_dma_prep_memcpy() local
896 ret = owl_dma_cfg_lli(vchan, lli, src + offset, dst + offset, in owl_dma_prep_memcpy()
898 &vchan->cfg, txd->cyclic); in owl_dma_prep_memcpy()
907 return vchan_tx_prep(&vchan->vc, &txd->vd, flags); in owl_dma_prep_memcpy()
922 struct owl_dma_vchan *vchan = to_owl_vchan(chan); in owl_dma_prep_slave_sg() local
923 struct dma_slave_config *sconfig = &vchan->cfg; in owl_dma_prep_slave_sg()
961 ret = owl_dma_cfg_lli(vchan, lli, src, dst, len, dir, sconfig, in owl_dma_prep_slave_sg()
971 return vchan_tx_prep(&vchan->vc, &txd->vd, flags); in owl_dma_prep_slave_sg()
987 struct owl_dma_vchan *vchan = to_owl_vchan(chan); in owl_prep_dma_cyclic() local
988 struct dma_slave_config *sconfig = &vchan->cfg; in owl_prep_dma_cyclic()
1017 ret = owl_dma_cfg_lli(vchan, lli, src, dst, period_len, in owl_prep_dma_cyclic()
1033 return vchan_tx_prep(&vchan->vc, &txd->vd, flags); in owl_prep_dma_cyclic()
1043 struct owl_dma_vchan *vchan = to_owl_vchan(chan); in owl_dma_free_chan_resources() local
1046 vchan_free_chan_resources(&vchan->vc); in owl_dma_free_chan_resources()
1051 struct owl_dma_vchan *vchan = NULL; in owl_dma_free() local
1054 list_for_each_entry_safe(vchan, in owl_dma_free()
1056 list_del(&vchan->vc.chan.device_node); in owl_dma_free()
1057 tasklet_kill(&vchan->vc.task); in owl_dma_free()
1065 struct owl_dma_vchan *vchan; in owl_dma_of_xlate() local
1076 vchan = to_owl_vchan(chan); in owl_dma_of_xlate()
1077 vchan->drq = drq; in owl_dma_of_xlate()
1190 struct owl_dma_vchan *vchan = &od->vchans[i]; in owl_dma_probe() local
1192 vchan->vc.desc_free = owl_dma_desc_free; in owl_dma_probe()
1193 vchan_init(&vchan->vc, &od->dma); in owl_dma_probe()