int sa1100_request_dma (dma_device_t device, const char * device_id, dma_callback_t callback, void * data, dma_regs_t ** dma_regs);
This function will search for a free DMA channel and returns the address of the hardware registers for that channel as the channel identifier. This identifier is written to the location pointed by dma_regs. The list of possible values for device are listed into linux/include/asm-arm/arch-sa1100/dma.h as a dma_device_t enum.
Note that reading from a port and writing to the same port are actually considered as two different streams requiring separate DMA registrations.
The callback function is called from interrupt context when one of the two possible DMA buffers in flight has terminated. That function has to be small and efficient while posponing more complex processing to a lower priority execution context.
If no channels are available, or if the desired device is already in use by another DMA channel, then an error code is returned. This function must be called before any other DMA calls.