Commit f6910f17 authored by David Brownell's avatar David Brownell Committed by Kevin Hilman

EDMA: remove "in_use" field

Remove some significant duplication:

 - We only need a single bitmap to record which PARAM slots are
   in use, and it only needs to have enough bits to cover the
   slots that exist.

 - By using the atomic bitops for that, we eliminate the current
   need for a private spinlock.

 - We don't need to record 'tcc' either, it's only needed inside
   davinci_request_dma().  Remove it:  be clearer and more correct
   (it can change with PARAM operations), save space.

This change highlighted some existing bugs in terms of fault returns
when davinci_request_dma() couldn't return a resource of the relevant
type; unlikely for anyone to have hit them, so far.

Switch to standard kerneldoc for davinci_request_dma().  The two
previous descriptive comments were inconsistent, so fix that too.
Explain the callback usage a bit.

Minor new feature:  allow explicit allocation of slave channels too,
allowing pre-allocation of *any* DMA channel on behalf of DSP code.

This saves about 2 KB of space (half is data) as well as making
allocation and deallocation code a LOT simpler.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent ea8dd9ff
This diff is collapsed.
......@@ -187,38 +187,6 @@ enum sync_dimension {
ABSYNC = 1
};
/******************************************************************************
* davinci_request_dma - request for the Davinci DMA channel
*
* dev_id - DMA channel number
*
* EX: DAVINCI_DMA_MCBSP_TX - For requesting a DMA MasterChannel with MCBSP_TX
* event association
*
* DAVINCI_DMA_ANY - For requesting a DMA Masterchannel which does not has
* event association
*
* DAVINCI_DMA_LINK - for requesting a DMA SlaveChannel
*
* dev_name - name of the dma channel in human readable format
* callback - channel callback function (valied only if you are requesting
* for a DMA MasterChannel)
* data - private data for the channel to be requested
* lch - contains the device id allocated
* tcc - specifies the channel number on which the interrupt is
* generated
* Valied for QDMA and PARAM channes
* eventq_no - Event Queue no to which the channel will be associated with
* (valied only if you are requesting for a DMA MasterChannel)
* Values : EVENTQ_0/EVENTQ_1 for event queue 0/1.
* EVENTQ_DEFAULT for Default queue
*
* Return: zero on success,
* -EINVAL - if the requested channel is not supported on the ARM side events
* -EBUSY - if the requested channel is already in use
* EREQDMA - if failed to request the dma channel
*
*****************************************************************************/
int davinci_request_dma(int dev_id,
const char *dev_name,
void (*callback) (int lch, unsigned short ch_status,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment