Lines Matching refs:td
126 struct timb_dma *td = tdchantotd(td_chan); in __td_enable_chan_irq() local
130 ier = ioread32(td->membase + TIMBDMA_IER); in __td_enable_chan_irq()
134 iowrite32(ier, td->membase + TIMBDMA_IER); in __td_enable_chan_irq()
141 struct timb_dma *td = (struct timb_dma *)((u8 *)td_chan - in __td_dma_done_ack() local
146 dev_dbg(chan2dev(&td_chan->chan), "Checking irq: %d, td: %p\n", id, td); in __td_dma_done_ack()
148 isr = ioread32(td->membase + TIMBDMA_ISR) & (1 << id); in __td_dma_done_ack()
150 iowrite32(isr, td->membase + TIMBDMA_ISR); in __td_dma_done_ack()
273 static u32 __td_ier_mask(struct timb_dma *td) in __td_ier_mask() argument
278 for (i = 0; i < td->dma.chancnt; i++) { in __td_ier_mask()
279 struct timb_dma_chan *td_chan = td->channels + i; in __td_ier_mask()
587 struct timb_dma *td = (struct timb_dma *)data; in td_tasklet() local
593 isr = ioread32(td->membase + TIMBDMA_ISR); in td_tasklet()
594 ipr = isr & __td_ier_mask(td); in td_tasklet()
597 iowrite32(ipr, td->membase + TIMBDMA_ISR); in td_tasklet()
599 for (i = 0; i < td->dma.chancnt; i++) in td_tasklet()
601 struct timb_dma_chan *td_chan = td->channels + i; in td_tasklet()
609 ier = __td_ier_mask(td); in td_tasklet()
610 iowrite32(ier, td->membase + TIMBDMA_IER); in td_tasklet()
616 struct timb_dma *td = devid; in td_irq() local
617 u32 ipr = ioread32(td->membase + TIMBDMA_IPR); in td_irq()
621 iowrite32(0, td->membase + TIMBDMA_IER); in td_irq()
623 tasklet_schedule(&td->tasklet); in td_irq()
634 struct timb_dma *td; in td_probe() local
657 td = kzalloc(sizeof(struct timb_dma) + in td_probe()
659 if (!td) { in td_probe()
664 dev_dbg(&pdev->dev, "Allocated TD: %p\n", td); in td_probe()
666 td->membase = ioremap(iomem->start, resource_size(iomem)); in td_probe()
667 if (!td->membase) { in td_probe()
674 iowrite32(TIMBDMA_32BIT_ADDR, td->membase + TIMBDMA_ACR); in td_probe()
677 iowrite32(0x0, td->membase + TIMBDMA_IER); in td_probe()
678 iowrite32(0xFFFFFFFF, td->membase + TIMBDMA_ISR); in td_probe()
680 tasklet_init(&td->tasklet, td_tasklet, (unsigned long)td); in td_probe()
682 err = request_irq(irq, td_irq, IRQF_SHARED, DRIVER_NAME, td); in td_probe()
688 td->dma.device_alloc_chan_resources = td_alloc_chan_resources; in td_probe()
689 td->dma.device_free_chan_resources = td_free_chan_resources; in td_probe()
690 td->dma.device_tx_status = td_tx_status; in td_probe()
691 td->dma.device_issue_pending = td_issue_pending; in td_probe()
693 dma_cap_set(DMA_SLAVE, td->dma.cap_mask); in td_probe()
694 dma_cap_set(DMA_PRIVATE, td->dma.cap_mask); in td_probe()
695 td->dma.device_prep_slave_sg = td_prep_slave_sg; in td_probe()
696 td->dma.device_terminate_all = td_terminate_all; in td_probe()
698 td->dma.dev = &pdev->dev; in td_probe()
700 INIT_LIST_HEAD(&td->dma.channels); in td_probe()
703 struct timb_dma_chan *td_chan = &td->channels[i]; in td_probe()
714 td_chan->chan.device = &td->dma; in td_probe()
727 td_chan->membase = td->membase + in td_probe()
734 list_add_tail(&td_chan->chan.device_node, &td->dma.channels); in td_probe()
737 err = dma_async_device_register(&td->dma); in td_probe()
743 platform_set_drvdata(pdev, td); in td_probe()
749 free_irq(irq, td); in td_probe()
751 tasklet_kill(&td->tasklet); in td_probe()
752 iounmap(td->membase); in td_probe()
754 kfree(td); in td_probe()
764 struct timb_dma *td = platform_get_drvdata(pdev); in td_remove() local
768 dma_async_device_unregister(&td->dma); in td_remove()
769 free_irq(irq, td); in td_remove()
770 tasklet_kill(&td->tasklet); in td_remove()
771 iounmap(td->membase); in td_remove()
772 kfree(td); in td_remove()