Lines Matching defs:dev
170 struct device *dev;
425 struct device *chan_dev = &chan->dev->device;
429 chan->dev->chan_dma_dev = false;
434 chan->dev->chan_dma_dev = true;
440 dev_warn(chan->device->dev, "Invalid ASEL value: %u\n", asel);
470 struct device *dev = uc->ud->dev;
475 dev_dbg(dev, "TCHAN State data:\n");
478 dev_dbg(dev, "TRT_STDATA[%02d]: 0x%08x\n", i,
484 dev_dbg(dev, "RCHAN State data:\n");
487 dev_dbg(dev, "RRT_STDATA[%02d]: 0x%08x\n", i,
1180 dev_err(uc->ud->dev, "not matching descriptors!\n");
1318 dev_dbg(ud->dev, "get rflow%d\n", id);
1326 dev_err(ud->dev, "attempt to put unused rflow%d\n", rflow->id);
1330 dev_dbg(ud->dev, "put rflow%d\n", rflow->id);
1341 dev_err(ud->dev, "res##%d is in use\n", id); \
1374 dev_dbg(ud->dev, "chan%d: already have bchan%d allocated\n",
1406 dev_dbg(ud->dev, "chan%d: already have tchan%d allocated\n",
1434 dev_err(ud->dev, "tflow%d is in use\n", tflow_id);
1455 dev_dbg(ud->dev, "chan%d: already have rchan%d allocated\n",
1482 dev_info(ud->dev, "chan%d: already have %d pair allocated\n",
1488 dev_err(ud->dev, "chan%d: already have tchan%d allocated\n",
1492 dev_err(ud->dev, "chan%d: already have rchan%d allocated\n",
1530 dev_err(ud->dev, "chan%d: does not have rchan??\n", uc->id);
1535 dev_dbg(ud->dev, "chan%d: already have rflow%d allocated\n",
1555 dev_dbg(ud->dev, "chan%d: put bchan%d\n", uc->id,
1568 dev_dbg(ud->dev, "chan%d: put rchan%d\n", uc->id,
1580 dev_dbg(ud->dev, "chan%d: put tchan%d\n", uc->id,
1596 dev_dbg(ud->dev, "chan%d: put rflow%d\n", uc->id,
1901 dev_err(ud->dev, "tchan%d cfg failed %d\n", tchan->id, ret);
1919 dev_err(ud->dev, "rchan%d alloc failed %d\n", rchan->id, ret);
1952 dev_err(ud->dev, "bchan%d cfg failed %d\n", bchan->id, ret);
1995 dev_err(ud->dev, "tchan%d cfg failed %d\n", tchan->id, ret);
2022 dev_err(ud->dev, "tchan%d cfg failed %d\n", tchan->id, ret);
2061 dev_err(ud->dev, "rchan%d cfg failed %d\n", rchan->id, ret);
2105 dev_err(ud->dev, "flow%d config failed: %d\n", rchan->id, ret);
2125 dev_err(ud->dev, "rchan%d cfg failed %d\n", rchan->id, ret);
2145 dev_err(ud->dev, "rchan%d cfg failed %d\n", uc->rchan->id, ret);
2170 dev_err(ud->dev, "flow%d config failed: %d\n", uc->rflow->id,
2185 uc->dma_dev = ud->dev;
2198 uc->hdesc_pool = dma_pool_create(uc->name, ud->ddev.dev,
2203 dev_err(ud->ddev.dev,
2222 dev_dbg(uc->ud->dev, "%s: chan%d as MEM-to-MEM\n", __func__,
2251 /* Slave transfer synchronized - mem to dev (TX) trasnfer */
2252 dev_dbg(uc->ud->dev, "%s: chan%d as MEM-to-DEV\n", __func__,
2269 /* Slave transfer synchronized - dev to mem (RX) trasnfer */
2270 dev_dbg(uc->ud->dev, "%s: chan%d as DEV-to-MEM\n", __func__,
2288 dev_err(uc->ud->dev, "%s: chan%d invalid direction (%u)\n",
2300 dev_warn(ud->dev, "chan%d: is running!\n", uc->id);
2303 dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
2312 dev_err(ud->dev, "PSI-L pairing failed: 0x%04x -> 0x%04x\n",
2321 dev_err(ud->dev, "Failed to get ring irq (index: %u)\n",
2330 dev_err(ud->dev, "chan%d: ring irq request failed\n", uc->id);
2336 uc->irq_num_udma = msi_get_virq(ud->dev, irq_udma_idx);
2338 dev_err(ud->dev, "Failed to get udma irq (index: %u)\n",
2348 dev_err(ud->dev, "chan%d: UDMA irq request failed\n",
2403 dev_dbg(uc->ud->dev, "%s: chan%d as MEM-to-MEM\n", __func__,
2416 /* Slave transfer synchronized - mem to dev (TX) trasnfer */
2417 dev_dbg(uc->ud->dev, "%s: chan%d as MEM-to-DEV\n", __func__,
2436 /* Slave transfer synchronized - dev to mem (RX) trasnfer */
2437 dev_dbg(uc->ud->dev, "%s: chan%d as DEV-to-MEM\n", __func__,
2457 dev_err(uc->ud->dev, "%s: chan%d invalid direction (%u)\n",
2467 dev_warn(ud->dev, "chan%d: is running!\n", uc->id);
2470 dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
2481 uc->hdesc_pool = dma_pool_create(uc->name, ud->ddev.dev,
2486 dev_err(ud->ddev.dev,
2499 dev_err(ud->dev,
2508 uc->irq_num_ring = msi_get_virq(ud->dev, irq_ring_idx);
2510 dev_err(ud->dev, "Failed to get ring irq (index: %u)\n",
2519 dev_err(ud->dev, "chan%d: ring irq request failed\n", uc->id);
2525 uc->irq_num_udma = msi_get_virq(ud->dev, irq_udma_idx);
2527 dev_err(ud->dev, "Failed to get bcdma irq (index: %u)\n",
2537 dev_err(ud->dev, "chan%d: BCDMA irq request failed\n",
2611 /* Slave transfer synchronized - mem to dev (TX) trasnfer */
2612 dev_dbg(uc->ud->dev, "%s: chan%d as MEM-to-DEV\n", __func__,
2630 /* Slave transfer synchronized - dev to mem (RX) trasnfer */
2631 dev_dbg(uc->ud->dev, "%s: chan%d as DEV-to-MEM\n", __func__,
2650 dev_err(uc->ud->dev, "%s: chan%d invalid direction (%u)\n",
2660 dev_warn(ud->dev, "chan%d: is running!\n", uc->id);
2663 dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
2674 dev_err(ud->ddev.dev,
2686 dev_err(ud->dev, "PSI-L pairing failed: 0x%04x -> 0x%04x\n",
2693 uc->irq_num_ring = msi_get_virq(ud->dev, irq_ring_idx);
2695 dev_err(ud->dev, "Failed to get ring irq (index: %u)\n",
2704 dev_err(ud->dev, "chan%d: ring irq request failed\n", uc->id);
2716 dev_dbg(ud->dev,
2721 dev_dbg(ud->dev,
2771 dev_err(uc->ud->dev, "Unsupported TR size of %zu\n", tr_size);
2796 hwdesc->cppi5_desc_vaddr = dma_alloc_coherent(uc->ud->dev,
2918 dev_err(uc->ud->dev, "size %u is not supported\n",
2990 dev_err(uc->ud->dev, "%s: bad direction?\n", __func__);
2999 dev_err(uc->ud->dev,
3017 dev_err(uc->ud->dev,
3054 dev_err(uc->ud->dev, "size %zu is not supported\n",
3251 dev_err(uc->ud->dev,
3289 dev_err(uc->ud->dev,
3409 dev_err(chan->device->dev,
3424 dev_err(chan->device->dev, "%s: bad direction?\n", __func__);
3452 dev_err(uc->ud->dev,
3483 dev_err(uc->ud->dev, "size %zu is not supported\n",
3577 dev_err(uc->ud->dev,
3616 dev_err(chan->device->dev,
3633 dev_err(uc->ud->dev, "%s: bad direction?\n", __func__);
3657 dev_err(uc->ud->dev,
3685 dev_err(chan->device->dev,
3696 dev_err(uc->ud->dev, "size %zu is not supported\n",
3950 dev_warn(uc->ud->dev, "chan%d teardown timeout!\n",
3959 dev_warn(uc->ud->dev, "chan%d refused to stop!\n", uc->id);
4108 if (chan->device->dev->driver != &udma_driver.driver &&
4109 chan->device->dev->driver != &bcdma_driver.driver &&
4110 chan->device->dev->driver != &pktdma_driver.driver)
4119 dev_err(ud->dev, "Invalid channel atype: %u\n",
4125 dev_err(ud->dev, "Invalid channel asel: %u\n",
4146 dev_err(ud->dev, "No configuration for psi-l thread 0x%04x\n",
4157 dev_err(ud->dev,
4200 dev_dbg(ud->dev, "chan%d: Remote thread: 0x%04x (%s)\n", uc->id,
4206 dev_dbg(ud->dev, "chan%d: triggered channel (type: %u)\n", uc->id,
4252 dev_err(ud->dev, "get channel fail in %s.\n", __func__);
4511 dev_dbg(ud->dev, "ti_sci resource range for %s: %d:%d | %d:%d\n", name,
4527 struct device *dev = ud->dev;
4534 if (of_device_is_compatible(dev->of_node,
4538 } else if (of_device_is_compatible(dev->of_node,
4557 ud->tchan_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->tchan_cnt),
4559 ud->tchans = devm_kcalloc(dev, ud->tchan_cnt, sizeof(*ud->tchans),
4561 ud->rchan_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->rchan_cnt),
4563 ud->rchans = devm_kcalloc(dev, ud->rchan_cnt, sizeof(*ud->rchans),
4565 ud->rflow_gp_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->rflow_cnt),
4568 ud->rflow_gp_map_allocated = devm_kcalloc(dev,
4572 ud->rflow_in_use = devm_kcalloc(dev, BITS_TO_LONGS(ud->rflow_cnt),
4575 ud->rflows = devm_kcalloc(dev, ud->rflow_cnt, sizeof(*ud->rflows),
4599 devm_ti_sci_get_of_resource(tisci_rm->tisci, dev,
4664 ret = ti_sci_inta_msi_domain_alloc_irqs(ud->dev, &irq_res);
4667 dev_err(ud->dev, "Failed to allocate MSI interrupts\n");
4689 struct device *dev = ud->dev;
4731 ud->bchan_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->bchan_cnt),
4733 ud->bchans = devm_kcalloc(dev, ud->bchan_cnt, sizeof(*ud->bchans),
4735 ud->tchan_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->tchan_cnt),
4737 ud->tchans = devm_kcalloc(dev, ud->tchan_cnt, sizeof(*ud->tchans),
4739 ud->rchan_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->rchan_cnt),
4741 ud->rchans = devm_kcalloc(dev, ud->rchan_cnt, sizeof(*ud->rchans),
4744 ud->rflow_in_use = devm_kcalloc(dev, BITS_TO_LONGS(ud->rchan_cnt),
4747 ud->rflows = devm_kcalloc(dev, ud->rchan_cnt, sizeof(*ud->rflows),
4767 devm_ti_sci_get_of_resource(tisci_rm->tisci, dev,
4883 ret = ti_sci_inta_msi_domain_alloc_irqs(ud->dev, &irq_res);
4886 dev_err(ud->dev, "Failed to allocate MSI interrupts\n");
4896 struct device *dev = ud->dev;
4919 ud->tchan_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->tchan_cnt),
4921 ud->tchans = devm_kcalloc(dev, ud->tchan_cnt, sizeof(*ud->tchans),
4923 ud->rchan_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->rchan_cnt),
4925 ud->rchans = devm_kcalloc(dev, ud->rchan_cnt, sizeof(*ud->rchans),
4927 ud->rflow_in_use = devm_kcalloc(dev, BITS_TO_LONGS(ud->rflow_cnt),
4930 ud->rflows = devm_kcalloc(dev, ud->rflow_cnt, sizeof(*ud->rflows),
4932 ud->tflow_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->tflow_cnt),
4945 devm_ti_sci_get_of_resource(tisci_rm->tisci, dev,
5026 ret = ti_sci_inta_msi_domain_alloc_irqs(ud->dev, &irq_res);
5029 dev_err(ud->dev, "Failed to allocate MSI interrupts\n");
5038 struct device *dev = ud->dev;
5066 ud->channels = devm_kcalloc(dev, ch_count, sizeof(*ud->channels),
5073 dev_info(dev,
5084 dev_info(dev,
5095 dev_info(dev,
5116 struct device *dev = ud->dev;
5122 rx_flush->buffer_vaddr = devm_kzalloc(dev, rx_flush->buffer_size,
5127 rx_flush->buffer_paddr = dma_map_single(dev, rx_flush->buffer_vaddr,
5130 if (dma_mapping_error(dev, rx_flush->buffer_paddr))
5140 hwdesc->cppi5_desc_vaddr = devm_kzalloc(dev, hwdesc->cppi5_desc_size,
5145 hwdesc->cppi5_desc_paddr = dma_map_single(dev, hwdesc->cppi5_desc_vaddr,
5148 if (dma_mapping_error(dev, hwdesc->cppi5_desc_paddr))
5170 dma_sync_single_for_device(dev, hwdesc->cppi5_desc_paddr,
5180 hwdesc->cppi5_desc_vaddr = devm_kzalloc(dev, hwdesc->cppi5_desc_size,
5185 hwdesc->cppi5_desc_paddr = dma_map_single(dev, hwdesc->cppi5_desc_vaddr,
5188 if (dma_mapping_error(dev, hwdesc->cppi5_desc_paddr))
5200 dma_sync_single_for_device(dev, hwdesc->cppi5_desc_paddr,
5314 struct device_node *navss_node = pdev->dev.parent->of_node;
5316 struct device *dev = &pdev->dev;
5322 ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(48));
5324 dev_err(dev, "failed to set dma mask stuff\n");
5326 ud = devm_kzalloc(dev, sizeof(*ud), GFP_KERNEL);
5330 match = of_match_node(udma_of_match, dev->of_node);
5332 dev_err(dev, "No compatible match found\n");
5341 dev_err(dev, "No compatible SoC found\n");
5351 ud->tisci_rm.tisci = ti_sci_get_by_phandle(dev->of_node, "ti,sci");
5355 ret = of_property_read_u32(dev->of_node, "ti,sci-dev-id",
5358 dev_err(dev, "ti,sci-dev-id read failure %d\n", ret);
5363 ret = of_property_read_u32(navss_node, "ti,sci-dev-id",
5366 dev_err(dev, "NAVSS ti,sci-dev-id read failure %d\n", ret);
5371 ret = of_property_read_u32(dev->of_node, "ti,udma-atype",
5374 dev_err(dev, "Invalid atype: %u\n", ud->atype);
5378 ret = of_property_read_u32(dev->of_node, "ti,asel",
5381 dev_err(dev, "Invalid asel: %u\n", ud->asel);
5390 ud->ringacc = of_k3_ringacc_get_by_phandle(dev->of_node, "ti,ringacc");
5411 dev->msi.domain = of_msi_get_domain(dev, dev->of_node,
5413 if (!dev->msi.domain) {
5468 ud->ddev.dev = dev;
5469 ud->dev = dev;
5530 uc->name = devm_kasprintf(dev, GFP_KERNEL, "%s chan%d",
5531 dev_name(dev), i);
5545 dev_err(dev, "failed to register slave DMA engine: %d\n", ret);
5551 ret = of_dma_controller_register(dev->of_node, udma_of_xlate, ud);
5553 dev_err(dev, "failed to register of_dma controller\n");
5560 static int __maybe_unused udma_pm_suspend(struct device *dev)
5562 struct udma_dev *ud = dev_get_drvdata(dev);
5573 dev_dbg(dev, "Suspending channel %s\n",
5582 static int __maybe_unused udma_pm_resume(struct device *dev)
5584 struct udma_dev *ud = dev_get_drvdata(dev);
5596 dev_dbg(dev, "Resuming channel %s\n",