Lines Matching refs:vchan
179 struct sun6i_vchan *vchan; member
394 static inline void sun6i_dma_dump_lli(struct sun6i_vchan *vchan, in sun6i_dma_dump_lli() argument
398 dev_dbg(chan2dev(&vchan->vc.chan), in sun6i_dma_dump_lli()
433 static int sun6i_dma_start_desc(struct sun6i_vchan *vchan) in sun6i_dma_start_desc() argument
435 struct sun6i_dma_dev *sdev = to_sun6i_dma_dev(vchan->vc.chan.device); in sun6i_dma_start_desc()
436 struct virt_dma_desc *desc = vchan_next_desc(&vchan->vc); in sun6i_dma_start_desc()
437 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_start_desc()
454 sun6i_dma_dump_lli(vchan, pchan->desc->v_lli, pchan->desc->p_lli); in sun6i_dma_start_desc()
459 vchan->irq_type = vchan->cyclic ? DMA_IRQ_PKG : DMA_IRQ_QUEUE; in sun6i_dma_start_desc()
464 irq_val |= vchan->irq_type << (irq_offset * DMA_IRQ_CHAN_WIDTH); in sun6i_dma_start_desc()
479 struct sun6i_vchan *vchan; in sun6i_dma_tasklet() local
484 list_for_each_entry(vchan, &sdev->slave.channels, vc.chan.device_node) { in sun6i_dma_tasklet()
485 spin_lock_irq(&vchan->vc.lock); in sun6i_dma_tasklet()
487 pchan = vchan->phy; in sun6i_dma_tasklet()
490 if (sun6i_dma_start_desc(vchan)) { in sun6i_dma_tasklet()
498 vchan->phy = NULL; in sun6i_dma_tasklet()
499 pchan->vchan = NULL; in sun6i_dma_tasklet()
502 spin_unlock_irq(&vchan->vc.lock); in sun6i_dma_tasklet()
509 if (pchan->vchan || list_empty(&sdev->pending)) in sun6i_dma_tasklet()
512 vchan = list_first_entry(&sdev->pending, in sun6i_dma_tasklet()
516 list_del_init(&vchan->node); in sun6i_dma_tasklet()
520 pchan->vchan = vchan; in sun6i_dma_tasklet()
521 vchan->phy = pchan; in sun6i_dma_tasklet()
523 pchan->idx, &vchan->vc); in sun6i_dma_tasklet()
532 vchan = pchan->vchan; in sun6i_dma_tasklet()
533 if (vchan) { in sun6i_dma_tasklet()
534 spin_lock_irq(&vchan->vc.lock); in sun6i_dma_tasklet()
535 sun6i_dma_start_desc(vchan); in sun6i_dma_tasklet()
536 spin_unlock_irq(&vchan->vc.lock); in sun6i_dma_tasklet()
544 struct sun6i_vchan *vchan; in sun6i_dma_interrupt() local
561 vchan = pchan->vchan; in sun6i_dma_interrupt()
562 if (vchan && (status & vchan->irq_type)) { in sun6i_dma_interrupt()
563 if (vchan->cyclic) { in sun6i_dma_interrupt()
566 spin_lock(&vchan->vc.lock); in sun6i_dma_interrupt()
569 spin_unlock(&vchan->vc.lock); in sun6i_dma_interrupt()
652 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_prep_dma_memcpy() local
660 __func__, vchan->vc.chan.chan_id, &dest, &src, len, flags); in sun6i_dma_prep_dma_memcpy()
690 sun6i_dma_dump_lli(vchan, v_lli, p_lli); in sun6i_dma_prep_dma_memcpy()
692 return vchan_tx_prep(&vchan->vc, &txd->vd, flags); in sun6i_dma_prep_dma_memcpy()
705 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_prep_slave_sg() local
706 struct dma_slave_config *sconfig = &vchan->cfg; in sun6i_dma_prep_slave_sg()
740 sdev->cfg->set_drq(&v_lli->cfg, DRQ_SDRAM, vchan->port); in sun6i_dma_prep_slave_sg()
745 __func__, vchan->vc.chan.chan_id, in sun6i_dma_prep_slave_sg()
754 sdev->cfg->set_drq(&v_lli->cfg, vchan->port, DRQ_SDRAM); in sun6i_dma_prep_slave_sg()
759 __func__, vchan->vc.chan.chan_id, in sun6i_dma_prep_slave_sg()
770 sun6i_dma_dump_lli(vchan, v_lli, p_lli); in sun6i_dma_prep_slave_sg()
772 return vchan_tx_prep(&vchan->vc, &txd->vd, flags); in sun6i_dma_prep_slave_sg()
791 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_prep_dma_cyclic() local
792 struct dma_slave_config *sconfig = &vchan->cfg; in sun6i_dma_prep_dma_cyclic()
825 sdev->cfg->set_drq(&v_lli->cfg, DRQ_SDRAM, vchan->port); in sun6i_dma_prep_dma_cyclic()
832 sdev->cfg->set_drq(&v_lli->cfg, vchan->port, DRQ_SDRAM); in sun6i_dma_prep_dma_cyclic()
841 vchan->cyclic = true; in sun6i_dma_prep_dma_cyclic()
843 return vchan_tx_prep(&vchan->vc, &txd->vd, flags); in sun6i_dma_prep_dma_cyclic()
856 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_config() local
858 memcpy(&vchan->cfg, config, sizeof(*config)); in sun6i_dma_config()
866 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_pause() local
867 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_pause()
869 dev_dbg(chan2dev(chan), "vchan %p: pause\n", &vchan->vc); in sun6i_dma_pause()
876 list_del_init(&vchan->node); in sun6i_dma_pause()
886 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_resume() local
887 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_resume()
890 dev_dbg(chan2dev(chan), "vchan %p: resume\n", &vchan->vc); in sun6i_dma_resume()
892 spin_lock_irqsave(&vchan->vc.lock, flags); in sun6i_dma_resume()
897 } else if (!list_empty(&vchan->vc.desc_issued)) { in sun6i_dma_resume()
899 list_add_tail(&vchan->node, &sdev->pending); in sun6i_dma_resume()
903 spin_unlock_irqrestore(&vchan->vc.lock, flags); in sun6i_dma_resume()
911 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_terminate_all() local
912 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_terminate_all()
917 list_del_init(&vchan->node); in sun6i_dma_terminate_all()
920 spin_lock_irqsave(&vchan->vc.lock, flags); in sun6i_dma_terminate_all()
922 if (vchan->cyclic) { in sun6i_dma_terminate_all()
923 vchan->cyclic = false; in sun6i_dma_terminate_all()
926 struct virt_dma_chan *vc = &vchan->vc; in sun6i_dma_terminate_all()
932 vchan_get_all_descriptors(&vchan->vc, &head); in sun6i_dma_terminate_all()
938 vchan->phy = NULL; in sun6i_dma_terminate_all()
939 pchan->vchan = NULL; in sun6i_dma_terminate_all()
944 spin_unlock_irqrestore(&vchan->vc.lock, flags); in sun6i_dma_terminate_all()
946 vchan_dma_desc_free_list(&vchan->vc, &head); in sun6i_dma_terminate_all()
955 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_tx_status() local
956 struct sun6i_pchan *pchan = vchan->phy; in sun6i_dma_tx_status()
968 spin_lock_irqsave(&vchan->vc.lock, flags); in sun6i_dma_tx_status()
970 vd = vchan_find_desc(&vchan->vc, cookie); in sun6i_dma_tx_status()
982 spin_unlock_irqrestore(&vchan->vc.lock, flags); in sun6i_dma_tx_status()
992 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_issue_pending() local
995 spin_lock_irqsave(&vchan->vc.lock, flags); in sun6i_dma_issue_pending()
997 if (vchan_issue_pending(&vchan->vc)) { in sun6i_dma_issue_pending()
1000 if (!vchan->phy && list_empty(&vchan->node)) { in sun6i_dma_issue_pending()
1001 list_add_tail(&vchan->node, &sdev->pending); in sun6i_dma_issue_pending()
1004 &vchan->vc); in sun6i_dma_issue_pending()
1010 &vchan->vc); in sun6i_dma_issue_pending()
1013 spin_unlock_irqrestore(&vchan->vc.lock, flags); in sun6i_dma_issue_pending()
1019 struct sun6i_vchan *vchan = to_sun6i_vchan(chan); in sun6i_dma_free_chan_resources() local
1023 list_del_init(&vchan->node); in sun6i_dma_free_chan_resources()
1026 vchan_free_chan_resources(&vchan->vc); in sun6i_dma_free_chan_resources()
1033 struct sun6i_vchan *vchan; in sun6i_dma_of_xlate() local
1044 vchan = to_sun6i_vchan(chan); in sun6i_dma_of_xlate()
1045 vchan->port = port; in sun6i_dma_of_xlate()
1071 struct sun6i_vchan *vchan = &sdev->vchans[i]; in sun6i_dma_free() local
1073 list_del(&vchan->vc.chan.device_node); in sun6i_dma_free()
1074 tasklet_kill(&vchan->vc.task); in sun6i_dma_free()
1405 struct sun6i_vchan *vchan = &sdc->vchans[i]; in sun6i_dma_probe() local
1407 INIT_LIST_HEAD(&vchan->node); in sun6i_dma_probe()
1408 vchan->vc.desc_free = sun6i_dma_free_desc; in sun6i_dma_probe()
1409 vchan_init(&vchan->vc, &sdc->slave); in sun6i_dma_probe()