Lines Matching refs:rchan

839 	struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan);  in rcar_dmac_chan_pause()  local
841 spin_lock_irqsave(&rchan->lock, flags); in rcar_dmac_chan_pause()
842 rcar_dmac_clear_chcr_de(rchan); in rcar_dmac_chan_pause()
843 spin_unlock_irqrestore(&rchan->lock, flags); in rcar_dmac_chan_pause()
1029 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); in rcar_dmac_alloc_chan_resources() local
1032 INIT_LIST_HEAD(&rchan->desc.chunks_free); in rcar_dmac_alloc_chan_resources()
1033 INIT_LIST_HEAD(&rchan->desc.pages); in rcar_dmac_alloc_chan_resources()
1036 ret = rcar_dmac_xfer_chunk_alloc(rchan, GFP_KERNEL); in rcar_dmac_alloc_chan_resources()
1040 ret = rcar_dmac_desc_alloc(rchan, GFP_KERNEL); in rcar_dmac_alloc_chan_resources()
1049 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); in rcar_dmac_free_chan_resources() local
1051 struct rcar_dmac_chan_map *map = &rchan->map; in rcar_dmac_free_chan_resources()
1057 spin_lock_irq(&rchan->lock); in rcar_dmac_free_chan_resources()
1058 rcar_dmac_chan_halt(rchan); in rcar_dmac_free_chan_resources()
1059 spin_unlock_irq(&rchan->lock); in rcar_dmac_free_chan_resources()
1065 synchronize_irq(rchan->irq); in rcar_dmac_free_chan_resources()
1067 if (rchan->mid_rid >= 0) { in rcar_dmac_free_chan_resources()
1069 clear_bit(rchan->mid_rid, dmac->modules); in rcar_dmac_free_chan_resources()
1070 rchan->mid_rid = -EINVAL; in rcar_dmac_free_chan_resources()
1073 list_splice_init(&rchan->desc.free, &list); in rcar_dmac_free_chan_resources()
1074 list_splice_init(&rchan->desc.pending, &list); in rcar_dmac_free_chan_resources()
1075 list_splice_init(&rchan->desc.active, &list); in rcar_dmac_free_chan_resources()
1076 list_splice_init(&rchan->desc.done, &list); in rcar_dmac_free_chan_resources()
1077 list_splice_init(&rchan->desc.wait, &list); in rcar_dmac_free_chan_resources()
1079 rchan->desc.running = NULL; in rcar_dmac_free_chan_resources()
1082 rcar_dmac_realloc_hwdesc(rchan, desc, 0); in rcar_dmac_free_chan_resources()
1084 list_for_each_entry_safe(page, _page, &rchan->desc.pages, node) { in rcar_dmac_free_chan_resources()
1103 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); in rcar_dmac_prep_dma_memcpy() local
1115 return rcar_dmac_chan_prep_sg(rchan, &sgl, 1, dma_dest, in rcar_dmac_prep_dma_memcpy()
1122 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); in rcar_dmac_map_slave_addr() local
1123 struct rcar_dmac_chan_map *map = &rchan->map; in rcar_dmac_map_slave_addr()
1129 dev_addr = rchan->src.slave_addr; in rcar_dmac_map_slave_addr()
1130 dev_size = rchan->src.xfer_size; in rcar_dmac_map_slave_addr()
1133 dev_addr = rchan->dst.slave_addr; in rcar_dmac_map_slave_addr()
1134 dev_size = rchan->dst.xfer_size; in rcar_dmac_map_slave_addr()
1156 "chan%u: failed to map %zx@%pap", rchan->index, in rcar_dmac_map_slave_addr()
1162 rchan->index, dev_size, &dev_addr, &map->addr, in rcar_dmac_map_slave_addr()
1177 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); in rcar_dmac_prep_slave_sg() local
1180 if (rchan->mid_rid < 0 || !sg_len || !sg_dma_len(sgl)) { in rcar_dmac_prep_slave_sg()
1183 __func__, sg_len, rchan->mid_rid); in rcar_dmac_prep_slave_sg()
1190 return rcar_dmac_chan_prep_sg(rchan, sgl, sg_len, rchan->map.addr, in rcar_dmac_prep_slave_sg()
1201 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); in rcar_dmac_prep_dma_cyclic() local
1208 if (rchan->mid_rid < 0 || buf_len < period_len) { in rcar_dmac_prep_dma_cyclic()
1211 __func__, buf_len, period_len, rchan->mid_rid); in rcar_dmac_prep_dma_cyclic()
1222 rchan->index, sg_len, RCAR_DMAC_MAX_SG_LEN); in rcar_dmac_prep_dma_cyclic()
1245 desc = rcar_dmac_chan_prep_sg(rchan, sgl, sg_len, rchan->map.addr, in rcar_dmac_prep_dma_cyclic()
1255 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); in rcar_dmac_device_config() local
1261 rchan->src.slave_addr = cfg->src_addr; in rcar_dmac_device_config()
1262 rchan->dst.slave_addr = cfg->dst_addr; in rcar_dmac_device_config()
1263 rchan->src.xfer_size = cfg->src_addr_width; in rcar_dmac_device_config()
1264 rchan->dst.xfer_size = cfg->dst_addr_width; in rcar_dmac_device_config()
1271 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); in rcar_dmac_chan_terminate_all() local
1274 spin_lock_irqsave(&rchan->lock, flags); in rcar_dmac_chan_terminate_all()
1275 rcar_dmac_chan_halt(rchan); in rcar_dmac_chan_terminate_all()
1276 spin_unlock_irqrestore(&rchan->lock, flags); in rcar_dmac_chan_terminate_all()
1283 rcar_dmac_chan_reinit(rchan); in rcar_dmac_chan_terminate_all()
1399 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); in rcar_dmac_tx_status() local
1409 spin_lock_irqsave(&rchan->lock, flags); in rcar_dmac_tx_status()
1410 residue = rcar_dmac_chan_get_residue(rchan, cookie); in rcar_dmac_tx_status()
1411 cyclic = rchan->desc.running ? rchan->desc.running->cyclic : false; in rcar_dmac_tx_status()
1412 spin_unlock_irqrestore(&rchan->lock, flags); in rcar_dmac_tx_status()
1425 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); in rcar_dmac_issue_pending() local
1428 spin_lock_irqsave(&rchan->lock, flags); in rcar_dmac_issue_pending()
1430 if (list_empty(&rchan->desc.pending)) in rcar_dmac_issue_pending()
1434 list_splice_tail_init(&rchan->desc.pending, &rchan->desc.active); in rcar_dmac_issue_pending()
1440 if (!rchan->desc.running) { in rcar_dmac_issue_pending()
1443 desc = list_first_entry(&rchan->desc.active, in rcar_dmac_issue_pending()
1445 rchan->desc.running = desc; in rcar_dmac_issue_pending()
1447 rcar_dmac_chan_start_xfer(rchan); in rcar_dmac_issue_pending()
1451 spin_unlock_irqrestore(&rchan->lock, flags); in rcar_dmac_issue_pending()
1456 struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan); in rcar_dmac_device_synchronize() local
1458 synchronize_irq(rchan->irq); in rcar_dmac_device_synchronize()
1678 struct rcar_dmac_chan *rchan; in rcar_dmac_of_xlate() local
1694 rchan = to_rcar_dmac_chan(chan); in rcar_dmac_of_xlate()
1695 rchan->mid_rid = dma_spec->args[0]; in rcar_dmac_of_xlate()
1735 struct rcar_dmac_chan *rchan, in rcar_dmac_chan_probe() argument
1740 struct dma_chan *chan = &rchan->chan; in rcar_dmac_chan_probe()
1745 rchan->index = index; in rcar_dmac_chan_probe()
1746 rchan->iomem = dmac->iomem + data->chan_offset_base + in rcar_dmac_chan_probe()
1748 rchan->mid_rid = -EINVAL; in rcar_dmac_chan_probe()
1750 spin_lock_init(&rchan->lock); in rcar_dmac_chan_probe()
1752 INIT_LIST_HEAD(&rchan->desc.free); in rcar_dmac_chan_probe()
1753 INIT_LIST_HEAD(&rchan->desc.pending); in rcar_dmac_chan_probe()
1754 INIT_LIST_HEAD(&rchan->desc.active); in rcar_dmac_chan_probe()
1755 INIT_LIST_HEAD(&rchan->desc.done); in rcar_dmac_chan_probe()
1756 INIT_LIST_HEAD(&rchan->desc.wait); in rcar_dmac_chan_probe()
1760 rchan->irq = platform_get_irq_byname(pdev, pdev_irqname); in rcar_dmac_chan_probe()
1761 if (rchan->irq < 0) in rcar_dmac_chan_probe()
1778 ret = devm_request_threaded_irq(dmac->dev, rchan->irq, in rcar_dmac_chan_probe()
1781 irqname, rchan); in rcar_dmac_chan_probe()
1784 rchan->irq, ret); in rcar_dmac_chan_probe()