Lines Matching refs:s3cdma
261 struct s3c24xx_dma_engine *s3cdma = s3cchan->host; in s3c24xx_dma_phy_valid() local
262 const struct s3c24xx_dma_platdata *pdata = s3cdma->pdata; in s3c24xx_dma_phy_valid()
271 if (s3cdma->sdata->has_reqsel) in s3c24xx_dma_phy_valid()
288 struct s3c24xx_dma_engine *s3cdma = s3cchan->host; in s3c24xx_dma_get_phy() local
294 for (i = 0; i < s3cdma->pdata->num_phy_channels; i++) { in s3c24xx_dma_get_phy()
295 phy = &s3cdma->phy_chans[i]; in s3c24xx_dma_get_phy()
315 if (i == s3cdma->pdata->num_phy_channels) { in s3c24xx_dma_get_phy()
316 dev_warn(&s3cdma->pdev->dev, "no phy channel available\n"); in s3c24xx_dma_get_phy()
321 if (s3cdma->sdata->has_clocks) { in s3c24xx_dma_get_phy()
324 dev_err(&s3cdma->pdev->dev, "could not enable clock for channel %d, err %d\n", in s3c24xx_dma_get_phy()
341 struct s3c24xx_dma_engine *s3cdma = phy->host; in s3c24xx_dma_put_phy() local
343 if (s3cdma->sdata->has_clocks) in s3c24xx_dma_put_phy()
442 struct s3c24xx_dma_engine *s3cdma = s3cchan->host; in s3c24xx_dma_start_next_sg() local
444 const struct s3c24xx_dma_platdata *pdata = s3cdma->pdata; in s3c24xx_dma_start_next_sg()
466 if (s3cdma->sdata->has_reqsel) { in s3c24xx_dma_start_next_sg()
479 if (s3cdma->sdata->has_reqsel) in s3c24xx_dma_start_next_sg()
529 struct s3c24xx_dma_engine *s3cdma = s3cchan->host; in s3c24xx_dma_phy_alloc_and_start() local
534 dev_dbg(&s3cdma->pdev->dev, "no physical channel available for xfer on %s\n", in s3c24xx_dma_phy_alloc_and_start()
540 dev_dbg(&s3cdma->pdev->dev, "allocated physical channel %d for xfer on %s\n", in s3c24xx_dma_phy_alloc_and_start()
552 struct s3c24xx_dma_engine *s3cdma = s3cchan->host; in s3c24xx_dma_phy_reassign_start() local
554 dev_dbg(&s3cdma->pdev->dev, "reassigned physical channel %d for xfer on %s\n", in s3c24xx_dma_phy_reassign_start()
574 struct s3c24xx_dma_engine *s3cdma = s3cchan->host; in s3c24xx_dma_phy_free() local
581 list_for_each_entry(p, &s3cdma->memcpy.channels, vc.chan.device_node) in s3c24xx_dma_phy_free()
588 list_for_each_entry(p, &s3cdma->slave.channels, in s3c24xx_dma_phy_free()
702 struct s3c24xx_dma_engine *s3cdma = s3cchan->host; in s3c24xx_dma_terminate_all() local
710 dev_err(&s3cdma->pdev->dev, "trying to terminate already stopped channel %d\n", in s3c24xx_dma_terminate_all()
820 struct s3c24xx_dma_engine *s3cdma = s3cchan->host; in s3c24xx_dma_prep_memcpy() local
825 dev_dbg(&s3cdma->pdev->dev, "prepare memcpy of %zu bytes from %s\n", in s3c24xx_dma_prep_memcpy()
829 dev_err(&s3cdma->pdev->dev, "memcpy size %zu to large\n", len); in s3c24xx_dma_prep_memcpy()
882 struct s3c24xx_dma_engine *s3cdma = s3cchan->host; in s3c24xx_dma_prep_dma_cyclic() local
883 const struct s3c24xx_dma_platdata *pdata = s3cdma->pdata; in s3c24xx_dma_prep_dma_cyclic()
892 dev_dbg(&s3cdma->pdev->dev, in s3c24xx_dma_prep_dma_cyclic()
897 dev_err(&s3cdma->pdev->dev, in s3c24xx_dma_prep_dma_cyclic()
980 struct s3c24xx_dma_engine *s3cdma = s3cchan->host; in s3c24xx_dma_prep_slave_sg() local
981 const struct s3c24xx_dma_platdata *pdata = s3cdma->pdata; in s3c24xx_dma_prep_slave_sg()
990 dev_dbg(&s3cdma->pdev->dev, "prepare transaction of %d bytes from %s\n", in s3c24xx_dma_prep_slave_sg()
1037 dev_err(&s3cdma->pdev->dev, in s3c24xx_dma_prep_slave_sg()
1088 static int s3c24xx_dma_init_virtual_channels(struct s3c24xx_dma_engine *s3cdma, in s3c24xx_dma_init_virtual_channels() argument
1107 chan->host = s3cdma; in s3c24xx_dma_init_virtual_channels()
1188 struct s3c24xx_dma_engine *s3cdma; in s3c24xx_dma_probe() local
1210 s3cdma = devm_kzalloc(&pdev->dev, sizeof(*s3cdma), GFP_KERNEL); in s3c24xx_dma_probe()
1211 if (!s3cdma) in s3c24xx_dma_probe()
1214 s3cdma->pdev = pdev; in s3c24xx_dma_probe()
1215 s3cdma->pdata = pdata; in s3c24xx_dma_probe()
1216 s3cdma->sdata = sdata; in s3c24xx_dma_probe()
1219 s3cdma->base = devm_ioremap_resource(&pdev->dev, res); in s3c24xx_dma_probe()
1220 if (IS_ERR(s3cdma->base)) in s3c24xx_dma_probe()
1221 return PTR_ERR(s3cdma->base); in s3c24xx_dma_probe()
1223 s3cdma->phy_chans = devm_kcalloc(&pdev->dev, in s3c24xx_dma_probe()
1227 if (!s3cdma->phy_chans) in s3c24xx_dma_probe()
1232 struct s3c24xx_dma_phy *phy = &s3cdma->phy_chans[i]; in s3c24xx_dma_probe()
1236 phy->base = s3cdma->base + (i * sdata->stride); in s3c24xx_dma_probe()
1237 phy->host = s3cdma; in s3c24xx_dma_probe()
1276 dma_cap_set(DMA_MEMCPY, s3cdma->memcpy.cap_mask); in s3c24xx_dma_probe()
1277 dma_cap_set(DMA_PRIVATE, s3cdma->memcpy.cap_mask); in s3c24xx_dma_probe()
1278 s3cdma->memcpy.dev = &pdev->dev; in s3c24xx_dma_probe()
1279 s3cdma->memcpy.device_free_chan_resources = in s3c24xx_dma_probe()
1281 s3cdma->memcpy.device_prep_dma_memcpy = s3c24xx_dma_prep_memcpy; in s3c24xx_dma_probe()
1282 s3cdma->memcpy.device_tx_status = s3c24xx_dma_tx_status; in s3c24xx_dma_probe()
1283 s3cdma->memcpy.device_issue_pending = s3c24xx_dma_issue_pending; in s3c24xx_dma_probe()
1284 s3cdma->memcpy.device_config = s3c24xx_dma_set_runtime_config; in s3c24xx_dma_probe()
1285 s3cdma->memcpy.device_terminate_all = s3c24xx_dma_terminate_all; in s3c24xx_dma_probe()
1286 s3cdma->memcpy.device_synchronize = s3c24xx_dma_synchronize; in s3c24xx_dma_probe()
1289 dma_cap_set(DMA_SLAVE, s3cdma->slave.cap_mask); in s3c24xx_dma_probe()
1290 dma_cap_set(DMA_CYCLIC, s3cdma->slave.cap_mask); in s3c24xx_dma_probe()
1291 dma_cap_set(DMA_PRIVATE, s3cdma->slave.cap_mask); in s3c24xx_dma_probe()
1292 s3cdma->slave.dev = &pdev->dev; in s3c24xx_dma_probe()
1293 s3cdma->slave.device_free_chan_resources = in s3c24xx_dma_probe()
1295 s3cdma->slave.device_tx_status = s3c24xx_dma_tx_status; in s3c24xx_dma_probe()
1296 s3cdma->slave.device_issue_pending = s3c24xx_dma_issue_pending; in s3c24xx_dma_probe()
1297 s3cdma->slave.device_prep_slave_sg = s3c24xx_dma_prep_slave_sg; in s3c24xx_dma_probe()
1298 s3cdma->slave.device_prep_dma_cyclic = s3c24xx_dma_prep_dma_cyclic; in s3c24xx_dma_probe()
1299 s3cdma->slave.device_config = s3c24xx_dma_set_runtime_config; in s3c24xx_dma_probe()
1300 s3cdma->slave.device_terminate_all = s3c24xx_dma_terminate_all; in s3c24xx_dma_probe()
1301 s3cdma->slave.device_synchronize = s3c24xx_dma_synchronize; in s3c24xx_dma_probe()
1302 s3cdma->slave.filter.map = pdata->slave_map; in s3c24xx_dma_probe()
1303 s3cdma->slave.filter.mapcnt = pdata->slavecnt; in s3c24xx_dma_probe()
1304 s3cdma->slave.filter.fn = s3c24xx_dma_filter; in s3c24xx_dma_probe()
1307 ret = s3c24xx_dma_init_virtual_channels(s3cdma, &s3cdma->memcpy, in s3c24xx_dma_probe()
1317 ret = s3c24xx_dma_init_virtual_channels(s3cdma, &s3cdma->slave, in s3c24xx_dma_probe()
1326 ret = dma_async_device_register(&s3cdma->memcpy); in s3c24xx_dma_probe()
1334 ret = dma_async_device_register(&s3cdma->slave); in s3c24xx_dma_probe()
1342 platform_set_drvdata(pdev, s3cdma); in s3c24xx_dma_probe()
1349 dma_async_device_unregister(&s3cdma->memcpy); in s3c24xx_dma_probe()
1351 s3c24xx_dma_free_virtual_channels(&s3cdma->slave); in s3c24xx_dma_probe()
1353 s3c24xx_dma_free_virtual_channels(&s3cdma->memcpy); in s3c24xx_dma_probe()
1357 struct s3c24xx_dma_phy *phy = &s3cdma->phy_chans[i]; in s3c24xx_dma_probe()
1366 struct s3c24xx_dma_engine *s3cdma) in s3c24xx_dma_free_irq() argument
1370 for (i = 0; i < s3cdma->pdata->num_phy_channels; i++) { in s3c24xx_dma_free_irq()
1371 struct s3c24xx_dma_phy *phy = &s3cdma->phy_chans[i]; in s3c24xx_dma_free_irq()
1380 struct s3c24xx_dma_engine *s3cdma = platform_get_drvdata(pdev); in s3c24xx_dma_remove() local
1384 dma_async_device_unregister(&s3cdma->slave); in s3c24xx_dma_remove()
1385 dma_async_device_unregister(&s3cdma->memcpy); in s3c24xx_dma_remove()
1387 s3c24xx_dma_free_irq(pdev, s3cdma); in s3c24xx_dma_remove()
1389 s3c24xx_dma_free_virtual_channels(&s3cdma->slave); in s3c24xx_dma_remove()
1390 s3c24xx_dma_free_virtual_channels(&s3cdma->memcpy); in s3c24xx_dma_remove()
1394 struct s3c24xx_dma_phy *phy = &s3cdma->phy_chans[i]; in s3c24xx_dma_remove()