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

int mxc_dma_reset ( int  channel,
int  buffer_number 
)

Stop the current transfer

Parameters:
channel channel number
buffer_number number of buffers (beginning with 0), whose done bits should be reset to 0

Definition at line 912 of file sdma.c.

{
      unsigned char param = 0;
      int i = 0;

      if (!sdma_data[channel].in_use) {
            return -EINVAL;
      }

      /* clear the BD_DONE bits for all the necessary buffers */
      for (i = 0; i < buffer_number; i++) {

            iapi_IoCtl(sdma_data[channel].cd, (i << BD_NUM_OFFSET) |
                     IAPI_CHANGE_GET_STATUS, (unsigned long)&param);

            /* clear the BD_DONE bit of the buffer */
            param = param & (~BD_DONE);

            iapi_IoCtl(sdma_data[channel].cd, (i << BD_NUM_OFFSET) |
                     IAPI_CHANGE_SET_STATUS, param);
      }

      return 0;
}


Generated by  Doxygen 1.6.0   Back to index