Lines Matching refs:desc

376 	struct at_xdmac_desc	*desc, *_desc;  in at_xdmac_runtime_suspend_descriptors()  local
378 list_for_each_entry_safe(desc, _desc, &atchan->xfers_list, xfer_node) { in at_xdmac_runtime_suspend_descriptors()
379 if (!desc->active_xfer) in at_xdmac_runtime_suspend_descriptors()
390 struct at_xdmac_desc *desc, *_desc; in at_xdmac_runtime_resume_descriptors() local
393 list_for_each_entry_safe(desc, _desc, &atchan->xfers_list, xfer_node) { in at_xdmac_runtime_resume_descriptors()
394 if (!desc->active_xfer) in at_xdmac_runtime_resume_descriptors()
547 struct at_xdmac_desc *desc = txd_to_at_desc(tx); in at_xdmac_tx_submit() local
555 list_add_tail(&desc->xfer_node, &atchan->xfers_list); in at_xdmac_tx_submit()
559 __func__, atchan, desc); in at_xdmac_tx_submit()
567 struct at_xdmac_desc *desc; in at_xdmac_alloc_desc() local
571 desc = dma_pool_zalloc(atxdmac->at_xdmac_desc_pool, gfp_flags, &phys); in at_xdmac_alloc_desc()
572 if (desc) { in at_xdmac_alloc_desc()
573 INIT_LIST_HEAD(&desc->descs_list); in at_xdmac_alloc_desc()
574 dma_async_tx_descriptor_init(&desc->tx_dma_desc, chan); in at_xdmac_alloc_desc()
575 desc->tx_dma_desc.tx_submit = at_xdmac_tx_submit; in at_xdmac_alloc_desc()
576 desc->tx_dma_desc.phys = phys; in at_xdmac_alloc_desc()
579 return desc; in at_xdmac_alloc_desc()
582 static void at_xdmac_init_used_desc(struct at_xdmac_desc *desc) in at_xdmac_init_used_desc() argument
584 memset(&desc->lld, 0, sizeof(desc->lld)); in at_xdmac_init_used_desc()
585 INIT_LIST_HEAD(&desc->descs_list); in at_xdmac_init_used_desc()
586 desc->direction = DMA_TRANS_NONE; in at_xdmac_init_used_desc()
587 desc->xfer_size = 0; in at_xdmac_init_used_desc()
588 desc->active_xfer = false; in at_xdmac_init_used_desc()
594 struct at_xdmac_desc *desc; in at_xdmac_get_desc() local
597 desc = at_xdmac_alloc_desc(&atchan->chan, GFP_NOWAIT); in at_xdmac_get_desc()
599 desc = list_first_entry(&atchan->free_descs_list, in at_xdmac_get_desc()
601 list_del(&desc->desc_node); in at_xdmac_get_desc()
602 at_xdmac_init_used_desc(desc); in at_xdmac_get_desc()
605 return desc; in at_xdmac_get_desc()
610 struct at_xdmac_desc *desc) in at_xdmac_queue_desc() argument
612 if (!prev || !desc) in at_xdmac_queue_desc()
615 prev->lld.mbr_nda = desc->tx_dma_desc.phys; in at_xdmac_queue_desc()
623 struct at_xdmac_desc *desc) in at_xdmac_increment_block_count() argument
625 if (!desc) in at_xdmac_increment_block_count()
628 desc->lld.mbr_bc++; in at_xdmac_increment_block_count()
632 __func__, desc); in at_xdmac_increment_block_count()
795 struct at_xdmac_desc *desc = NULL; in at_xdmac_prep_slave_sg() local
807 desc = at_xdmac_get_desc(atchan); in at_xdmac_prep_slave_sg()
808 if (!desc) { in at_xdmac_prep_slave_sg()
818 desc->lld.mbr_sa = atchan->sconfig.src_addr; in at_xdmac_prep_slave_sg()
819 desc->lld.mbr_da = mem; in at_xdmac_prep_slave_sg()
821 desc->lld.mbr_sa = mem; in at_xdmac_prep_slave_sg()
822 desc->lld.mbr_da = atchan->sconfig.dst_addr; in at_xdmac_prep_slave_sg()
828 desc->lld.mbr_ubc = AT_XDMAC_MBR_UBC_NDV2 /* next descriptor view */ in at_xdmac_prep_slave_sg()
832 desc->lld.mbr_cfg = (atchan->cfg & ~AT_XDMAC_CC_DWIDTH_MASK) | in at_xdmac_prep_slave_sg()
836 __func__, &desc->lld.mbr_sa, &desc->lld.mbr_da, desc->lld.mbr_ubc); in at_xdmac_prep_slave_sg()
840 at_xdmac_queue_desc(chan, prev, desc); in at_xdmac_prep_slave_sg()
842 prev = desc; in at_xdmac_prep_slave_sg()
844 first = desc; in at_xdmac_prep_slave_sg()
847 __func__, desc, first); in at_xdmac_prep_slave_sg()
848 list_add_tail(&desc->desc_node, &first->descs_list); in at_xdmac_prep_slave_sg()
893 struct at_xdmac_desc *desc = NULL; in at_xdmac_prep_dma_cyclic() local
896 desc = at_xdmac_get_desc(atchan); in at_xdmac_prep_dma_cyclic()
897 if (!desc) { in at_xdmac_prep_dma_cyclic()
908 __func__, desc, &desc->tx_dma_desc.phys); in at_xdmac_prep_dma_cyclic()
911 desc->lld.mbr_sa = atchan->sconfig.src_addr; in at_xdmac_prep_dma_cyclic()
912 desc->lld.mbr_da = buf_addr + i * period_len; in at_xdmac_prep_dma_cyclic()
914 desc->lld.mbr_sa = buf_addr + i * period_len; in at_xdmac_prep_dma_cyclic()
915 desc->lld.mbr_da = atchan->sconfig.dst_addr; in at_xdmac_prep_dma_cyclic()
917 desc->lld.mbr_cfg = atchan->cfg; in at_xdmac_prep_dma_cyclic()
918 desc->lld.mbr_ubc = AT_XDMAC_MBR_UBC_NDV1 in at_xdmac_prep_dma_cyclic()
921 | period_len >> at_xdmac_get_dwidth(desc->lld.mbr_cfg); in at_xdmac_prep_dma_cyclic()
925 __func__, &desc->lld.mbr_sa, &desc->lld.mbr_da, desc->lld.mbr_ubc); in at_xdmac_prep_dma_cyclic()
929 at_xdmac_queue_desc(chan, prev, desc); in at_xdmac_prep_dma_cyclic()
931 prev = desc; in at_xdmac_prep_dma_cyclic()
933 first = desc; in at_xdmac_prep_dma_cyclic()
936 __func__, desc, first); in at_xdmac_prep_dma_cyclic()
937 list_add_tail(&desc->desc_node, &first->descs_list); in at_xdmac_prep_dma_cyclic()
985 struct at_xdmac_desc *desc; in at_xdmac_interleaved_queue_desc() local
1037 desc = at_xdmac_get_desc(atchan); in at_xdmac_interleaved_queue_desc()
1039 if (!desc) { in at_xdmac_interleaved_queue_desc()
1048 desc->lld.mbr_sa = src; in at_xdmac_interleaved_queue_desc()
1049 desc->lld.mbr_da = dst; in at_xdmac_interleaved_queue_desc()
1050 desc->lld.mbr_sus = dmaengine_get_src_icg(xt, chunk); in at_xdmac_interleaved_queue_desc()
1051 desc->lld.mbr_dus = dmaengine_get_dst_icg(xt, chunk); in at_xdmac_interleaved_queue_desc()
1053 desc->lld.mbr_ubc = AT_XDMAC_MBR_UBC_NDV3 in at_xdmac_interleaved_queue_desc()
1057 desc->lld.mbr_cfg = chan_cc; in at_xdmac_interleaved_queue_desc()
1061 __func__, &desc->lld.mbr_sa, &desc->lld.mbr_da, in at_xdmac_interleaved_queue_desc()
1062 desc->lld.mbr_ubc, desc->lld.mbr_cfg); in at_xdmac_interleaved_queue_desc()
1066 at_xdmac_queue_desc(chan, prev, desc); in at_xdmac_interleaved_queue_desc()
1068 return desc; in at_xdmac_interleaved_queue_desc()
1118 struct at_xdmac_desc *desc; in at_xdmac_prep_interleaved() local
1132 desc = at_xdmac_interleaved_queue_desc(chan, atchan, in at_xdmac_prep_interleaved()
1136 if (!desc) { in at_xdmac_prep_interleaved()
1144 first = desc; in at_xdmac_prep_interleaved()
1147 __func__, desc, first); in at_xdmac_prep_interleaved()
1148 list_add_tail(&desc->desc_node, &first->descs_list); in at_xdmac_prep_interleaved()
1157 prev = desc; in at_xdmac_prep_interleaved()
1209 struct at_xdmac_desc *desc = NULL; in at_xdmac_prep_dma_memcpy() local
1214 desc = at_xdmac_get_desc(atchan); in at_xdmac_prep_dma_memcpy()
1216 if (!desc) { in at_xdmac_prep_dma_memcpy()
1244 desc->lld.mbr_sa = src_addr; in at_xdmac_prep_dma_memcpy()
1245 desc->lld.mbr_da = dst_addr; in at_xdmac_prep_dma_memcpy()
1246 desc->lld.mbr_ubc = AT_XDMAC_MBR_UBC_NDV2 in at_xdmac_prep_dma_memcpy()
1250 desc->lld.mbr_cfg = chan_cc; in at_xdmac_prep_dma_memcpy()
1254 __func__, &desc->lld.mbr_sa, &desc->lld.mbr_da, desc->lld.mbr_ubc, desc->lld.mbr_cfg); in at_xdmac_prep_dma_memcpy()
1258 at_xdmac_queue_desc(chan, prev, desc); in at_xdmac_prep_dma_memcpy()
1260 prev = desc; in at_xdmac_prep_dma_memcpy()
1262 first = desc; in at_xdmac_prep_dma_memcpy()
1265 __func__, desc, first); in at_xdmac_prep_dma_memcpy()
1266 list_add_tail(&desc->desc_node, &first->descs_list); in at_xdmac_prep_dma_memcpy()
1281 struct at_xdmac_desc *desc; in at_xdmac_memset_create_desc() local
1319 desc = at_xdmac_get_desc(atchan); in at_xdmac_memset_create_desc()
1321 if (!desc) { in at_xdmac_memset_create_desc()
1333 desc->lld.mbr_da = dst_addr; in at_xdmac_memset_create_desc()
1334 desc->lld.mbr_ds = (pattern << 24) | in at_xdmac_memset_create_desc()
1338 desc->lld.mbr_ubc = AT_XDMAC_MBR_UBC_NDV3 in at_xdmac_memset_create_desc()
1342 desc->lld.mbr_cfg = chan_cc; in at_xdmac_memset_create_desc()
1346 __func__, &desc->lld.mbr_da, desc->lld.mbr_ds, desc->lld.mbr_ubc, in at_xdmac_memset_create_desc()
1347 desc->lld.mbr_cfg); in at_xdmac_memset_create_desc()
1349 return desc; in at_xdmac_memset_create_desc()
1357 struct at_xdmac_desc *desc; in at_xdmac_prep_dma_memset() local
1365 desc = at_xdmac_memset_create_desc(chan, atchan, dest, len, value); in at_xdmac_prep_dma_memset()
1366 list_add_tail(&desc->desc_node, &desc->descs_list); in at_xdmac_prep_dma_memset()
1368 desc->tx_dma_desc.cookie = -EBUSY; in at_xdmac_prep_dma_memset()
1369 desc->tx_dma_desc.flags = flags; in at_xdmac_prep_dma_memset()
1370 desc->xfer_size = len; in at_xdmac_prep_dma_memset()
1372 return &desc->tx_dma_desc; in at_xdmac_prep_dma_memset()
1381 struct at_xdmac_desc *desc, *pdesc = NULL, in at_xdmac_prep_dma_memset_sg() local
1398 desc = at_xdmac_memset_create_desc(chan, atchan, in at_xdmac_prep_dma_memset_sg()
1402 if (!desc && first) in at_xdmac_prep_dma_memset_sg()
1407 first = desc; in at_xdmac_prep_dma_memset_sg()
1483 list_add_tail(&desc->desc_node, in at_xdmac_prep_dma_memset_sg()
1487 __func__, desc, first); in at_xdmac_prep_dma_memset_sg()
1502 __func__, desc, pdesc); in at_xdmac_prep_dma_memset_sg()
1515 list_add_tail(&desc->desc_node, in at_xdmac_prep_dma_memset_sg()
1521 pdesc = desc; in at_xdmac_prep_dma_memset_sg()
1543 struct at_xdmac_desc *desc, *_desc, *iter; in at_xdmac_tx_status() local
1562 desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc, xfer_node); in at_xdmac_tx_status()
1568 if (!desc->active_xfer) { in at_xdmac_tx_status()
1569 dma_set_residue(txstate, desc->xfer_size); in at_xdmac_tx_status()
1573 residue = desc->xfer_size; in at_xdmac_tx_status()
1589 if ((desc->lld.mbr_cfg & mask) == value) { in at_xdmac_tx_status()
1647 if ((desc->lld.mbr_cfg & mask) == value) { in at_xdmac_tx_status()
1658 descs_list = &desc->descs_list; in at_xdmac_tx_status()
1663 desc = iter; in at_xdmac_tx_status()
1673 __func__, desc, &desc->tx_dma_desc.phys, ret, cookie, residue); in at_xdmac_tx_status()
1684 struct at_xdmac_desc *desc; in at_xdmac_advance_work() local
1693 desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc, in at_xdmac_advance_work()
1695 dev_vdbg(chan2dev(&atchan->chan), "%s: desc 0x%p\n", __func__, desc); in at_xdmac_advance_work()
1696 if (!desc->active_xfer) in at_xdmac_advance_work()
1697 at_xdmac_start_xfer(atchan, desc); in at_xdmac_advance_work()
1702 struct at_xdmac_desc *desc; in at_xdmac_handle_cyclic() local
1712 desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc, in at_xdmac_handle_cyclic()
1715 txd = &desc->tx_dma_desc; in at_xdmac_handle_cyclic()
1769 struct at_xdmac_desc *desc; in at_xdmac_tasklet() local
1793 desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc, in at_xdmac_tasklet()
1795 dev_vdbg(chan2dev(&atchan->chan), "%s: desc 0x%p\n", __func__, desc); in at_xdmac_tasklet()
1796 if (!desc->active_xfer) { in at_xdmac_tasklet()
1802 txd = &desc->tx_dma_desc; in at_xdmac_tasklet()
1805 list_del(&desc->xfer_node); in at_xdmac_tasklet()
1815 list_splice_tail_init(&desc->descs_list, &atchan->free_descs_list); in at_xdmac_tasklet()
2007 struct at_xdmac_desc *desc, *_desc; in at_xdmac_device_terminate_all() local
2025 list_for_each_entry_safe(desc, _desc, &atchan->xfers_list, xfer_node) { in at_xdmac_device_terminate_all()
2026 list_del(&desc->xfer_node); in at_xdmac_device_terminate_all()
2027 list_splice_tail_init(&desc->descs_list, in at_xdmac_device_terminate_all()
2034 if (desc->active_xfer) { in at_xdmac_device_terminate_all()
2053 struct at_xdmac_desc *desc; in at_xdmac_alloc_chan_resources() local
2069 desc = at_xdmac_alloc_desc(chan, GFP_KERNEL); in at_xdmac_alloc_chan_resources()
2070 if (!desc) { in at_xdmac_alloc_chan_resources()
2080 list_add_tail(&desc->desc_node, &atchan->free_descs_list); in at_xdmac_alloc_chan_resources()
2094 struct at_xdmac_desc *desc, *_desc; in at_xdmac_free_chan_resources() local
2096 list_for_each_entry_safe(desc, _desc, &atchan->free_descs_list, desc_node) { in at_xdmac_free_chan_resources()
2097 dev_dbg(chan2dev(chan), "%s: freeing descriptor %p\n", __func__, desc); in at_xdmac_free_chan_resources()
2098 list_del(&desc->desc_node); in at_xdmac_free_chan_resources()
2099 dma_pool_free(atxdmac->at_xdmac_desc_pool, desc, desc->tx_dma_desc.phys); in at_xdmac_free_chan_resources()