From 09db229f212a95bc674625895e68670a7aa57c00 Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Fri, 20 Jun 2014 17:29:15 -0700 Subject: [PATCH] Make DMA interface chip independent The common DMA interface should not include chip dependent stuff. Otherwise we cannot share DMA interface across chips. BUG=None TEST=make buildall BRANCH=None Change-Id: I9e0d0c0637520c613747110d6c65d3b800e01704 Signed-off-by: Vic Yang Reviewed-on: https://chromium-review.googlesource.com/205066 Reviewed-by: Randall Spangler Reviewed-by: Vincent Palatin --- chip/stm32/registers.h | 3 +++ include/dma.h | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/chip/stm32/registers.h b/chip/stm32/registers.h index c4e8abb3fd..f47452de84 100644 --- a/chip/stm32/registers.h +++ b/chip/stm32/registers.h @@ -1130,6 +1130,9 @@ struct stm32_dma_chan { /* Always use stm32_dma_chan_t so volatile keyword is included! */ typedef volatile struct stm32_dma_chan stm32_dma_chan_t; +/* Common code and header file must use this */ +typedef stm32_dma_chan_t dma_chan_t; + /* Registers for the DMA controller */ struct stm32_dma_regs { uint32_t isr; diff --git a/include/dma.h b/include/dma.h index 04c1be2bf9..e63d03a232 100644 --- a/include/dma.h +++ b/include/dma.h @@ -30,7 +30,7 @@ struct dma_option { * @param channel Channel to read * @return pointer to DMA channel registers */ -stm32_dma_chan_t *dma_get_channel(enum dma_channel channel); +dma_chan_t *dma_get_channel(enum dma_channel channel); /** * Prepare a DMA transfer to transmit data from memory to a peripheral @@ -76,14 +76,14 @@ void dma_disable(enum dma_channel channel); * @return number of bytes completed on a channel, or 0 if this channel is * not enabled */ -int dma_bytes_done(stm32_dma_chan_t *chan, int orig_count); +int dma_bytes_done(dma_chan_t *chan, int orig_count); /** * Start a previously-prepared dma channel * * @param chan Channel to start, from dma_get_channel() */ -void dma_go(stm32_dma_chan_t *chan); +void dma_go(dma_chan_t *chan); #ifdef CONFIG_DMA_HELP /**