Lines Matching defs:zdev

194  * @zdev: Driver specific device structure
218 struct zynqmp_dma_device *zdev;
864 devm_free_irq(chan->zdev->dev, chan->irq, chan);
871 * @zdev: Driver specific device structure
876 static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev,
884 chan = devm_kzalloc(zdev->dev, sizeof(*chan), GFP_KERNEL);
887 chan->dev = zdev->dev;
888 chan->zdev = zdev;
906 dev_err(zdev->dev, "invalid bus-width value");
911 zdev->chan = chan;
920 chan->common.device = &zdev->common;
921 list_add_tail(&chan->common.device_node, &zdev->common.channels);
947 struct zynqmp_dma_device *zdev = ofdma->of_dma_data;
949 return dma_get_slave_channel(&zdev->chan->common);
991 struct zynqmp_dma_device *zdev = dev_get_drvdata(dev);
993 clk_disable_unprepare(zdev->clk_main);
994 clk_disable_unprepare(zdev->clk_apb);
1008 struct zynqmp_dma_device *zdev = dev_get_drvdata(dev);
1011 err = clk_prepare_enable(zdev->clk_main);
1017 err = clk_prepare_enable(zdev->clk_apb);
1020 clk_disable_unprepare(zdev->clk_main);
1041 struct zynqmp_dma_device *zdev;
1045 zdev = devm_kzalloc(&pdev->dev, sizeof(*zdev), GFP_KERNEL);
1046 if (!zdev)
1049 zdev->dev = &pdev->dev;
1050 INIT_LIST_HEAD(&zdev->common.channels);
1053 dma_cap_set(DMA_MEMCPY, zdev->common.cap_mask);
1055 p = &zdev->common;
1065 zdev->clk_main = devm_clk_get(&pdev->dev, "clk_main");
1066 if (IS_ERR(zdev->clk_main)) {
1068 return PTR_ERR(zdev->clk_main);
1071 zdev->clk_apb = devm_clk_get(&pdev->dev, "clk_apb");
1072 if (IS_ERR(zdev->clk_apb)) {
1074 return PTR_ERR(zdev->clk_apb);
1077 platform_set_drvdata(pdev, zdev);
1078 pm_runtime_set_autosuspend_delay(zdev->dev, ZDMA_PM_TIMEOUT);
1079 pm_runtime_use_autosuspend(zdev->dev);
1080 pm_runtime_enable(zdev->dev);
1081 pm_runtime_get_sync(zdev->dev);
1082 if (!pm_runtime_enabled(zdev->dev)) {
1083 ret = zynqmp_dma_runtime_resume(zdev->dev);
1088 ret = zynqmp_dma_chan_probe(zdev, pdev);
1094 p->dst_addr_widths = BIT(zdev->chan->bus_width / 8);
1095 p->src_addr_widths = BIT(zdev->chan->bus_width / 8);
1097 dma_async_device_register(&zdev->common);
1100 of_zynqmp_dma_xlate, zdev);
1103 dma_async_device_unregister(&zdev->common);
1107 pm_runtime_mark_last_busy(zdev->dev);
1108 pm_runtime_put_sync_autosuspend(zdev->dev);
1115 zynqmp_dma_chan_remove(zdev->chan);
1117 if (!pm_runtime_enabled(zdev->dev))
1118 zynqmp_dma_runtime_suspend(zdev->dev);
1119 pm_runtime_disable(zdev->dev);
1131 struct zynqmp_dma_device *zdev = platform_get_drvdata(pdev);
1134 dma_async_device_unregister(&zdev->common);
1136 zynqmp_dma_chan_remove(zdev->chan);
1137 pm_runtime_disable(zdev->dev);
1138 if (!pm_runtime_enabled(zdev->dev))
1139 zynqmp_dma_runtime_suspend(zdev->dev);