Lines Matching refs:cvd

232 			    struct mtk_cqdma_vdesc *cvd)  in mtk_cqdma_start()  argument
236 dev_err(cqdma2dev(to_cqdma_dev(cvd->ch)), "cqdma wait transaction timeout\n"); in mtk_cqdma_start()
241 dev_err(cqdma2dev(to_cqdma_dev(cvd->ch)), "cqdma warm reset timeout\n"); in mtk_cqdma_start()
244 mtk_dma_set(pc, MTK_CQDMA_SRC, cvd->src & MTK_CQDMA_ADDR_LIMIT); in mtk_cqdma_start()
246 mtk_dma_set(pc, MTK_CQDMA_SRC2, cvd->src >> MTK_CQDMA_ADDR2_SHFIT); in mtk_cqdma_start()
252 mtk_dma_set(pc, MTK_CQDMA_DST, cvd->dest & MTK_CQDMA_ADDR_LIMIT); in mtk_cqdma_start()
254 mtk_dma_set(pc, MTK_CQDMA_DST2, cvd->dest >> MTK_CQDMA_ADDR2_SHFIT); in mtk_cqdma_start()
260 mtk_dma_set(pc, MTK_CQDMA_LEN1, cvd->len); in mtk_cqdma_start()
270 struct mtk_cqdma_vdesc *cvd; in mtk_cqdma_issue_vchan_pending() local
281 cvd = to_cqdma_vdesc(vd); in mtk_cqdma_issue_vchan_pending()
284 list_add_tail(&cvd->node, &pc->queue); in mtk_cqdma_issue_vchan_pending()
288 mtk_cqdma_start(pc, cvd); in mtk_cqdma_issue_vchan_pending()
301 struct mtk_cqdma_vdesc *cvd; in mtk_cqdma_is_vchan_active() local
303 list_for_each_entry(cvd, &cvc->pc->queue, node) in mtk_cqdma_is_vchan_active()
304 if (cvc == to_cqdma_vchan(cvd->ch)) in mtk_cqdma_is_vchan_active()
317 struct mtk_cqdma_vdesc *cvd, *ret = NULL; in mtk_cqdma_consume_work_queue() local
320 cvd = list_first_entry_or_null(&pc->queue, in mtk_cqdma_consume_work_queue()
322 if (unlikely(!cvd || !cvd->parent)) in mtk_cqdma_consume_work_queue()
325 cvc = to_cqdma_vchan(cvd->ch); in mtk_cqdma_consume_work_queue()
326 ret = cvd; in mtk_cqdma_consume_work_queue()
329 cvd->parent->residue -= cvd->len; in mtk_cqdma_consume_work_queue()
332 list_del(&cvd->node); in mtk_cqdma_consume_work_queue()
337 if (!cvd->parent->residue) { in mtk_cqdma_consume_work_queue()
339 vchan_cookie_complete(&cvd->parent->vd); in mtk_cqdma_consume_work_queue()
351 cvd = list_first_entry_or_null(&pc->queue, in mtk_cqdma_consume_work_queue()
353 if (cvd) in mtk_cqdma_consume_work_queue()
354 mtk_cqdma_start(pc, cvd); in mtk_cqdma_consume_work_queue()
362 struct mtk_cqdma_vdesc *cvd = NULL; in mtk_cqdma_tasklet_cb() local
367 cvd = mtk_cqdma_consume_work_queue(pc); in mtk_cqdma_tasklet_cb()
371 if (cvd) { in mtk_cqdma_tasklet_cb()
372 dma_run_dependencies(&cvd->vd.tx); in mtk_cqdma_tasklet_cb()
378 if (cvd->parent != cvd) in mtk_cqdma_tasklet_cb()
379 kfree(cvd); in mtk_cqdma_tasklet_cb()
446 struct mtk_cqdma_vdesc *cvd; in mtk_cqdma_tx_status() local
461 cvd = to_cqdma_vdesc(vd); in mtk_cqdma_tx_status()
462 bytes = cvd->residue; in mtk_cqdma_tx_status()
491 struct mtk_cqdma_vdesc **cvd; in mtk_cqdma_prep_dma_memcpy() local
507 cvd = kcalloc(nr_vd, sizeof(*cvd), GFP_NOWAIT); in mtk_cqdma_prep_dma_memcpy()
508 if (!cvd) in mtk_cqdma_prep_dma_memcpy()
512 cvd[i] = kzalloc(sizeof(*cvd[i]), GFP_NOWAIT); in mtk_cqdma_prep_dma_memcpy()
513 if (!cvd[i]) { in mtk_cqdma_prep_dma_memcpy()
515 kfree(cvd[i - 1]); in mtk_cqdma_prep_dma_memcpy()
520 cvd[i]->ch = c; in mtk_cqdma_prep_dma_memcpy()
524 cvd[i]->len = tlen; in mtk_cqdma_prep_dma_memcpy()
525 cvd[i]->src = src; in mtk_cqdma_prep_dma_memcpy()
526 cvd[i]->dest = dest; in mtk_cqdma_prep_dma_memcpy()
529 tx = vchan_tx_prep(to_virt_chan(c), &cvd[i]->vd, flags); in mtk_cqdma_prep_dma_memcpy()
533 cvd[0]->residue = len; in mtk_cqdma_prep_dma_memcpy()
536 cvd[i]->residue = tlen; in mtk_cqdma_prep_dma_memcpy()
539 cvd[i]->parent = cvd[0]; in mtk_cqdma_prep_dma_memcpy()
548 return &cvd[0]->vd.tx; in mtk_cqdma_prep_dma_memcpy()