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()
563 static int mmp_tdma_chan_init(struct mmp_tdma_device *tdev, in mmp_tdma_chan_init() argument
570 dev_err(tdev->dev, "too many channels for device!\n"); in mmp_tdma_chan_init()
575 tdmac = devm_kzalloc(tdev->dev, sizeof(*tdmac), GFP_KERNEL); in mmp_tdma_chan_init()
581 tdmac->dev = tdev->dev; in mmp_tdma_chan_init()
582 tdmac->chan.device = &tdev->device; in mmp_tdma_chan_init()
585 tdmac->reg_base = tdev->base + idx * 4; in mmp_tdma_chan_init()
588 tdev->tdmac[tdmac->idx] = tdmac; in mmp_tdma_chan_init()
593 &tdev->device.channels); in mmp_tdma_chan_init()
614 struct mmp_tdma_device *tdev = ofdma->of_dma_data; in mmp_tdma_xlate() local
615 dma_cap_mask_t mask = tdev->device.cap_mask; in mmp_tdma_xlate()
641 struct mmp_tdma_device *tdev; in mmp_tdma_probe() local
654 tdev = devm_kzalloc(&pdev->dev, sizeof(*tdev), GFP_KERNEL); in mmp_tdma_probe()
655 if (!tdev) in mmp_tdma_probe()
658 tdev->dev = &pdev->dev; in mmp_tdma_probe()
665 tdev->base = devm_platform_ioremap_resource(pdev, 0); in mmp_tdma_probe()
666 if (IS_ERR(tdev->base)) in mmp_tdma_probe()
667 return PTR_ERR(tdev->base); in mmp_tdma_probe()
669 INIT_LIST_HEAD(&tdev->device.channels); in mmp_tdma_probe()
680 mmp_tdma_int_handler, IRQF_SHARED, "tdma", tdev); in mmp_tdma_probe()
688 ret = mmp_tdma_chan_init(tdev, i, irq, type, pool); in mmp_tdma_probe()
693 dma_cap_set(DMA_SLAVE, tdev->device.cap_mask); in mmp_tdma_probe()
694 dma_cap_set(DMA_CYCLIC, tdev->device.cap_mask); in mmp_tdma_probe()
695 tdev->device.dev = &pdev->dev; in mmp_tdma_probe()
696 tdev->device.device_alloc_chan_resources = in mmp_tdma_probe()
698 tdev->device.device_free_chan_resources = in mmp_tdma_probe()
700 tdev->device.device_prep_dma_cyclic = mmp_tdma_prep_dma_cyclic; in mmp_tdma_probe()
701 tdev->device.device_tx_status = mmp_tdma_tx_status; in mmp_tdma_probe()
702 tdev->device.device_issue_pending = mmp_tdma_issue_pending; in mmp_tdma_probe()
703 tdev->device.device_config = mmp_tdma_config; in mmp_tdma_probe()
704 tdev->device.device_pause = mmp_tdma_pause_chan; in mmp_tdma_probe()
705 tdev->device.device_resume = mmp_tdma_resume_chan; in mmp_tdma_probe()
706 tdev->device.device_terminate_all = mmp_tdma_terminate_all; in mmp_tdma_probe()
707 tdev->device.copy_align = DMAENGINE_ALIGN_8_BYTES; in mmp_tdma_probe()
709 tdev->device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); in mmp_tdma_probe()
711 tdev->device.max_burst = SZ_128; in mmp_tdma_probe()
712 tdev->device.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); in mmp_tdma_probe()
713 tdev->device.dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); in mmp_tdma_probe()
715 tdev->device.max_burst = SZ_32; in mmp_tdma_probe()
717 tdev->device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; in mmp_tdma_probe()
718 tdev->device.descriptor_reuse = true; in mmp_tdma_probe()
721 platform_set_drvdata(pdev, tdev); in mmp_tdma_probe()
723 ret = dmaenginem_async_device_register(&tdev->device); in mmp_tdma_probe()
725 dev_err(tdev->device.dev, "unable to register\n"); in mmp_tdma_probe()
731 mmp_tdma_xlate, tdev); in mmp_tdma_probe()
733 dev_err(tdev->device.dev, in mmp_tdma_probe()
739 dev_info(tdev->device.dev, "initialized\n"); in mmp_tdma_probe()