Lines Matching refs:zdev

192  * @zdev: Driver specific device structure
216 struct zynqmp_dma_device *zdev;
878 devm_free_irq(chan->zdev->dev, chan->irq, chan);
885 * @zdev: Driver specific device structure
890 static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev,
897 chan = devm_kzalloc(zdev->dev, sizeof(*chan), GFP_KERNEL);
900 chan->dev = zdev->dev;
901 chan->zdev = zdev;
918 dev_err(zdev->dev, "invalid bus-width value");
923 zdev->chan = chan;
932 chan->common.device = &zdev->common;
933 list_add_tail(&chan->common.device_node, &zdev->common.channels);
959 struct zynqmp_dma_device *zdev = ofdma->of_dma_data;
961 return dma_get_slave_channel(&zdev->chan->common);
1003 struct zynqmp_dma_device *zdev = dev_get_drvdata(dev);
1005 clk_disable_unprepare(zdev->clk_main);
1006 clk_disable_unprepare(zdev->clk_apb);
1020 struct zynqmp_dma_device *zdev = dev_get_drvdata(dev);
1023 err = clk_prepare_enable(zdev->clk_main);
1029 err = clk_prepare_enable(zdev->clk_apb);
1032 clk_disable_unprepare(zdev->clk_main);
1053 struct zynqmp_dma_device *zdev;
1057 zdev = devm_kzalloc(&pdev->dev, sizeof(*zdev), GFP_KERNEL);
1058 if (!zdev)
1061 zdev->dev = &pdev->dev;
1062 INIT_LIST_HEAD(&zdev->common.channels);
1069 dma_cap_set(DMA_MEMCPY, zdev->common.cap_mask);
1071 p = &zdev->common;
1082 zdev->clk_main = devm_clk_get(&pdev->dev, "clk_main");
1083 if (IS_ERR(zdev->clk_main))
1084 return dev_err_probe(&pdev->dev, PTR_ERR(zdev->clk_main),
1087 zdev->clk_apb = devm_clk_get(&pdev->dev, "clk_apb");
1088 if (IS_ERR(zdev->clk_apb))
1089 return dev_err_probe(&pdev->dev, PTR_ERR(zdev->clk_apb),
1092 platform_set_drvdata(pdev, zdev);
1093 pm_runtime_set_autosuspend_delay(zdev->dev, ZDMA_PM_TIMEOUT);
1094 pm_runtime_use_autosuspend(zdev->dev);
1095 pm_runtime_enable(zdev->dev);
1096 ret = pm_runtime_resume_and_get(zdev->dev);
1099 pm_runtime_disable(zdev->dev);
1101 if (!pm_runtime_enabled(zdev->dev)) {
1102 ret = zynqmp_dma_runtime_resume(zdev->dev);
1107 ret = zynqmp_dma_chan_probe(zdev, pdev);
1113 p->dst_addr_widths = BIT(zdev->chan->bus_width / 8);
1114 p->src_addr_widths = BIT(zdev->chan->bus_width / 8);
1116 ret = dma_async_device_register(&zdev->common);
1118 dev_err(zdev->dev, "failed to register the dma device\n");
1123 of_zynqmp_dma_xlate, zdev);
1126 dma_async_device_unregister(&zdev->common);
1130 pm_runtime_mark_last_busy(zdev->dev);
1131 pm_runtime_put_sync_autosuspend(zdev->dev);
1136 zynqmp_dma_chan_remove(zdev->chan);
1138 if (!pm_runtime_enabled(zdev->dev))
1139 zynqmp_dma_runtime_suspend(zdev->dev);
1140 pm_runtime_disable(zdev->dev);
1152 struct zynqmp_dma_device *zdev = platform_get_drvdata(pdev);
1155 dma_async_device_unregister(&zdev->common);
1157 zynqmp_dma_chan_remove(zdev->chan);
1158 pm_runtime_disable(zdev->dev);
1159 if (!pm_runtime_enabled(zdev->dev))
1160 zynqmp_dma_runtime_suspend(zdev->dev);