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()
591 struct timb_dma *td = (struct timb_dma *)data; in td_tasklet() local
597 isr = ioread32(td->membase + TIMBDMA_ISR); in td_tasklet()
598 ipr = isr & __td_ier_mask(td); in td_tasklet()
601 iowrite32(ipr, td->membase + TIMBDMA_ISR); in td_tasklet()
603 for (i = 0; i < td->dma.chancnt; i++) in td_tasklet()
605 struct timb_dma_chan *td_chan = td->channels + i; in td_tasklet()
613 ier = __td_ier_mask(td); in td_tasklet()
614 iowrite32(ier, td->membase + TIMBDMA_IER); in td_tasklet()
620 struct timb_dma *td = devid; in td_irq() local
621 u32 ipr = ioread32(td->membase + TIMBDMA_IPR); in td_irq()
625 iowrite32(0, td->membase + TIMBDMA_IER); in td_irq()
627 tasklet_schedule(&td->tasklet); in td_irq()
638 struct timb_dma *td; in td_probe() local
661 td = kzalloc(sizeof(struct timb_dma) + in td_probe()
663 if (!td) { in td_probe()
668 dev_dbg(&pdev->dev, "Allocated TD: %p\n", td); in td_probe()
670 td->membase = ioremap(iomem->start, resource_size(iomem)); in td_probe()
671 if (!td->membase) { in td_probe()
678 iowrite32(TIMBDMA_32BIT_ADDR, td->membase + TIMBDMA_ACR); in td_probe()
681 iowrite32(0x0, td->membase + TIMBDMA_IER); in td_probe()
682 iowrite32(0xFFFFFFFF, td->membase + TIMBDMA_ISR); in td_probe()
684 tasklet_init(&td->tasklet, td_tasklet, (unsigned long)td); in td_probe()
686 err = request_irq(irq, td_irq, IRQF_SHARED, DRIVER_NAME, td); in td_probe()
692 td->dma.device_alloc_chan_resources = td_alloc_chan_resources; in td_probe()
693 td->dma.device_free_chan_resources = td_free_chan_resources; in td_probe()
694 td->dma.device_tx_status = td_tx_status; in td_probe()
695 td->dma.device_issue_pending = td_issue_pending; in td_probe()
697 dma_cap_set(DMA_SLAVE, td->dma.cap_mask); in td_probe()
698 dma_cap_set(DMA_PRIVATE, td->dma.cap_mask); in td_probe()
699 td->dma.device_prep_slave_sg = td_prep_slave_sg; in td_probe()
700 td->dma.device_control = td_control; in td_probe()
702 td->dma.dev = &pdev->dev; in td_probe()
704 INIT_LIST_HEAD(&td->dma.channels); in td_probe()
707 struct timb_dma_chan *td_chan = &td->channels[i]; in td_probe()
718 td_chan->chan.device = &td->dma; in td_probe()
731 td_chan->membase = td->membase + in td_probe()
738 list_add_tail(&td_chan->chan.device_node, &td->dma.channels); in td_probe()
741 err = dma_async_device_register(&td->dma); in td_probe()
747 platform_set_drvdata(pdev, td); in td_probe()
753 free_irq(irq, td); in td_probe()
755 tasklet_kill(&td->tasklet); in td_probe()
756 iounmap(td->membase); in td_probe()
758 kfree(td); in td_probe()
768 struct timb_dma *td = platform_get_drvdata(pdev); in td_remove() local
772 dma_async_device_unregister(&td->dma); in td_remove()
773 free_irq(irq, td); in td_remove()
774 tasklet_kill(&td->tasklet); in td_remove()
775 iounmap(td->membase); in td_remove()
776 kfree(td); in td_remove()