Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

int mxc_dma_callback_set ( int  channel_num,
mxc_dma_callback_t  callback,
void *  arg 

This function is provided if the driver would like to set/change its callback function.

channel_num the channel number returned at request time. This would be used by the DMA driver to identify the calling driver and do the necessary cleanup on the channel associated with the particular peripheral
callback a callback function to provide notification on transfer completion, user could specify NULL if he does not wish to be notified
arg an argument that gets passed in to the callback function, used by the user to do any driver specific operations.
this function returns an error if the callback could not be set for the channel

Definition at line 1002 of file dma_mx2.c.

References mxc_dma_channel::active, mxc_dma_channel::cb_args, mxc_dma_channel::cb_fn, and mxc_dma_channel::lock.

Referenced by asrc_ioctl(), configure_read_channel(), configure_write_channel(), mxc_irda_start(), mxcmci_set_ios(), mxcuart_initdma(), and spdif_configure_dma_channel().

      mxc_dma_channel_t *dma;

      if ((channel_num >= MAX_DMA_CHANNELS) || (channel_num < 0)) {
            return -EINVAL;
      dma = g_dma_channels + channel_num;

      if (!dma->lock) {
            return -ENODEV;

      if (dma->active) {
            return -EBUSY;
      dma->cb_fn = callback;
      dma->cb_args = arg;
      return 0;


Generated by  Doxygen 1.6.0   Back to index