• Home
  • Raw
  • Download

Lines Matching refs:dma_desc

155 	struct tegra_dma_desc		*dma_desc;  member
273 struct tegra_dma_desc *dma_desc; in tegra_dma_desc_get() local
279 list_for_each_entry(dma_desc, &tdc->free_dma_desc, node) { in tegra_dma_desc_get()
280 if (async_tx_test_ack(&dma_desc->txd) && !dma_desc->cb_count) { in tegra_dma_desc_get()
281 list_del(&dma_desc->node); in tegra_dma_desc_get()
283 dma_desc->txd.flags = 0; in tegra_dma_desc_get()
284 return dma_desc; in tegra_dma_desc_get()
291 dma_desc = kzalloc(sizeof(*dma_desc), GFP_NOWAIT); in tegra_dma_desc_get()
292 if (!dma_desc) in tegra_dma_desc_get()
295 dma_async_tx_descriptor_init(&dma_desc->txd, &tdc->dma_chan); in tegra_dma_desc_get()
296 dma_desc->txd.tx_submit = tegra_dma_tx_submit; in tegra_dma_desc_get()
297 dma_desc->txd.flags = 0; in tegra_dma_desc_get()
299 return dma_desc; in tegra_dma_desc_get()
303 struct tegra_dma_desc *dma_desc) in tegra_dma_desc_put() argument
308 if (!list_empty(&dma_desc->tx_list)) in tegra_dma_desc_put()
309 list_splice_init(&dma_desc->tx_list, &tdc->free_sg_req); in tegra_dma_desc_put()
310 list_add_tail(&dma_desc->node, &tdc->free_dma_desc); in tegra_dma_desc_put()
534 struct tegra_dma_desc *dma_desc; in tegra_dma_abort_all() local
542 dma_desc = sgreq->dma_desc; in tegra_dma_abort_all()
543 dma_desc->dma_status = DMA_ERROR; in tegra_dma_abort_all()
544 list_add_tail(&dma_desc->node, &tdc->free_dma_desc); in tegra_dma_abort_all()
547 if (!dma_desc->cb_count) in tegra_dma_abort_all()
548 list_add_tail(&dma_desc->cb_node, in tegra_dma_abort_all()
550 dma_desc->cb_count++; in tegra_dma_abort_all()
585 struct tegra_dma_desc *dma_desc; in handle_once_dma_done() local
590 dma_desc = sgreq->dma_desc; in handle_once_dma_done()
591 dma_desc->bytes_transferred += sgreq->req_len; in handle_once_dma_done()
595 dma_desc->dma_status = DMA_COMPLETE; in handle_once_dma_done()
596 dma_cookie_complete(&dma_desc->txd); in handle_once_dma_done()
597 if (!dma_desc->cb_count) in handle_once_dma_done()
598 list_add_tail(&dma_desc->cb_node, &tdc->cb_desc); in handle_once_dma_done()
599 dma_desc->cb_count++; in handle_once_dma_done()
600 list_add_tail(&dma_desc->node, &tdc->free_dma_desc); in handle_once_dma_done()
619 struct tegra_dma_desc *dma_desc; in handle_cont_sngl_cycle_dma_done() local
624 dma_desc = sgreq->dma_desc; in handle_cont_sngl_cycle_dma_done()
626 dma_desc->bytes_transferred = in handle_cont_sngl_cycle_dma_done()
627 (dma_desc->bytes_transferred + sgreq->req_len) % in handle_cont_sngl_cycle_dma_done()
628 dma_desc->bytes_requested; in handle_cont_sngl_cycle_dma_done()
631 if (!dma_desc->cb_count) in handle_cont_sngl_cycle_dma_done()
632 list_add_tail(&dma_desc->cb_node, &tdc->cb_desc); in handle_cont_sngl_cycle_dma_done()
633 dma_desc->cb_count++; in handle_cont_sngl_cycle_dma_done()
643 dma_desc->dma_status = DMA_ERROR; in handle_cont_sngl_cycle_dma_done()
651 struct tegra_dma_desc *dma_desc; in tegra_dma_tasklet() local
657 dma_desc = list_first_entry(&tdc->cb_desc, typeof(*dma_desc), in tegra_dma_tasklet()
659 list_del(&dma_desc->cb_node); in tegra_dma_tasklet()
660 dmaengine_desc_get_callback(&dma_desc->txd, &cb); in tegra_dma_tasklet()
661 cb_count = dma_desc->cb_count; in tegra_dma_tasklet()
662 dma_desc->cb_count = 0; in tegra_dma_tasklet()
700 struct tegra_dma_desc *dma_desc = txd_to_tegra_dma_desc(txd); in tegra_dma_tx_submit() local
706 dma_desc->dma_status = DMA_IN_PROGRESS; in tegra_dma_tx_submit()
707 cookie = dma_cookie_assign(&dma_desc->txd); in tegra_dma_tx_submit()
708 list_splice_tail_init(&dma_desc->tx_list, &tdc->pending_sg_req); in tegra_dma_tx_submit()
751 struct tegra_dma_desc *dma_desc; in tegra_dma_terminate_all() local
782 sgreq->dma_desc->bytes_transferred += in tegra_dma_terminate_all()
794 dma_desc = list_first_entry(&tdc->cb_desc, typeof(*dma_desc), in tegra_dma_terminate_all()
796 list_del(&dma_desc->cb_node); in tegra_dma_terminate_all()
797 dma_desc->cb_count = 0; in tegra_dma_terminate_all()
903 struct tegra_dma_desc *dma_desc; in tegra_dma_tx_status() local
917 list_for_each_entry(dma_desc, &tdc->free_dma_desc, node) { in tegra_dma_tx_status()
918 if (dma_desc->txd.cookie == cookie) { in tegra_dma_tx_status()
919 ret = dma_desc->dma_status; in tegra_dma_tx_status()
926 dma_desc = sg_req->dma_desc; in tegra_dma_tx_status()
927 if (dma_desc->txd.cookie == cookie) { in tegra_dma_tx_status()
929 ret = dma_desc->dma_status; in tegra_dma_tx_status()
935 dma_desc = NULL; in tegra_dma_tx_status()
938 if (dma_desc && txstate) { in tegra_dma_tx_status()
939 residual = dma_desc->bytes_requested - in tegra_dma_tx_status()
940 ((dma_desc->bytes_transferred + bytes) % in tegra_dma_tx_status()
941 dma_desc->bytes_requested); in tegra_dma_tx_status()
1058 struct tegra_dma_desc *dma_desc; in tegra_dma_prep_slave_sg() local
1100 dma_desc = tegra_dma_desc_get(tdc); in tegra_dma_prep_slave_sg()
1101 if (!dma_desc) { in tegra_dma_prep_slave_sg()
1105 INIT_LIST_HEAD(&dma_desc->tx_list); in tegra_dma_prep_slave_sg()
1106 INIT_LIST_HEAD(&dma_desc->cb_node); in tegra_dma_prep_slave_sg()
1107 dma_desc->cb_count = 0; in tegra_dma_prep_slave_sg()
1108 dma_desc->bytes_requested = 0; in tegra_dma_prep_slave_sg()
1109 dma_desc->bytes_transferred = 0; in tegra_dma_prep_slave_sg()
1110 dma_desc->dma_status = DMA_IN_PROGRESS; in tegra_dma_prep_slave_sg()
1123 tegra_dma_desc_put(tdc, dma_desc); in tegra_dma_prep_slave_sg()
1130 tegra_dma_desc_put(tdc, dma_desc); in tegra_dma_prep_slave_sg()
1135 dma_desc->bytes_requested += len; in tegra_dma_prep_slave_sg()
1145 sg_req->dma_desc = dma_desc; in tegra_dma_prep_slave_sg()
1148 list_add_tail(&sg_req->node, &dma_desc->tx_list); in tegra_dma_prep_slave_sg()
1152 dma_desc->txd.flags = DMA_CTRL_ACK; in tegra_dma_prep_slave_sg()
1164 tegra_dma_desc_put(tdc, dma_desc); in tegra_dma_prep_slave_sg()
1169 return &dma_desc->txd; in tegra_dma_prep_slave_sg()
1183 struct tegra_dma_desc *dma_desc; in tegra_dma_prep_dma_cyclic() local
1248 dma_desc = tegra_dma_desc_get(tdc); in tegra_dma_prep_dma_cyclic()
1249 if (!dma_desc) { in tegra_dma_prep_dma_cyclic()
1254 INIT_LIST_HEAD(&dma_desc->tx_list); in tegra_dma_prep_dma_cyclic()
1255 INIT_LIST_HEAD(&dma_desc->cb_node); in tegra_dma_prep_dma_cyclic()
1256 dma_desc->cb_count = 0; in tegra_dma_prep_dma_cyclic()
1258 dma_desc->bytes_transferred = 0; in tegra_dma_prep_dma_cyclic()
1259 dma_desc->bytes_requested = buf_len; in tegra_dma_prep_dma_cyclic()
1267 tegra_dma_desc_put(tdc, dma_desc); in tegra_dma_prep_dma_cyclic()
1280 sg_req->dma_desc = dma_desc; in tegra_dma_prep_dma_cyclic()
1283 list_add_tail(&sg_req->node, &dma_desc->tx_list); in tegra_dma_prep_dma_cyclic()
1289 dma_desc->txd.flags = DMA_CTRL_ACK; in tegra_dma_prep_dma_cyclic()
1301 tegra_dma_desc_put(tdc, dma_desc); in tegra_dma_prep_dma_cyclic()
1306 return &dma_desc->txd; in tegra_dma_prep_dma_cyclic()
1321 struct tegra_dma_desc *dma_desc; in tegra_dma_free_chan_resources() local
1342 dma_desc = list_first_entry(&dma_desc_list, typeof(*dma_desc), in tegra_dma_free_chan_resources()
1344 list_del(&dma_desc->node); in tegra_dma_free_chan_resources()
1345 kfree(dma_desc); in tegra_dma_free_chan_resources()