Lines Matching refs:tdev
331 struct mmp_tdma_device *tdev = dev_id; in mmp_tdma_int_handler() local
336 struct mmp_tdma_chan *tdmac = tdev->tdmac[i]; in mmp_tdma_int_handler()
561 static int mmp_tdma_chan_init(struct mmp_tdma_device *tdev, in mmp_tdma_chan_init() argument
568 dev_err(tdev->dev, "too many channels for device!\n"); in mmp_tdma_chan_init()
573 tdmac = devm_kzalloc(tdev->dev, sizeof(*tdmac), GFP_KERNEL); in mmp_tdma_chan_init()
579 tdmac->dev = tdev->dev; in mmp_tdma_chan_init()
580 tdmac->chan.device = &tdev->device; in mmp_tdma_chan_init()
583 tdmac->reg_base = tdev->base + idx * 4; in mmp_tdma_chan_init()
586 tdev->tdmac[tdmac->idx] = tdmac; in mmp_tdma_chan_init()
591 &tdev->device.channels); in mmp_tdma_chan_init()
612 struct mmp_tdma_device *tdev = ofdma->of_dma_data; in mmp_tdma_xlate() local
613 dma_cap_mask_t mask = tdev->device.cap_mask; in mmp_tdma_xlate()
638 struct mmp_tdma_device *tdev; in mmp_tdma_probe() local
647 tdev = devm_kzalloc(&pdev->dev, sizeof(*tdev), GFP_KERNEL); in mmp_tdma_probe()
648 if (!tdev) in mmp_tdma_probe()
651 tdev->dev = &pdev->dev; in mmp_tdma_probe()
658 tdev->base = devm_platform_ioremap_resource(pdev, 0); in mmp_tdma_probe()
659 if (IS_ERR(tdev->base)) in mmp_tdma_probe()
660 return PTR_ERR(tdev->base); in mmp_tdma_probe()
662 INIT_LIST_HEAD(&tdev->device.channels); in mmp_tdma_probe()
673 mmp_tdma_int_handler, IRQF_SHARED, "tdma", tdev); in mmp_tdma_probe()
681 ret = mmp_tdma_chan_init(tdev, i, irq, type, pool); in mmp_tdma_probe()
686 dma_cap_set(DMA_SLAVE, tdev->device.cap_mask); in mmp_tdma_probe()
687 dma_cap_set(DMA_CYCLIC, tdev->device.cap_mask); in mmp_tdma_probe()
688 tdev->device.dev = &pdev->dev; in mmp_tdma_probe()
689 tdev->device.device_alloc_chan_resources = in mmp_tdma_probe()
691 tdev->device.device_free_chan_resources = in mmp_tdma_probe()
693 tdev->device.device_prep_dma_cyclic = mmp_tdma_prep_dma_cyclic; in mmp_tdma_probe()
694 tdev->device.device_tx_status = mmp_tdma_tx_status; in mmp_tdma_probe()
695 tdev->device.device_issue_pending = mmp_tdma_issue_pending; in mmp_tdma_probe()
696 tdev->device.device_config = mmp_tdma_config; in mmp_tdma_probe()
697 tdev->device.device_pause = mmp_tdma_pause_chan; in mmp_tdma_probe()
698 tdev->device.device_resume = mmp_tdma_resume_chan; in mmp_tdma_probe()
699 tdev->device.device_terminate_all = mmp_tdma_terminate_all; in mmp_tdma_probe()
700 tdev->device.copy_align = DMAENGINE_ALIGN_8_BYTES; in mmp_tdma_probe()
702 tdev->device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); in mmp_tdma_probe()
704 tdev->device.max_burst = SZ_128; in mmp_tdma_probe()
705 tdev->device.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); in mmp_tdma_probe()
706 tdev->device.dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); in mmp_tdma_probe()
708 tdev->device.max_burst = SZ_32; in mmp_tdma_probe()
710 tdev->device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; in mmp_tdma_probe()
711 tdev->device.descriptor_reuse = true; in mmp_tdma_probe()
714 platform_set_drvdata(pdev, tdev); in mmp_tdma_probe()
716 ret = dmaenginem_async_device_register(&tdev->device); in mmp_tdma_probe()
718 dev_err(tdev->device.dev, "unable to register\n"); in mmp_tdma_probe()
723 mmp_tdma_xlate, tdev); in mmp_tdma_probe()
725 dev_err(tdev->device.dev, "failed to register controller\n"); in mmp_tdma_probe()
729 dev_info(tdev->device.dev, "initialized\n"); in mmp_tdma_probe()