1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/unicore32/include/mach/dma.h
5 * Code specific to PKUnity SoC and UniCore ISA
7 * Copyright (C) 2001-2010 GUAN Xue-tao
9 #ifndef __MACH_PUV3_DMA_H__
10 #define __MACH_PUV3_DMA_H__
13 * The PKUnity has six internal DMA channels.
15 #define MAX_DMA_CHANNELS 6
27 extern int puv3_request_dma(char *name,
29 void (*irq_handler)(int, void *),
30 void (*err_handler)(int, void *),
33 extern void puv3_free_dma(int dma_ch);
35 static inline void puv3_stop_dma(int ch)
37 writel(readl(DMAC_CONFIG(ch)) & ~DMAC_CONFIG_EN, DMAC_CONFIG(ch));
40 static inline void puv3_resume_dma(int ch)
42 writel(readl(DMAC_CONFIG(ch)) | DMAC_CONFIG_EN, DMAC_CONFIG(ch));
45 #endif /* __MACH_PUV3_DMA_H__ */