Lines Matching refs:td
122 struct timb_dma *td = tdchantotd(td_chan); in __td_enable_chan_irq() local
126 ier = ioread32(td->membase + TIMBDMA_IER); in __td_enable_chan_irq()
130 iowrite32(ier, td->membase + TIMBDMA_IER); in __td_enable_chan_irq()
137 struct timb_dma *td = (struct timb_dma *)((u8 *)td_chan - in __td_dma_done_ack() local
142 dev_dbg(chan2dev(&td_chan->chan), "Checking irq: %d, td: %p\n", id, td); in __td_dma_done_ack()
144 isr = ioread32(td->membase + TIMBDMA_ISR) & (1 << id); in __td_dma_done_ack()
146 iowrite32(isr, td->membase + TIMBDMA_ISR); in __td_dma_done_ack()
269 static u32 __td_ier_mask(struct timb_dma *td) in __td_ier_mask() argument
274 for (i = 0; i < td->dma.chancnt; i++) { in __td_ier_mask()
275 struct timb_dma_chan *td_chan = td->channels + i; in __td_ier_mask()
583 struct timb_dma *td = (struct timb_dma *)data; in td_tasklet() local
589 isr = ioread32(td->membase + TIMBDMA_ISR); in td_tasklet()
590 ipr = isr & __td_ier_mask(td); in td_tasklet()
593 iowrite32(ipr, td->membase + TIMBDMA_ISR); in td_tasklet()
595 for (i = 0; i < td->dma.chancnt; i++) in td_tasklet()
597 struct timb_dma_chan *td_chan = td->channels + i; in td_tasklet()
605 ier = __td_ier_mask(td); in td_tasklet()
606 iowrite32(ier, td->membase + TIMBDMA_IER); in td_tasklet()
612 struct timb_dma *td = devid; in td_irq() local
613 u32 ipr = ioread32(td->membase + TIMBDMA_IPR); in td_irq()
617 iowrite32(0, td->membase + TIMBDMA_IER); in td_irq()
619 tasklet_schedule(&td->tasklet); in td_irq()
630 struct timb_dma *td; in td_probe() local
653 td = kzalloc(sizeof(struct timb_dma) + in td_probe()
655 if (!td) { in td_probe()
660 dev_dbg(&pdev->dev, "Allocated TD: %p\n", td); in td_probe()
662 td->membase = ioremap(iomem->start, resource_size(iomem)); in td_probe()
663 if (!td->membase) { in td_probe()
670 iowrite32(TIMBDMA_32BIT_ADDR, td->membase + TIMBDMA_ACR); in td_probe()
673 iowrite32(0x0, td->membase + TIMBDMA_IER); in td_probe()
674 iowrite32(0xFFFFFFFF, td->membase + TIMBDMA_ISR); in td_probe()
676 tasklet_init(&td->tasklet, td_tasklet, (unsigned long)td); in td_probe()
678 err = request_irq(irq, td_irq, IRQF_SHARED, DRIVER_NAME, td); in td_probe()
684 td->dma.device_alloc_chan_resources = td_alloc_chan_resources; in td_probe()
685 td->dma.device_free_chan_resources = td_free_chan_resources; in td_probe()
686 td->dma.device_tx_status = td_tx_status; in td_probe()
687 td->dma.device_issue_pending = td_issue_pending; in td_probe()
689 dma_cap_set(DMA_SLAVE, td->dma.cap_mask); in td_probe()
690 dma_cap_set(DMA_PRIVATE, td->dma.cap_mask); in td_probe()
691 td->dma.device_prep_slave_sg = td_prep_slave_sg; in td_probe()
692 td->dma.device_terminate_all = td_terminate_all; in td_probe()
694 td->dma.dev = &pdev->dev; in td_probe()
696 INIT_LIST_HEAD(&td->dma.channels); in td_probe()
699 struct timb_dma_chan *td_chan = &td->channels[i]; in td_probe()
710 td_chan->chan.device = &td->dma; in td_probe()
723 td_chan->membase = td->membase + in td_probe()
730 list_add_tail(&td_chan->chan.device_node, &td->dma.channels); in td_probe()
733 err = dma_async_device_register(&td->dma); in td_probe()
739 platform_set_drvdata(pdev, td); in td_probe()
745 free_irq(irq, td); in td_probe()
747 tasklet_kill(&td->tasklet); in td_probe()
748 iounmap(td->membase); in td_probe()
750 kfree(td); in td_probe()
760 struct timb_dma *td = platform_get_drvdata(pdev); in td_remove() local
764 dma_async_device_unregister(&td->dma); in td_remove()
765 free_irq(irq, td); in td_remove()
766 tasklet_kill(&td->tasklet); in td_remove()
767 iounmap(td->membase); in td_remove()
768 kfree(td); in td_remove()