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
655 tdev = devm_kzalloc(&pdev->dev, sizeof(*tdev), GFP_KERNEL); in mmp_tdma_probe()
656 if (!tdev) in mmp_tdma_probe()
659 tdev->dev = &pdev->dev; in mmp_tdma_probe()
667 tdev->base = devm_ioremap_resource(&pdev->dev, iores); in mmp_tdma_probe()
668 if (IS_ERR(tdev->base)) in mmp_tdma_probe()
669 return PTR_ERR(tdev->base); in mmp_tdma_probe()
671 INIT_LIST_HEAD(&tdev->device.channels); in mmp_tdma_probe()
685 mmp_tdma_int_handler, IRQF_SHARED, "tdma", tdev); in mmp_tdma_probe()
693 ret = mmp_tdma_chan_init(tdev, i, irq, type, pool); in mmp_tdma_probe()
698 dma_cap_set(DMA_SLAVE, tdev->device.cap_mask); in mmp_tdma_probe()
699 dma_cap_set(DMA_CYCLIC, tdev->device.cap_mask); in mmp_tdma_probe()
700 tdev->device.dev = &pdev->dev; in mmp_tdma_probe()
701 tdev->device.device_alloc_chan_resources = in mmp_tdma_probe()
703 tdev->device.device_free_chan_resources = in mmp_tdma_probe()
705 tdev->device.device_prep_dma_cyclic = mmp_tdma_prep_dma_cyclic; in mmp_tdma_probe()
706 tdev->device.device_tx_status = mmp_tdma_tx_status; in mmp_tdma_probe()
707 tdev->device.device_issue_pending = mmp_tdma_issue_pending; in mmp_tdma_probe()
708 tdev->device.device_config = mmp_tdma_config; in mmp_tdma_probe()
709 tdev->device.device_pause = mmp_tdma_pause_chan; in mmp_tdma_probe()
710 tdev->device.device_resume = mmp_tdma_resume_chan; in mmp_tdma_probe()
711 tdev->device.device_terminate_all = mmp_tdma_terminate_all; in mmp_tdma_probe()
712 tdev->device.copy_align = DMAENGINE_ALIGN_8_BYTES; in mmp_tdma_probe()
714 tdev->device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); in mmp_tdma_probe()
716 tdev->device.max_burst = SZ_128; in mmp_tdma_probe()
717 tdev->device.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); in mmp_tdma_probe()
718 tdev->device.dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); in mmp_tdma_probe()
720 tdev->device.max_burst = SZ_32; in mmp_tdma_probe()
722 tdev->device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; in mmp_tdma_probe()
723 tdev->device.descriptor_reuse = true; in mmp_tdma_probe()
726 platform_set_drvdata(pdev, tdev); in mmp_tdma_probe()
728 ret = dmaenginem_async_device_register(&tdev->device); in mmp_tdma_probe()
730 dev_err(tdev->device.dev, "unable to register\n"); in mmp_tdma_probe()
736 mmp_tdma_xlate, tdev); in mmp_tdma_probe()
738 dev_err(tdev->device.dev, in mmp_tdma_probe()
744 dev_info(tdev->device.dev, "initialized\n"); in mmp_tdma_probe()