Lines Matching refs:fdev
1005 struct fsldma_device *fdev = data; in fsldma_ctrl_irq() local
1011 gsr = (fdev->feature & FSL_DMA_BIG_ENDIAN) ? in_be32(fdev->regs) in fsldma_ctrl_irq()
1012 : in_le32(fdev->regs); in fsldma_ctrl_irq()
1014 dev_dbg(fdev->dev, "IRQ: gsr 0x%.8x\n", gsr); in fsldma_ctrl_irq()
1017 chan = fdev->chan[i]; in fsldma_ctrl_irq()
1022 dev_dbg(fdev->dev, "IRQ: chan %d\n", chan->id); in fsldma_ctrl_irq()
1034 static void fsldma_free_irqs(struct fsldma_device *fdev) in fsldma_free_irqs() argument
1039 if (fdev->irq) { in fsldma_free_irqs()
1040 dev_dbg(fdev->dev, "free per-controller IRQ\n"); in fsldma_free_irqs()
1041 free_irq(fdev->irq, fdev); in fsldma_free_irqs()
1046 chan = fdev->chan[i]; in fsldma_free_irqs()
1054 static int fsldma_request_irqs(struct fsldma_device *fdev) in fsldma_request_irqs() argument
1061 if (fdev->irq) { in fsldma_request_irqs()
1062 dev_dbg(fdev->dev, "request per-controller IRQ\n"); in fsldma_request_irqs()
1063 ret = request_irq(fdev->irq, fsldma_ctrl_irq, IRQF_SHARED, in fsldma_request_irqs()
1064 "fsldma-controller", fdev); in fsldma_request_irqs()
1070 chan = fdev->chan[i]; in fsldma_request_irqs()
1093 chan = fdev->chan[i]; in fsldma_request_irqs()
1110 static int fsl_dma_chan_probe(struct fsldma_device *fdev, in fsl_dma_chan_probe() argument
1127 dev_err(fdev->dev, "unable to ioremap registers\n"); in fsl_dma_chan_probe()
1134 dev_err(fdev->dev, "unable to find 'reg' property\n"); in fsl_dma_chan_probe()
1139 if (!fdev->feature) in fsl_dma_chan_probe()
1140 fdev->feature = chan->feature; in fsl_dma_chan_probe()
1146 WARN_ON(fdev->feature != chan->feature); in fsl_dma_chan_probe()
1148 chan->dev = fdev->dev; in fsl_dma_chan_probe()
1153 dev_err(fdev->dev, "too many channels for device\n"); in fsl_dma_chan_probe()
1158 fdev->chan[chan->id] = chan; in fsl_dma_chan_probe()
1187 chan->common.device = &fdev->common; in fsl_dma_chan_probe()
1194 list_add_tail(&chan->common.device_node, &fdev->common.channels); in fsl_dma_chan_probe()
1196 dev_info(fdev->dev, "#%d (%s), irq %d\n", chan->id, compatible, in fsl_dma_chan_probe()
1197 chan->irq ? chan->irq : fdev->irq); in fsl_dma_chan_probe()
1219 struct fsldma_device *fdev; in fsldma_of_probe() local
1223 fdev = kzalloc(sizeof(*fdev), GFP_KERNEL); in fsldma_of_probe()
1224 if (!fdev) { in fsldma_of_probe()
1229 fdev->dev = &op->dev; in fsldma_of_probe()
1230 INIT_LIST_HEAD(&fdev->common.channels); in fsldma_of_probe()
1233 fdev->regs = of_iomap(op->dev.of_node, 0); in fsldma_of_probe()
1234 if (!fdev->regs) { in fsldma_of_probe()
1241 fdev->irq = irq_of_parse_and_map(op->dev.of_node, 0); in fsldma_of_probe()
1243 dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask); in fsldma_of_probe()
1244 dma_cap_set(DMA_SLAVE, fdev->common.cap_mask); in fsldma_of_probe()
1245 fdev->common.device_alloc_chan_resources = fsl_dma_alloc_chan_resources; in fsldma_of_probe()
1246 fdev->common.device_free_chan_resources = fsl_dma_free_chan_resources; in fsldma_of_probe()
1247 fdev->common.device_prep_dma_memcpy = fsl_dma_prep_memcpy; in fsldma_of_probe()
1248 fdev->common.device_tx_status = fsl_tx_status; in fsldma_of_probe()
1249 fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending; in fsldma_of_probe()
1250 fdev->common.device_config = fsl_dma_device_config; in fsldma_of_probe()
1251 fdev->common.device_terminate_all = fsl_dma_device_terminate_all; in fsldma_of_probe()
1252 fdev->common.dev = &op->dev; in fsldma_of_probe()
1254 fdev->common.src_addr_widths = FSL_DMA_BUSWIDTHS; in fsldma_of_probe()
1255 fdev->common.dst_addr_widths = FSL_DMA_BUSWIDTHS; in fsldma_of_probe()
1256 fdev->common.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); in fsldma_of_probe()
1257 fdev->common.residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR; in fsldma_of_probe()
1261 platform_set_drvdata(op, fdev); in fsldma_of_probe()
1270 fsl_dma_chan_probe(fdev, child, in fsldma_of_probe()
1276 fsl_dma_chan_probe(fdev, child, in fsldma_of_probe()
1289 err = fsldma_request_irqs(fdev); in fsldma_of_probe()
1291 dev_err(fdev->dev, "unable to request IRQs\n"); in fsldma_of_probe()
1295 dma_async_device_register(&fdev->common); in fsldma_of_probe()
1299 irq_dispose_mapping(fdev->irq); in fsldma_of_probe()
1300 iounmap(fdev->regs); in fsldma_of_probe()
1302 kfree(fdev); in fsldma_of_probe()
1309 struct fsldma_device *fdev; in fsldma_of_remove() local
1312 fdev = platform_get_drvdata(op); in fsldma_of_remove()
1313 dma_async_device_unregister(&fdev->common); in fsldma_of_remove()
1315 fsldma_free_irqs(fdev); in fsldma_of_remove()
1318 if (fdev->chan[i]) in fsldma_of_remove()
1319 fsl_dma_chan_remove(fdev->chan[i]); in fsldma_of_remove()
1322 iounmap(fdev->regs); in fsldma_of_remove()
1323 kfree(fdev); in fsldma_of_remove()
1331 struct fsldma_device *fdev = dev_get_drvdata(dev); in fsldma_suspend_late() local
1336 chan = fdev->chan[i]; in fsldma_suspend_late()
1351 chan = fdev->chan[i]; in fsldma_suspend_late()
1362 struct fsldma_device *fdev = dev_get_drvdata(dev); in fsldma_resume_early() local
1368 chan = fdev->chan[i]; in fsldma_resume_early()