Lines Matching defs:desc
45 /* Schedule desc completion */
103 /* The channel which currently holds this desc */
125 struct dma_pl330_desc *desc;
133 list_for_each_entry(desc, list, node) {
137 /* All desc in a list belong to same channel */
138 pch = desc->pchan;
139 callback = desc->txd.callback;
140 param = desc->txd.callback_param;
145 desc->pchan = NULL;
157 struct dma_pl330_desc *desc;
160 list_for_each_entry(desc, &pch->work_list, node) {
163 if (desc->status == BUSY)
167 &desc->req);
169 desc->status = BUSY;
176 desc->status = DONE;
178 __func__, __LINE__, desc->txd.cookie);
187 struct dma_pl330_desc *desc, *_dt;
194 list_for_each_entry_safe(desc, _dt, &pch->work_list, node)
195 if (desc->status == DONE) {
196 pch->completed = desc->txd.cookie;
197 list_move_tail(&desc->node, &list);
213 struct dma_pl330_desc *desc = token;
214 struct dma_pl330_chan *pch = desc->pchan;
217 /* If desc aborted */
223 desc->status = DONE;
256 struct dma_pl330_desc *desc;
268 /* Mark all desc done */
269 list_for_each_entry(desc, &pch->work_list, node)
270 desc->status = DONE;
324 struct dma_pl330_desc *desc, *last = to_desc(tx);
335 desc = list_entry(last->node.next, struct dma_pl330_desc, node);
339 desc->txd.cookie = cookie;
341 list_move_tail(&desc->node, &pch->work_list);
357 static inline void _init_desc(struct dma_pl330_desc *desc)
359 desc->pchan = NULL;
360 desc->req.x = &desc->px;
361 desc->req.token = desc;
362 desc->rqcfg.swap = SWAP_NO;
363 desc->rqcfg.privileged = 0;
364 desc->rqcfg.insnaccess = 0;
365 desc->rqcfg.scctl = SCCTRL0;
366 desc->rqcfg.dcctl = DCCTRL0;
367 desc->req.cfg = &desc->rqcfg;
368 desc->req.xfer_cb = dma_pl330_rqcb;
369 desc->txd.tx_submit = pl330_tx_submit;
371 INIT_LIST_HEAD(&desc->node);
377 struct dma_pl330_desc *desc;
384 desc = kmalloc(count * sizeof(*desc), flg);
385 if (!desc)
391 _init_desc(&desc[i]);
392 list_add_tail(&desc[i].node, &pdmac->desc_pool);
403 struct dma_pl330_desc *desc = NULL;
412 desc = list_entry(pdmac->desc_pool.next,
415 list_del_init(&desc->node);
417 desc->status = PREP;
418 desc->txd.callback = NULL;
423 return desc;
430 struct dma_pl330_desc *desc;
432 /* Pluck one desc from the pool of DMAC */
433 desc = pluck_desc(pdmac);
436 if (!desc) {
441 desc = pluck_desc(pdmac);
442 if (!desc) {
450 desc->pchan = pch;
451 desc->txd.cookie = 0;
452 async_tx_ack(&desc->txd);
454 desc->req.rqtype = peri->rqtype;
455 desc->req.peri = peri->peri_id;
457 dma_async_tx_descriptor_init(&desc->txd, &pch->chan);
459 return desc;
475 struct dma_pl330_desc *desc = pl330_get_desc(pch);
477 if (!desc) {
478 dev_err(pch->dmac->pif.dev, "%s:%d Unable to fetch desc\n",
493 fill_px(&desc->px, dst, src, len);
495 return desc;
499 static inline int get_burst_len(struct dma_pl330_desc *desc, size_t len)
501 struct dma_pl330_chan *pch = desc->pchan;
507 burst_len >>= desc->rqcfg.brst_size;
514 if (!(len % (burst_len << desc->rqcfg.brst_size)))
526 struct dma_pl330_desc *desc;
540 desc = __pl330_prep_dma_memcpy(pch, dst, src, len);
541 if (!desc)
544 desc->rqcfg.src_inc = 1;
545 desc->rqcfg.dst_inc = 1;
556 desc->rqcfg.brst_size = 0;
557 while (burst != (1 << desc->rqcfg.brst_size))
558 desc->rqcfg.brst_size++;
560 desc->rqcfg.brst_len = get_burst_len(desc, len);
562 desc->txd.flags = flags;
564 return &desc->txd;
572 struct dma_pl330_desc *first, *desc = NULL;
600 desc = pl330_get_desc(pch);
601 if (!desc) {
605 "%s:%d Unable to fetch desc\n",
613 desc = list_entry(first->node.next,
615 list_move_tail(&desc->node, &pdmac->desc_pool);
626 first = desc;
628 list_add_tail(&desc->node, &first->node);
631 desc->rqcfg.src_inc = 1;
632 desc->rqcfg.dst_inc = 0;
633 fill_px(&desc->px,
636 desc->rqcfg.src_inc = 0;
637 desc->rqcfg.dst_inc = 1;
638 fill_px(&desc->px,
642 desc->rqcfg.brst_size = burst_size;
643 desc->rqcfg.brst_len = 1;
646 /* Return the last desc in the chain */
647 desc->txd.flags = flg;
648 return &desc->txd;
714 dev_warn(&adev->dev, "unable to allocate desc\n");