host-drivers/base-driver/vca/vop/vop_common.c
dma_cookie_t vop_async_dma(struct vop_device *vpdev, dma_addr_t dst,
		dma_addr_t src, size_t len, dma_async_tx_callback callback,
		void *callback_param, struct dma_async_tx_descriptor **out_tx)
{
	dma_cookie_t cookie;
	struct dma_device *ddev;
	struct dma_async_tx_descriptor *tx;
	struct vop_info *vi = vpdev->priv;
	struct dma_chan *vop_ch = vi->dma_ch;
	unsigned long flags = DMA_PREP_INTERRUPT | DMA_PREP_FENCE;

	if (!vop_ch) {
		pr_err("no DMA channel available\n");
		cookie = -EBUSY;
		goto error;
	}
	ddev = vop_ch->device;
	tx = ddev->device_prep_dma_memcpy(vop_ch, dst, src, len, flags);

	if (!tx) {
		cookie = -ENOMEM;
		goto error;
	} else {
		tx->callback = callback;
		tx->callback_param = callback_param;
		if (out_tx) {
			/* It have to be before submitt because callback can be called
			 * in tx_submit() time. */
			*out_tx = tx;
		}
		cookie = tx->tx_submit(tx);
		if (dma_submit_error(cookie)) {
			if (out_tx) {
				*out_tx = NULL;
			}
			goto error;
		}
		dma_async_issue_pending(vop_ch);

		dev_dbg(&vi->vpdev->dev, "%s %d cookie %d, src 0x%llx, dst 0x%llx, "
				"len %lu\n", __func__, __LINE__, cookie, src, dst, len);
	}
error:
	if (dma_submit_error(cookie)) {
		dev_err(&vi->vpdev->dev, "%s %d err %d\n", __func__, __LINE__, cookie);
	}

	return cookie;
}
/*
 * vop_async_dma - Wrapper for asynchronous DMAs.
 *
 * @dev - The address of the pointer to the device instance used
 * for DMA registration.
 * @dst - destination DMA address.
 * @src - source DMA address.
 * @len - size of the transfer.
 * @callback - routine to call after this operation is complete
 * @callback_param - general parameter to pass to the callback routine
 * @out_tx - dma tx structure to disable callback when canceled.
 *
 * Return dma_cookie_t, check error by dma_submit_error(cookie)
 */
Wrapper for asynchronous DMAs.
@dev - The address of the pointer to the device instance used
for DMA registration.
@dst - destination DMA address.
@src - source DMA address.
@len - size of the transfer.
@callback - routine to call after this operation is complete
@callback_param - general parameter to pass to the callback routine
@out_tx - dma tx structure to disable callback when canceled.


Wrapper for asynchronous DMAs . @dev - The address of the pointer to the device instance used for DMA registration . @dst - destination DMA address . @src - source DMA address . @len - size of the transfer . @callback - routine to call after this operation is complete @callback_param - general parameter to pass to the callback routine @out_tx - dma tx structure to disable callback when canceled .
dma_cookie_t vop_async_dma(struct vop_device *vpdev, dma_addr_t dst,
		dma_addr_t src, size_t len, dma_async_tx_callback callback,
		void *callback_param, struct dma_async_tx_descriptor **out_tx)
{
	dma_cookie_t cookie;
	struct dma_device *ddev;
	struct dma_async_tx_descriptor *tx;
	struct vop_info *vi = vpdev->priv;
	struct dma_chan *vop_ch = vi->dma_ch;
	unsigned long flags = DMA_PREP_INTERRUPT | DMA_PREP_FENCE;
	if (!vop_ch) {
		pr_err("no DMA channel available\n");
		cookie = -EBUSY;
		goto error;
	}
	ddev = vop_ch->device;
	tx = ddev->device_prep_dma_memcpy(vop_ch, dst, src, len, flags);
	if (!tx) {
		cookie = -ENOMEM;
		goto error;
	} else {
		tx->callback = callback;
		tx->callback_param = callback_param;
		if (out_tx) {
			*out_tx = tx;
		}
		cookie = tx->tx_submit(tx);
		if (dma_submit_error(cookie)) {
			if (out_tx) {
				*out_tx = NULL;
			}
			goto error;
		}
		dma_async_issue_pending(vop_ch);
		dev_dbg(&vi->vpdev->dev, "%s %d cookie %d, src 0x%llx, dst 0x%llx, "
				"len %lu\n", __func__, __LINE__, cookie, src, dst, len);
	}
error:
	if (dma_submit_error(cookie)) {
		dev_err(&vi->vpdev->dev, "%s %d err %d\n", __func__, __LINE__, cookie);
	}
	return cookie;
}
dma_cookie_t vop_async_dma ( struct vop_device * vpdev , dma_addr_t dst , dma_addr_t src , size_t len , dma_async_tx_callback callback , void * callback_param , struct dma_async_tx_descriptor * * out_tx ) { dma_cookie_t cookie ; struct dma_device * ddev ; struct dma_async_tx_descriptor * tx ; struct vop_info * vi = vpdev -> priv ; struct dma_chan * vop_ch = vi -> dma_ch ; unsigned long flags = DMA_PREP_INTERRUPT | DMA_PREP_FENCE ; if ( ! vop_ch ) { pr_err ( " \n " ) ; cookie = - EBUSY ; goto error ; } ddev = vop_ch -> device ; tx = ddev -> device_prep_dma_memcpy ( vop_ch , dst , src , len , flags ) ; if ( ! tx ) { cookie = - ENOMEM ; goto error ; } else { tx -> callback = callback ; tx -> callback_param = callback_param ; if ( out_tx ) { * out_tx = tx ; } cookie = tx -> tx_submit ( tx ) ; if ( dma_submit_error ( cookie ) ) { if ( out_tx ) { * out_tx = NULL ; } goto error ; } dma_async_issue_pending ( vop_ch ) ; dev_dbg ( & vi -> vpdev -> dev , " " " \n " , __func__ , __LINE__ , cookie , src , dst , len ) ; } error : if ( dma_submit_error ( cookie ) ) { dev_err ( & vi -> vpdev -> dev , " \n " , __func__ , __LINE__ , cookie ) ; } return cookie ; }
vop_async_dma - Wrapper for asynchronous DMAs.
vop_async_dma - Wrapper for asynchronous DMAs .
/* It have to be before submitt because callback can be called
			 * in tx_submit() time. */