Lines Matching refs:xdev

243 	struct xilinx_dpdma_device *xdev;  member
450 static void xilinx_dpdma_debugfs_init(struct xilinx_dpdma_device *xdev) in xilinx_dpdma_debugfs_init() argument
456 dent = debugfs_create_file("testcase", 0444, xdev->common.dbg_dev_root, in xilinx_dpdma_debugfs_init()
459 dev_err(xdev->dev, "Failed to create debugfs testcase file\n"); in xilinx_dpdma_debugfs_init()
503 static void xilinx_dpdma_sw_desc_set_dma_addrs(struct xilinx_dpdma_device *xdev, in xilinx_dpdma_sw_desc_set_dma_addrs() argument
513 if (xdev->ext_addr) in xilinx_dpdma_sw_desc_set_dma_addrs()
523 if (xdev->ext_addr) { in xilinx_dpdma_sw_desc_set_dma_addrs()
537 if (xdev->ext_addr) in xilinx_dpdma_sw_desc_set_dma_addrs()
591 struct device *dev = chan->xdev->dev; in xilinx_dpdma_chan_dump_tx_desc()
693 dev_err(chan->xdev->dev, in xilinx_dpdma_chan_prep_interleaved_dma()
709 xilinx_dpdma_sw_desc_set_dma_addrs(chan->xdev, sw_desc, sw_desc, in xilinx_dpdma_chan_prep_interleaved_dma()
745 dpdma_write(chan->xdev->reg, XILINX_DPDMA_IEN, reg); in xilinx_dpdma_chan_enable()
748 dpdma_write(chan->xdev->reg, XILINX_DPDMA_EIEN, reg); in xilinx_dpdma_chan_enable()
771 dpdma_write(chan->xdev->reg, XILINX_DPDMA_IEN, reg); in xilinx_dpdma_chan_disable()
773 dpdma_write(chan->xdev->reg, XILINX_DPDMA_EIEN, reg); in xilinx_dpdma_chan_disable()
802 struct xilinx_dpdma_device *xdev = chan->xdev; in xilinx_dpdma_chan_video_group_ready() local
807 if (xdev->chan[i]->video_group && !xdev->chan[i]->running) in xilinx_dpdma_chan_video_group_ready()
810 if (xdev->chan[i]->video_group) in xilinx_dpdma_chan_video_group_ready()
826 struct xilinx_dpdma_device *xdev = chan->xdev; in xilinx_dpdma_chan_queue_transfer() local
865 if (xdev->ext_addr) in xilinx_dpdma_chan_queue_transfer()
890 dpdma_write(xdev->reg, XILINX_DPDMA_GBL, reg); in xilinx_dpdma_chan_queue_transfer()
927 dev_dbg(chan->xdev->dev, in xilinx_dpdma_chan_notify_no_ostand()
934 dpdma_write(chan->xdev->reg, XILINX_DPDMA_IDS, in xilinx_dpdma_chan_notify_no_ostand()
960 dpdma_write(chan->xdev->reg, XILINX_DPDMA_IEN, in xilinx_dpdma_chan_wait_no_ostand()
965 dev_err(chan->xdev->dev, "chan%u: not ready to stop: %d trans\n", in xilinx_dpdma_chan_wait_no_ostand()
995 dpdma_write(chan->xdev->reg, XILINX_DPDMA_IEN, in xilinx_dpdma_chan_poll_no_ostand()
1000 dev_err(chan->xdev->dev, "chan%u: not ready to stop: %d trans\n", in xilinx_dpdma_chan_poll_no_ostand()
1054 dev_warn(chan->xdev->dev, in xilinx_dpdma_chan_done_irq()
1089 dev_dbg(chan->xdev->dev, in xilinx_dpdma_chan_vsync_irq()
1143 struct xilinx_dpdma_device *xdev = chan->xdev; in xilinx_dpdma_chan_handle_err() local
1149 dev_dbg(xdev->dev, "chan%u: cur desc addr = 0x%04x%08x\n", in xilinx_dpdma_chan_handle_err()
1153 dev_dbg(xdev->dev, "chan%u: cur payload addr = 0x%04x%08x\n", in xilinx_dpdma_chan_handle_err()
1170 dev_dbg(xdev->dev, "chan%u: repeated error on desc\n", in xilinx_dpdma_chan_handle_err()
1230 chan->desc_pool = dma_pool_create(dev_name(chan->xdev->dev), in xilinx_dpdma_alloc_chan_resources()
1231 chan->xdev->dev, in xilinx_dpdma_alloc_chan_resources()
1235 dev_err(chan->xdev->dev, in xilinx_dpdma_alloc_chan_resources()
1331 struct xilinx_dpdma_device *xdev = chan->xdev; in xilinx_dpdma_terminate_all() local
1339 if (xdev->chan[i]->video_group && in xilinx_dpdma_terminate_all()
1340 xdev->chan[i]->running) { in xilinx_dpdma_terminate_all()
1341 xilinx_dpdma_chan_pause(xdev->chan[i]); in xilinx_dpdma_terminate_all()
1342 xdev->chan[i]->video_group = false; in xilinx_dpdma_terminate_all()
1423 static void xilinx_dpdma_handle_err_irq(struct xilinx_dpdma_device *xdev, in xilinx_dpdma_handle_err_irq() argument
1429 dev_dbg_ratelimited(xdev->dev, in xilinx_dpdma_handle_err_irq()
1434 dpdma_write(xdev->reg, XILINX_DPDMA_IDS, in xilinx_dpdma_handle_err_irq()
1436 dpdma_write(xdev->reg, XILINX_DPDMA_EIDS, in xilinx_dpdma_handle_err_irq()
1439 for (i = 0; i < ARRAY_SIZE(xdev->chan); i++) in xilinx_dpdma_handle_err_irq()
1440 if (err || xilinx_dpdma_chan_err(xdev->chan[i], isr, eisr)) in xilinx_dpdma_handle_err_irq()
1441 tasklet_schedule(&xdev->chan[i]->err_task); in xilinx_dpdma_handle_err_irq()
1450 static void xilinx_dpdma_enable_irq(struct xilinx_dpdma_device *xdev) in xilinx_dpdma_enable_irq() argument
1452 dpdma_write(xdev->reg, XILINX_DPDMA_IEN, XILINX_DPDMA_INTR_ALL); in xilinx_dpdma_enable_irq()
1453 dpdma_write(xdev->reg, XILINX_DPDMA_EIEN, XILINX_DPDMA_EINTR_ALL); in xilinx_dpdma_enable_irq()
1462 static void xilinx_dpdma_disable_irq(struct xilinx_dpdma_device *xdev) in xilinx_dpdma_disable_irq() argument
1464 dpdma_write(xdev->reg, XILINX_DPDMA_IDS, XILINX_DPDMA_INTR_ALL); in xilinx_dpdma_disable_irq()
1465 dpdma_write(xdev->reg, XILINX_DPDMA_EIDS, XILINX_DPDMA_EINTR_ALL); in xilinx_dpdma_disable_irq()
1479 struct xilinx_dpdma_device *xdev = chan->xdev; in xilinx_dpdma_chan_err_task() local
1487 dpdma_write(xdev->reg, XILINX_DPDMA_IEN, in xilinx_dpdma_chan_err_task()
1489 dpdma_write(xdev->reg, XILINX_DPDMA_EIEN, in xilinx_dpdma_chan_err_task()
1499 struct xilinx_dpdma_device *xdev = data; in xilinx_dpdma_irq_handler() local
1505 status = dpdma_read(xdev->reg, XILINX_DPDMA_ISR); in xilinx_dpdma_irq_handler()
1506 error = dpdma_read(xdev->reg, XILINX_DPDMA_EISR); in xilinx_dpdma_irq_handler()
1510 dpdma_write(xdev->reg, XILINX_DPDMA_ISR, status); in xilinx_dpdma_irq_handler()
1511 dpdma_write(xdev->reg, XILINX_DPDMA_EISR, error); in xilinx_dpdma_irq_handler()
1518 for (i = 0; i < ARRAY_SIZE(xdev->chan); i++) { in xilinx_dpdma_irq_handler()
1519 struct xilinx_dpdma_chan *chan = xdev->chan[i]; in xilinx_dpdma_irq_handler()
1528 for_each_set_bit(i, &mask, ARRAY_SIZE(xdev->chan)) in xilinx_dpdma_irq_handler()
1529 xilinx_dpdma_chan_done_irq(xdev->chan[i]); in xilinx_dpdma_irq_handler()
1534 for_each_set_bit(i, &mask, ARRAY_SIZE(xdev->chan)) in xilinx_dpdma_irq_handler()
1535 xilinx_dpdma_chan_notify_no_ostand(xdev->chan[i]); in xilinx_dpdma_irq_handler()
1540 xilinx_dpdma_handle_err_irq(xdev, mask, error); in xilinx_dpdma_irq_handler()
1549 static int xilinx_dpdma_chan_init(struct xilinx_dpdma_device *xdev, in xilinx_dpdma_chan_init() argument
1554 chan = devm_kzalloc(xdev->dev, sizeof(*chan), GFP_KERNEL); in xilinx_dpdma_chan_init()
1559 chan->reg = xdev->reg + XILINX_DPDMA_CH_BASE in xilinx_dpdma_chan_init()
1562 chan->xdev = xdev; in xilinx_dpdma_chan_init()
1570 vchan_init(&chan->vchan, &xdev->common); in xilinx_dpdma_chan_init()
1572 xdev->chan[chan->id] = chan; in xilinx_dpdma_chan_init()
1589 struct xilinx_dpdma_device *xdev = ofdma->of_dma_data; in of_dma_xilinx_xlate() local
1592 if (chan_id >= ARRAY_SIZE(xdev->chan)) in of_dma_xilinx_xlate()
1595 if (!xdev->chan[chan_id]) in of_dma_xilinx_xlate()
1598 return dma_get_slave_channel(&xdev->chan[chan_id]->vchan.chan); in of_dma_xilinx_xlate()
1601 static void dpdma_hw_init(struct xilinx_dpdma_device *xdev) in dpdma_hw_init() argument
1607 xilinx_dpdma_disable_irq(xdev); in dpdma_hw_init()
1610 for (i = 0; i < ARRAY_SIZE(xdev->chan); i++) { in dpdma_hw_init()
1611 reg = xdev->reg + XILINX_DPDMA_CH_BASE in dpdma_hw_init()
1617 dpdma_write(xdev->reg, XILINX_DPDMA_ISR, XILINX_DPDMA_INTR_ALL); in dpdma_hw_init()
1618 dpdma_write(xdev->reg, XILINX_DPDMA_EISR, XILINX_DPDMA_EINTR_ALL); in dpdma_hw_init()
1623 struct xilinx_dpdma_device *xdev; in xilinx_dpdma_probe() local
1628 xdev = devm_kzalloc(&pdev->dev, sizeof(*xdev), GFP_KERNEL); in xilinx_dpdma_probe()
1629 if (!xdev) in xilinx_dpdma_probe()
1632 xdev->dev = &pdev->dev; in xilinx_dpdma_probe()
1633 xdev->ext_addr = sizeof(dma_addr_t) > 4; in xilinx_dpdma_probe()
1635 INIT_LIST_HEAD(&xdev->common.channels); in xilinx_dpdma_probe()
1637 platform_set_drvdata(pdev, xdev); in xilinx_dpdma_probe()
1639 xdev->axi_clk = devm_clk_get(xdev->dev, "axi_clk"); in xilinx_dpdma_probe()
1640 if (IS_ERR(xdev->axi_clk)) in xilinx_dpdma_probe()
1641 return PTR_ERR(xdev->axi_clk); in xilinx_dpdma_probe()
1643 xdev->reg = devm_platform_ioremap_resource(pdev, 0); in xilinx_dpdma_probe()
1644 if (IS_ERR(xdev->reg)) in xilinx_dpdma_probe()
1645 return PTR_ERR(xdev->reg); in xilinx_dpdma_probe()
1647 dpdma_hw_init(xdev); in xilinx_dpdma_probe()
1649 xdev->irq = platform_get_irq(pdev, 0); in xilinx_dpdma_probe()
1650 if (xdev->irq < 0) { in xilinx_dpdma_probe()
1651 dev_err(xdev->dev, "failed to get platform irq\n"); in xilinx_dpdma_probe()
1652 return xdev->irq; in xilinx_dpdma_probe()
1655 ret = request_irq(xdev->irq, xilinx_dpdma_irq_handler, IRQF_SHARED, in xilinx_dpdma_probe()
1656 dev_name(xdev->dev), xdev); in xilinx_dpdma_probe()
1658 dev_err(xdev->dev, "failed to request IRQ\n"); in xilinx_dpdma_probe()
1662 ddev = &xdev->common; in xilinx_dpdma_probe()
1687 for (i = 0; i < ARRAY_SIZE(xdev->chan); ++i) { in xilinx_dpdma_probe()
1688 ret = xilinx_dpdma_chan_init(xdev, i); in xilinx_dpdma_probe()
1690 dev_err(xdev->dev, "failed to initialize channel %u\n", in xilinx_dpdma_probe()
1696 ret = clk_prepare_enable(xdev->axi_clk); in xilinx_dpdma_probe()
1698 dev_err(xdev->dev, "failed to enable the axi clock\n"); in xilinx_dpdma_probe()
1704 dev_err(xdev->dev, "failed to register the dma device\n"); in xilinx_dpdma_probe()
1708 ret = of_dma_controller_register(xdev->dev->of_node, in xilinx_dpdma_probe()
1711 dev_err(xdev->dev, "failed to register DMA to DT DMA helper\n"); in xilinx_dpdma_probe()
1715 xilinx_dpdma_enable_irq(xdev); in xilinx_dpdma_probe()
1717 xilinx_dpdma_debugfs_init(xdev); in xilinx_dpdma_probe()
1726 clk_disable_unprepare(xdev->axi_clk); in xilinx_dpdma_probe()
1728 for (i = 0; i < ARRAY_SIZE(xdev->chan); i++) in xilinx_dpdma_probe()
1729 xilinx_dpdma_chan_remove(xdev->chan[i]); in xilinx_dpdma_probe()
1731 free_irq(xdev->irq, xdev); in xilinx_dpdma_probe()
1738 struct xilinx_dpdma_device *xdev = platform_get_drvdata(pdev); in xilinx_dpdma_remove() local
1742 free_irq(xdev->irq, xdev); in xilinx_dpdma_remove()
1744 xilinx_dpdma_disable_irq(xdev); in xilinx_dpdma_remove()
1746 dma_async_device_unregister(&xdev->common); in xilinx_dpdma_remove()
1747 clk_disable_unprepare(xdev->axi_clk); in xilinx_dpdma_remove()
1749 for (i = 0; i < ARRAY_SIZE(xdev->chan); i++) in xilinx_dpdma_remove()
1750 xilinx_dpdma_chan_remove(xdev->chan[i]); in xilinx_dpdma_remove()