diff options
author | GuanXuetao <gxt@mprc.pku.edu.cn> | 2011-02-26 21:21:18 +0800 |
---|---|---|
committer | GuanXuetao <gxt@mprc.pku.edu.cn> | 2011-03-17 09:19:19 +0800 |
commit | e5abf78b57199a417eb01ff922a5ea6ff9e10b61 (patch) | |
tree | 6f72a13d44c0dc8c4d575d84885f5694c16ed1da /arch/unicore32/include/mach/dma.h | |
parent | 4517366d870b89d6fb8c0c90deb6c73d975908af (diff) | |
download | op-kernel-dev-e5abf78b57199a417eb01ff922a5ea6ff9e10b61.zip op-kernel-dev-e5abf78b57199a417eb01ff922a5ea6ff9e10b61.tar.gz |
unicore32 io: redefine __REG(x) and re-use readl/writel funcs
-- by advice of Arnd Bergmann
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/unicore32/include/mach/dma.h')
-rw-r--r-- | arch/unicore32/include/mach/dma.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/unicore32/include/mach/dma.h b/arch/unicore32/include/mach/dma.h index 3e3224a..d655c1b 100644 --- a/arch/unicore32/include/mach/dma.h +++ b/arch/unicore32/include/mach/dma.h @@ -35,7 +35,14 @@ extern int puv3_request_dma(char *name, extern void puv3_free_dma(int dma_ch); -#define puv3_stop_dma(ch) (DMAC_CONFIG(ch) &= ~DMAC_CONFIG_EN) -#define puv3_resume_dma(ch) (DMAC_CONFIG(ch) |= DMAC_CONFIG_EN) +static inline void puv3_stop_dma(int ch) +{ + writel(readl(DMAC_CONFIG(ch)) & ~DMAC_CONFIG_EN, DMAC_CONFIG(ch)); +} + +static inline void puv3_resume_dma(int ch) +{ + writel(readl(DMAC_CONFIG(ch)) | DMAC_CONFIG_EN, DMAC_CONFIG(ch)); +} #endif /* __MACH_PUV3_DMA_H__ */ |