.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "SA1100_REQUEST_DMA" "" "06 October 2005" "" ""
.SH NAME
sa1100_request_dma \- allocate one of the SA11x0's DMA chanels
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
int sa1100_request_dma (dma_device_t \fIdevice\fB, const char * \fIdevice_id\fB, dma_callback_t \fIcallback\fB, void * \fIdata\fB, dma_regs_t ** \fIdma_regs\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIdevice\fB\fR
The SA11x0 peripheral targeted by this request
.TP
\fB\fIdevice_id\fB\fR
An ascii name for the claiming device
.TP
\fB\fIcallback\fB\fR
Function to be called when the DMA completes
.TP
\fB\fIdata\fB\fR
A cookie passed back to the callback function
.TP
\fB\fIdma_regs\fB\fR
Pointer to the location of the allocated channel's identifier
.SH "DESCRIPTION"
.PP
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
\fIdma_regs\fR\&. The list of possible values for \fIdevice\fR are listed into
linux/include/asm-arm/arch-sa1100/dma.h as a dma_device_t enum.
.PP
Note that reading from a port and writing to the same port are
actually considered as two different streams requiring separate
DMA registrations.
.PP
The \fIcallback\fR 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.
.PP
If no channels are available, or if the desired \fIdevice\fR is already in
use by another DMA channel, then an error code is returned. This
function must be called before any other DMA calls.