Lines Matching refs:td

114 	struct timb_dma *td = tdchantotd(td_chan);  in __td_enable_chan_irq()  local
118 ier = ioread32(td->membase + TIMBDMA_IER); in __td_enable_chan_irq()
122 iowrite32(ier, td->membase + TIMBDMA_IER); in __td_enable_chan_irq()
129 struct timb_dma *td = (struct timb_dma *)((u8 *)td_chan - in __td_dma_done_ack() local
134 dev_dbg(chan2dev(&td_chan->chan), "Checking irq: %d, td: %p\n", id, td); in __td_dma_done_ack()
136 isr = ioread32(td->membase + TIMBDMA_ISR) & (1 << id); in __td_dma_done_ack()
138 iowrite32(isr, td->membase + TIMBDMA_ISR); in __td_dma_done_ack()
258 static u32 __td_ier_mask(struct timb_dma *td) in __td_ier_mask() argument
263 for (i = 0; i < td->dma.chancnt; i++) { in __td_ier_mask()
264 struct timb_dma_chan *td_chan = td->channels + i; in __td_ier_mask()
568 struct timb_dma *td = from_tasklet(td, t, tasklet); in td_tasklet() local
574 isr = ioread32(td->membase + TIMBDMA_ISR); in td_tasklet()
575 ipr = isr & __td_ier_mask(td); in td_tasklet()
578 iowrite32(ipr, td->membase + TIMBDMA_ISR); in td_tasklet()
580 for (i = 0; i < td->dma.chancnt; i++) in td_tasklet()
582 struct timb_dma_chan *td_chan = td->channels + i; in td_tasklet()
590 ier = __td_ier_mask(td); in td_tasklet()
591 iowrite32(ier, td->membase + TIMBDMA_IER); in td_tasklet()
597 struct timb_dma *td = devid; in td_irq() local
598 u32 ipr = ioread32(td->membase + TIMBDMA_IPR); in td_irq()
602 iowrite32(0, td->membase + TIMBDMA_IER); in td_irq()
604 tasklet_schedule(&td->tasklet); in td_irq()
615 struct timb_dma *td; in td_probe() local
638 td = kzalloc(struct_size(td, channels, pdata->nr_channels), in td_probe()
640 if (!td) { in td_probe()
645 dev_dbg(&pdev->dev, "Allocated TD: %p\n", td); in td_probe()
647 td->membase = ioremap(iomem->start, resource_size(iomem)); in td_probe()
648 if (!td->membase) { in td_probe()
655 iowrite32(TIMBDMA_32BIT_ADDR, td->membase + TIMBDMA_ACR); in td_probe()
658 iowrite32(0x0, td->membase + TIMBDMA_IER); in td_probe()
659 iowrite32(0xFFFFFFFF, td->membase + TIMBDMA_ISR); in td_probe()
661 tasklet_setup(&td->tasklet, td_tasklet); in td_probe()
663 err = request_irq(irq, td_irq, IRQF_SHARED, DRIVER_NAME, td); in td_probe()
669 td->dma.device_alloc_chan_resources = td_alloc_chan_resources; in td_probe()
670 td->dma.device_free_chan_resources = td_free_chan_resources; in td_probe()
671 td->dma.device_tx_status = td_tx_status; in td_probe()
672 td->dma.device_issue_pending = td_issue_pending; in td_probe()
674 dma_cap_set(DMA_SLAVE, td->dma.cap_mask); in td_probe()
675 dma_cap_set(DMA_PRIVATE, td->dma.cap_mask); in td_probe()
676 td->dma.device_prep_slave_sg = td_prep_slave_sg; in td_probe()
677 td->dma.device_terminate_all = td_terminate_all; in td_probe()
679 td->dma.dev = &pdev->dev; in td_probe()
681 INIT_LIST_HEAD(&td->dma.channels); in td_probe()
684 struct timb_dma_chan *td_chan = &td->channels[i]; in td_probe()
695 td_chan->chan.device = &td->dma; in td_probe()
708 td_chan->membase = td->membase + in td_probe()
715 list_add_tail(&td_chan->chan.device_node, &td->dma.channels); in td_probe()
718 err = dma_async_device_register(&td->dma); in td_probe()
724 platform_set_drvdata(pdev, td); in td_probe()
730 free_irq(irq, td); in td_probe()
732 tasklet_kill(&td->tasklet); in td_probe()
733 iounmap(td->membase); in td_probe()
735 kfree(td); in td_probe()
745 struct timb_dma *td = platform_get_drvdata(pdev); in td_remove() local
749 dma_async_device_unregister(&td->dma); in td_remove()
750 free_irq(irq, td); in td_remove()
751 tasklet_kill(&td->tasklet); in td_remove()
752 iounmap(td->membase); in td_remove()
753 kfree(td); in td_remove()