diff options
author | Simon Glass <sjg@chromium.org> | 2012-06-26 16:10:21 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2012-06-28 19:02:08 -0700 |
commit | 9ae29ecd25b27aea7eea4c8999a803b6e1d6df31 (patch) | |
tree | bae050aa4b7356ffaff14b1231cb41704ccea648 /chip/stm32/dma.h | |
parent | 2e0ae579909fe49bffd7db29992b5526b99f3a1e (diff) | |
download | chrome-ec-9ae29ecd25b27aea7eea4c8999a803b6e1d6df31.tar.gz |
dma: Deprecate dma_start_tx() in favor of dma_prepare_tx()
This allows us to prepare a dma transaction in advance, and quickly
start it when needed.
BUG=chrome-os-partner:10533
TEST=build and boot on snow
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: Iac605b879b3556f33af5585b298ada6bc4f52c90
Reviewed-on: https://gerrit.chromium.org/gerrit/26166
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'chip/stm32/dma.h')
-rw-r--r-- | chip/stm32/dma.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/chip/stm32/dma.h b/chip/stm32/dma.h index 7ab24df756..1cc8a5009c 100644 --- a/chip/stm32/dma.h +++ b/chip/stm32/dma.h @@ -84,15 +84,18 @@ enum { struct dma_channel *dma_get_channel(int channel); /** - * Start a DMA transfer to transmit data from memory to a peripheral + * Prepare a DMA transfer to transmit data from memory to a peripheral * - * @param channel Channel number to read (DMAC_...) + * Call dma_go() afterwards to actually start the transfer. + * + * @param chan Channel to prepare (use dma_get_channel()) * @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 */ -int dma_start_tx(unsigned channel, unsigned count, void *periph, - const void *memory); +void dma_prepare_tx(struct dma_channel *chan, unsigned count, + void *periph, const void *memory); /** * Start a DMA transfer to receive data to memory from a peripheral @@ -115,6 +118,14 @@ 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 * * @param channel Channel number to read (DMAC_...) |