Lines Matching refs:sg

120 	struct axi_dmac_sg sg[];  member
212 struct axi_dmac_sg *sg; in axi_dmac_start_transfer() local
229 sg = &desc->sg[desc->num_submitted]; in axi_dmac_start_transfer()
232 if (sg->id != AXI_DMAC_SG_UNUSED) { in axi_dmac_start_transfer()
233 sg->schedule_when_free = true; in axi_dmac_start_transfer()
249 sg->id = axi_dmac_read(dmac, AXI_DMAC_REG_TRANSFER_ID); in axi_dmac_start_transfer()
252 axi_dmac_write(dmac, AXI_DMAC_REG_DEST_ADDRESS, sg->dest_addr); in axi_dmac_start_transfer()
253 axi_dmac_write(dmac, AXI_DMAC_REG_DEST_STRIDE, sg->dest_stride); in axi_dmac_start_transfer()
257 axi_dmac_write(dmac, AXI_DMAC_REG_SRC_ADDRESS, sg->src_addr); in axi_dmac_start_transfer()
258 axi_dmac_write(dmac, AXI_DMAC_REG_SRC_STRIDE, sg->src_stride); in axi_dmac_start_transfer()
273 axi_dmac_write(dmac, AXI_DMAC_REG_X_LENGTH, sg->x_len - 1); in axi_dmac_start_transfer()
274 axi_dmac_write(dmac, AXI_DMAC_REG_Y_LENGTH, sg->y_len - 1); in axi_dmac_start_transfer()
286 struct axi_dmac_sg *sg) in axi_dmac_total_sg_bytes() argument
289 return sg->x_len * sg->y_len; in axi_dmac_total_sg_bytes()
291 return sg->x_len; in axi_dmac_total_sg_bytes()
298 struct axi_dmac_sg *sg; in axi_dmac_dequeue_partial_xfers() local
309 sg = &desc->sg[i]; in axi_dmac_dequeue_partial_xfers()
310 if (sg->id == AXI_DMAC_SG_UNUSED) in axi_dmac_dequeue_partial_xfers()
312 if (sg->id == id) { in axi_dmac_dequeue_partial_xfers()
314 sg->partial_len = len; in axi_dmac_dequeue_partial_xfers()
345 struct axi_dmac_sg *sg; in axi_dmac_compute_residue() local
356 sg = &active->sg[i]; in axi_dmac_compute_residue()
357 total = axi_dmac_total_sg_bytes(chan, sg); in axi_dmac_compute_residue()
358 rslt->residue += (total - sg->partial_len); in axi_dmac_compute_residue()
366 struct axi_dmac_sg *sg; in axi_dmac_transfer_done() local
378 sg = &active->sg[active->num_completed]; in axi_dmac_transfer_done()
379 if (sg->id == AXI_DMAC_SG_UNUSED) /* Not yet submitted */ in axi_dmac_transfer_done()
381 if (!(BIT(sg->id) & completed_transfers)) in axi_dmac_transfer_done()
384 sg->id = AXI_DMAC_SG_UNUSED; in axi_dmac_transfer_done()
385 if (sg->schedule_when_free) { in axi_dmac_transfer_done()
386 sg->schedule_when_free = false; in axi_dmac_transfer_done()
390 if (sg->partial_len) in axi_dmac_transfer_done()
397 sg->partial_len) { in axi_dmac_transfer_done()
484 desc = kzalloc(struct_size(desc, sg, num_sgs), GFP_NOWAIT); in axi_dmac_alloc_desc()
489 desc->sg[i].id = AXI_DMAC_SG_UNUSED; in axi_dmac_alloc_desc()
499 struct axi_dmac_sg *sg) in axi_dmac_fill_linear_sg() argument
516 sg->dest_addr = addr; in axi_dmac_fill_linear_sg()
518 sg->src_addr = addr; in axi_dmac_fill_linear_sg()
519 sg->x_len = segment_size; in axi_dmac_fill_linear_sg()
520 sg->y_len = 1; in axi_dmac_fill_linear_sg()
521 sg++; in axi_dmac_fill_linear_sg()
527 sg->dest_addr = addr; in axi_dmac_fill_linear_sg()
529 sg->src_addr = addr; in axi_dmac_fill_linear_sg()
530 sg->x_len = len; in axi_dmac_fill_linear_sg()
531 sg->y_len = 1; in axi_dmac_fill_linear_sg()
532 sg++; in axi_dmac_fill_linear_sg()
536 return sg; in axi_dmac_fill_linear_sg()
547 struct scatterlist *sg; in axi_dmac_prep_slave_sg() local
555 for_each_sg(sgl, sg, sg_len, i) in axi_dmac_prep_slave_sg()
556 num_sgs += DIV_ROUND_UP(sg_dma_len(sg), chan->max_length); in axi_dmac_prep_slave_sg()
562 dsg = desc->sg; in axi_dmac_prep_slave_sg()
564 for_each_sg(sgl, sg, sg_len, i) { in axi_dmac_prep_slave_sg()
565 if (!axi_dmac_check_addr(chan, sg_dma_address(sg)) || in axi_dmac_prep_slave_sg()
566 !axi_dmac_check_len(chan, sg_dma_len(sg))) { in axi_dmac_prep_slave_sg()
571 dsg = axi_dmac_fill_linear_sg(chan, direction, sg_dma_address(sg), 1, in axi_dmac_prep_slave_sg()
572 sg_dma_len(sg), dsg); in axi_dmac_prep_slave_sg()
607 period_len, desc->sg); in axi_dmac_prep_dma_cyclic()
662 desc->sg[0].src_addr = xt->src_start; in axi_dmac_prep_interleaved()
663 desc->sg[0].src_stride = xt->sgl[0].size + src_icg; in axi_dmac_prep_interleaved()
667 desc->sg[0].dest_addr = xt->dst_start; in axi_dmac_prep_interleaved()
668 desc->sg[0].dest_stride = xt->sgl[0].size + dst_icg; in axi_dmac_prep_interleaved()
672 desc->sg[0].x_len = xt->sgl[0].size; in axi_dmac_prep_interleaved()
673 desc->sg[0].y_len = xt->numf; in axi_dmac_prep_interleaved()
675 desc->sg[0].x_len = xt->sgl[0].size * xt->numf; in axi_dmac_prep_interleaved()
676 desc->sg[0].y_len = 1; in axi_dmac_prep_interleaved()