Revert "dma: Deprecate dma_start_tx() in favor of dma_prepare_tx()"

This reverts commit 7af4172be4afad9d576549721a82b3a47d701647 / Iac605b879b3556f33af5585b298ada6bc4f52c90.

This change bypassed the commit queue and broke daisy as a result.

BUG=chrome-os-partner:10533
TEST=build and boot on snow

Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I7a05ab42f71a901d167bde977f8a025c7ef62dfc
Reviewed-on: https://gerrit.chromium.org/gerrit/26379
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
This commit is contained in:
davidjames
2012-06-28 19:55:07 -07:00
committed by David James
parent 9ae29ecd25
commit a1cde77c51
2 changed files with 11 additions and 22 deletions

View File

@@ -72,19 +72,20 @@ static void prepare_channel(struct dma_channel *chan, unsigned count,
ctrl |= 0 << 10; /* MSIZE (memory size in bytes) */
ctrl |= 1 << 8; /* PSIZE (16-bits for now) */
REG32(&chan->ccr) = ctrl;
}
void dma_go(struct dma_channel *chan)
{
/* Fire it up */
REG32(&chan->ccr) |= DMA_EN;
ctrl |= DMA_EN;
REG32(&chan->ccr) = ctrl;
}
void dma_prepare_tx(struct dma_channel *chan, unsigned count, void *periph,
const void *memory)
int dma_start_tx(unsigned channel, unsigned count, void *periph,
const void *memory)
{
struct dma_channel *chan = dma_get_channel(channel);
prepare_channel(chan, count, periph, memory,
DMA_MINC_MASK | DMA_DIR_FROM_MEM_MASK);
return 0;
}
int dma_start_rx(unsigned channel, unsigned count, void *periph,
@@ -93,7 +94,6 @@ int dma_start_rx(unsigned channel, unsigned count, void *periph,
struct dma_channel *chan = dma_get_channel(channel);
prepare_channel(chan, count, periph, memory, DMA_MINC_MASK);
dma_go(chan);
return 0;
}

View File

@@ -84,18 +84,15 @@ enum {
struct dma_channel *dma_get_channel(int channel);
/**
* Prepare a DMA transfer to transmit data from memory to a peripheral
* Start a DMA transfer to transmit data from memory to a peripheral
*
* Call dma_go() afterwards to actually start the transfer.
*
* @param chan Channel to prepare (use dma_get_channel())
* @param channel Channel number to read (DMAC_...)
* @param count Number of bytes to transfer
* @param periph Pointer to peripheral data register
* @param memory Pointer to memory address
* @return pointer to prepared channel
*/
void dma_prepare_tx(struct dma_channel *chan, unsigned count,
void *periph, const void *memory);
int dma_start_tx(unsigned channel, unsigned count, void *periph,
const void *memory);
/**
* Start a DMA transfer to receive data to memory from a peripheral
@@ -117,14 +114,6 @@ int dma_start_rx(unsigned channel, unsigned count, void *periph,
*/
void dma_disable(unsigned channel);
/**
/**
* Start a previously-prepared dma channel
*
* @param chan Channel to start (returned from dma_prepare...())
*/
void dma_go(struct dma_channel *chan);
/**
* Testing: Print out the data transferred by a channel
*