Lines Matching full:tdma
238 struct tegra_dma *tdma; member
264 writel_relaxed(val, tdc->tdma->base_addr + tdc->chan_base_offset + reg); in tdc_write()
269 return readl_relaxed(tdc->tdma->base_addr + tdc->chan_base_offset + reg); in tdc_read()
312 struct tegra_dma *tdma = tdc->tdma; in tegra_dma_sid_reserve() local
320 if (test_and_set_bit(sid, &tdma->sid_m2d_reserved)) { in tegra_dma_sid_reserve()
321 dev_err(tdma->dev, "slave id already in use\n"); in tegra_dma_sid_reserve()
326 if (test_and_set_bit(sid, &tdma->sid_d2m_reserved)) { in tegra_dma_sid_reserve()
327 dev_err(tdma->dev, "slave id already in use\n"); in tegra_dma_sid_reserve()
342 struct tegra_dma *tdma = tdc->tdma; in tegra_dma_sid_free() local
347 clear_bit(sid, &tdma->sid_m2d_reserved); in tegra_dma_sid_free()
350 clear_bit(sid, &tdma->sid_d2m_reserved); in tegra_dma_sid_free()
385 ret = readl_relaxed_poll_timeout_atomic(tdc->tdma->base_addr + in tegra_dma_pause()
408 if (!tdc->tdma->chip_data->hw_support_pause) in tegra_dma_device_pause()
434 if (!tdc->tdma->chip_data->hw_support_pause) in tegra_dma_device_resume()
490 ret = readl_relaxed_poll_timeout_atomic(tdc->tdma->base_addr + in tegra_dma_configure_next_sg()
560 dev_err(tdc->tdma->dev, in tegra_dma_chan_decode_error()
565 dev_err(tdc->tdma->dev, in tegra_dma_chan_decode_error()
570 dev_err(tdc->tdma->dev, in tegra_dma_chan_decode_error()
575 dev_err(tdc->tdma->dev, in tegra_dma_chan_decode_error()
580 dev_err(tdc->tdma->dev, in tegra_dma_chan_decode_error()
585 dev_err(tdc->tdma->dev, in tegra_dma_chan_decode_error()
590 dev_err(tdc->tdma->dev, in tegra_dma_chan_decode_error()
688 ret = readl_relaxed_poll_timeout_atomic(tdc->tdma->base_addr + in tegra_dma_stop_client()
714 err = tdc->tdma->chip_data->terminate(tdc); in tegra_dma_terminate_all()
873 unsigned int max_dma_count = tdc->tdma->chip_data->max_dma_count; in tegra_dma_prep_dma_memset()
945 max_dma_count = tdc->tdma->chip_data->max_dma_count; in tegra_dma_prep_dma_memcpy()
1011 unsigned int max_dma_count = tdc->tdma->chip_data->max_dma_count; in tegra_dma_prep_slave_sg()
1163 max_dma_count = tdc->tdma->chip_data->max_dma_count; in tegra_dma_prep_dma_cyclic()
1294 struct tegra_dma *tdma = ofdma->of_dma_data; in tegra_dma_of_xlate() local
1298 chan = dma_get_any_slave_channel(&tdma->dma_dev); in tegra_dma_of_xlate()
1366 struct tegra_dma *tdma; in tegra_dma_probe() local
1371 tdma = devm_kzalloc(&pdev->dev, in tegra_dma_probe()
1372 struct_size(tdma, channels, cdata->nr_channels), in tegra_dma_probe()
1374 if (!tdma) in tegra_dma_probe()
1377 tdma->dev = &pdev->dev; in tegra_dma_probe()
1378 tdma->chip_data = cdata; in tegra_dma_probe()
1379 platform_set_drvdata(pdev, tdma); in tegra_dma_probe()
1381 tdma->base_addr = devm_platform_ioremap_resource(pdev, 0); in tegra_dma_probe()
1382 if (IS_ERR(tdma->base_addr)) in tegra_dma_probe()
1383 return PTR_ERR(tdma->base_addr); in tegra_dma_probe()
1385 tdma->rst = devm_reset_control_get_exclusive(&pdev->dev, "gpcdma"); in tegra_dma_probe()
1386 if (IS_ERR(tdma->rst)) { in tegra_dma_probe()
1387 return dev_err_probe(&pdev->dev, PTR_ERR(tdma->rst), in tegra_dma_probe()
1390 reset_control_reset(tdma->rst); in tegra_dma_probe()
1392 tdma->dma_dev.dev = &pdev->dev; in tegra_dma_probe()
1400 &tdma->chan_mask); in tegra_dma_probe()
1405 tdma->chan_mask = TEGRA_GPCDMA_DEFAULT_CHANNEL_MASK; in tegra_dma_probe()
1408 INIT_LIST_HEAD(&tdma->dma_dev.channels); in tegra_dma_probe()
1410 struct tegra_dma_channel *tdc = &tdma->channels[i]; in tegra_dma_probe()
1413 if (!(tdma->chan_mask & BIT(i))) in tegra_dma_probe()
1423 tdc->tdma = tdma; in tegra_dma_probe()
1427 vchan_init(&tdc->vc, &tdma->dma_dev); in tegra_dma_probe()
1435 dma_cap_set(DMA_SLAVE, tdma->dma_dev.cap_mask); in tegra_dma_probe()
1436 dma_cap_set(DMA_PRIVATE, tdma->dma_dev.cap_mask); in tegra_dma_probe()
1437 dma_cap_set(DMA_MEMCPY, tdma->dma_dev.cap_mask); in tegra_dma_probe()
1438 dma_cap_set(DMA_MEMSET, tdma->dma_dev.cap_mask); in tegra_dma_probe()
1439 dma_cap_set(DMA_CYCLIC, tdma->dma_dev.cap_mask); in tegra_dma_probe()
1445 tdma->dma_dev.copy_align = 2; in tegra_dma_probe()
1446 tdma->dma_dev.fill_align = 2; in tegra_dma_probe()
1447 tdma->dma_dev.device_alloc_chan_resources = in tegra_dma_probe()
1449 tdma->dma_dev.device_free_chan_resources = in tegra_dma_probe()
1451 tdma->dma_dev.device_prep_slave_sg = tegra_dma_prep_slave_sg; in tegra_dma_probe()
1452 tdma->dma_dev.device_prep_dma_memcpy = tegra_dma_prep_dma_memcpy; in tegra_dma_probe()
1453 tdma->dma_dev.device_prep_dma_memset = tegra_dma_prep_dma_memset; in tegra_dma_probe()
1454 tdma->dma_dev.device_prep_dma_cyclic = tegra_dma_prep_dma_cyclic; in tegra_dma_probe()
1455 tdma->dma_dev.device_config = tegra_dma_slave_config; in tegra_dma_probe()
1456 tdma->dma_dev.device_terminate_all = tegra_dma_terminate_all; in tegra_dma_probe()
1457 tdma->dma_dev.device_tx_status = tegra_dma_tx_status; in tegra_dma_probe()
1458 tdma->dma_dev.device_issue_pending = tegra_dma_issue_pending; in tegra_dma_probe()
1459 tdma->dma_dev.device_pause = tegra_dma_device_pause; in tegra_dma_probe()
1460 tdma->dma_dev.device_resume = tegra_dma_device_resume; in tegra_dma_probe()
1461 tdma->dma_dev.device_synchronize = tegra_dma_chan_synchronize; in tegra_dma_probe()
1462 tdma->dma_dev.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; in tegra_dma_probe()
1464 ret = dma_async_device_register(&tdma->dma_dev); in tegra_dma_probe()
1472 tegra_dma_of_xlate, tdma); in tegra_dma_probe()
1477 dma_async_device_unregister(&tdma->dma_dev); in tegra_dma_probe()
1482 hweight_long(tdma->chan_mask)); in tegra_dma_probe()
1489 struct tegra_dma *tdma = platform_get_drvdata(pdev); in tegra_dma_remove() local
1492 dma_async_device_unregister(&tdma->dma_dev); in tegra_dma_remove()
1497 struct tegra_dma *tdma = dev_get_drvdata(dev); in tegra_dma_pm_suspend() local
1500 for (i = 0; i < tdma->chip_data->nr_channels; i++) { in tegra_dma_pm_suspend()
1501 struct tegra_dma_channel *tdc = &tdma->channels[i]; in tegra_dma_pm_suspend()
1503 if (!(tdma->chan_mask & BIT(i))) in tegra_dma_pm_suspend()
1507 dev_err(tdma->dev, "channel %u busy\n", i); in tegra_dma_pm_suspend()
1517 struct tegra_dma *tdma = dev_get_drvdata(dev); in tegra_dma_pm_resume() local
1520 reset_control_reset(tdma->rst); in tegra_dma_pm_resume()
1522 for (i = 0; i < tdma->chip_data->nr_channels; i++) { in tegra_dma_pm_resume()
1523 struct tegra_dma_channel *tdc = &tdma->channels[i]; in tegra_dma_pm_resume()
1525 if (!(tdma->chan_mask & BIT(i))) in tegra_dma_pm_resume()