Lines Matching refs:desc

281  * @desc: pointer to the atmel dma descriptor.
294 struct at_desc *desc;
416 "desc: s%pad d%pad ctrl0x%x:0x%x l%pad\n",
477 * @desc: descriptor, signle or at the end of a chain, to end chain on
480 static void set_lli_eol(struct at_desc *desc, unsigned int i)
482 u32 ctrlb = desc->sg[i].lli->ctrlb;
487 desc->sg[i].lli->ctrlb = ctrlb;
488 desc->sg[i].lli->dscr = 0;
546 static void atdma_lli_chain(struct at_desc *desc, unsigned int i)
548 struct atdma_sg *atdma_sg = &desc->sg[i];
551 desc->sg[i - 1].lli->dscr = atdma_sg->lli_phys;
561 struct at_desc *desc;
564 atchan->desc = NULL;
571 atchan->desc = desc = to_atdma_desc(&vd->tx);
577 channel_writel(atchan, DSCR, desc->sg[0].lli_phys);
579 FIELD_PREP(ATC_SPIP_HOLE, desc->src_hole) |
580 FIELD_PREP(ATC_SPIP_BOUNDARY, desc->boundary));
582 FIELD_PREP(ATC_DPIP_HOLE, desc->dst_hole) |
583 FIELD_PREP(ATC_DPIP_BOUNDARY, desc->boundary));
595 struct at_desc *desc = to_atdma_desc(&vd->tx);
598 for (i = 0; i < desc->sglen; i++) {
599 if (desc->sg[i].lli)
600 dma_pool_free(atdma->lli_pool, desc->sg[i].lli,
601 desc->sg[i].lli_phys);
605 if (desc->memset_buffer) {
606 dma_pool_free(atdma->memset_pool, desc->memset_vaddr,
607 desc->memset_paddr);
608 desc->memset_buffer = false;
611 kfree(desc);
638 * @desc: pointer to the descriptor for which the residue is calculated.
679 struct at_desc *desc, u32 *residue)
684 len = desc->total_len;
716 if (desc->sg[0].lli->dscr == dscr) {
720 len -= desc->sg[0].len;
722 for (i = 1; i < desc->sglen; i++) {
723 if (desc->sg[i].lli && desc->sg[i].lli->dscr == dscr)
725 len -= desc->sg[i].len;
751 struct at_desc *desc = NULL;
756 desc = to_atdma_desc(&vd->tx);
757 else if (atchan->desc && atchan->desc->vd.tx.cookie == cookie)
758 desc = atchan->desc;
760 if (!desc)
763 if (desc->sg[0].lli->dscr)
765 return atc_get_llis_residue(atchan, desc, residue);
768 len = desc->total_len;
781 struct at_desc *desc = atchan->desc;
795 desc->vd.tx.cookie);
796 for (i = 0; i < desc->sglen; i++)
797 atc_dump_lli(atchan, desc->sg[i].lli);
803 struct at_desc *desc;
806 desc = atchan->desc;
808 if (desc) {
815 vchan_cyclic_callback(&desc->vd);
817 vchan_cookie_complete(&desc->vd);
818 atchan->desc = NULL;
875 struct at_desc *desc;
932 desc = kzalloc(struct_size(desc, sg, 1), GFP_ATOMIC);
933 if (!desc)
935 desc->sglen = 1;
937 atdma_sg = desc->sg;
941 kfree(desc);
951 desc->boundary = first->size >> dwidth;
952 desc->dst_hole = (dmaengine_get_dst_icg(xt, first) >> dwidth) + 1;
953 desc->src_hole = (dmaengine_get_src_icg(xt, first) >> dwidth) + 1;
956 desc->total_len = len;
958 set_lli_eol(desc, 0);
959 return vchan_tx_prep(&atchan->vc, &desc->vd, flags);
976 struct at_desc *desc = NULL;
995 desc = kzalloc(struct_size(desc, sg, sg_len), GFP_ATOMIC);
996 if (!desc)
998 desc->sglen = sg_len;
1016 struct atdma_sg *atdma_sg = &desc->sg[i];
1033 desc->sg[i].len = xfer_count << src_width;
1035 atdma_lli_chain(desc, i);
1038 desc->total_len = len;
1041 set_lli_eol(desc, i - 1);
1043 return vchan_tx_prep(&atchan->vc, &desc->vd, flags);
1046 atdma_desc_free(&desc->vd);
1099 struct at_desc *desc;
1134 desc = kzalloc(struct_size(desc, sg, 1), GFP_ATOMIC);
1135 if (!desc)
1137 desc->sglen = 1;
1139 ret = atdma_create_memset_lli(chan, desc->sg, paddr, dest, len);
1143 desc->memset_paddr = paddr;
1144 desc->memset_vaddr = vaddr;
1145 desc->memset_buffer = true;
1147 desc->total_len = len;
1150 set_lli_eol(desc, 0);
1152 return vchan_tx_prep(&atchan->vc, &desc->vd, flags);
1155 kfree(desc);
1169 struct at_desc *desc;
1194 desc = kzalloc(struct_size(desc, sg, sg_len), GFP_ATOMIC);
1195 if (!desc)
1197 desc->sglen = sg_len;
1212 ret = atdma_create_memset_lli(chan, &desc->sg[i], paddr, dest,
1217 atdma_lli_chain(desc, i);
1221 desc->memset_paddr = paddr;
1222 desc->memset_vaddr = vaddr;
1223 desc->memset_buffer = true;
1225 desc->total_len = total_len;
1228 set_lli_eol(desc, i - 1);
1230 return vchan_tx_prep(&atchan->vc, &desc->vd, flags);
1233 atdma_desc_free(&desc->vd);
1257 struct at_desc *desc;
1277 desc = kzalloc(struct_size(desc, sg, sg_len), GFP_ATOMIC);
1278 if (!desc)
1280 desc->sglen = sg_len;
1298 struct atdma_sg *atdma_sg = &desc->sg[i];
1331 desc->sg[i].len = len;
1332 atdma_lli_chain(desc, i);
1347 struct atdma_sg *atdma_sg = &desc->sg[i];
1377 desc->sg[i].len = len;
1380 atdma_lli_chain(desc, i);
1388 set_lli_eol(desc, i - 1);
1390 desc->total_len = total_len;
1392 return vchan_tx_prep(&atchan->vc, &desc->vd, flags);
1397 atdma_desc_free(&desc->vd);
1426 atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc,
1434 struct atdma_sg *atdma_sg = &desc->sg[i];
1478 desc->sg[i].len = period_len;
1500 struct at_desc *desc;
1534 desc = kzalloc(struct_size(desc, sg, periods), GFP_ATOMIC);
1535 if (!desc)
1537 desc->sglen = periods;
1541 if (atc_dma_cyclic_fill_desc(chan, desc, i, buf_addr,
1544 atdma_lli_chain(desc, i);
1546 desc->total_len = buf_len;
1548 desc->sg[i - 1].lli->dscr = desc->sg[0].lli_phys;
1550 return vchan_tx_prep(&atchan->vc, &desc->vd, flags);
1553 atdma_desc_free(&desc->vd);
1645 if (atchan->desc) {
1646 vchan_terminate_vdesc(&atchan->desc->vd);
1647 atchan->desc = NULL;
1712 if (vchan_issue_pending(&atchan->vc) && !atchan->desc) {