Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dma-ep93xx.h
Go to the documentation of this file.
1 #ifndef __ASM_ARCH_DMA_H
2 #define __ASM_ARCH_DMA_H
3 
4 #include <linux/types.h>
5 #include <linux/dmaengine.h>
6 #include <linux/dma-mapping.h>
7 
8 /*
9  * M2P channels.
10  *
11  * Note that these values are also directly used for setting the PPALLOC
12  * register.
13  */
14 #define EP93XX_DMA_I2S1 0
15 #define EP93XX_DMA_I2S2 1
16 #define EP93XX_DMA_AAC1 2
17 #define EP93XX_DMA_AAC2 3
18 #define EP93XX_DMA_AAC3 4
19 #define EP93XX_DMA_I2S3 5
20 #define EP93XX_DMA_UART1 6
21 #define EP93XX_DMA_UART2 7
22 #define EP93XX_DMA_UART3 8
23 #define EP93XX_DMA_IRDA 9
24 /* M2M channels */
25 #define EP93XX_DMA_SSP 10
26 #define EP93XX_DMA_IDE 11
27 
39  int port;
41  const char *name;
42 };
43 
51  const char *name;
52  void __iomem *base;
53  int irq;
54 };
55 
67  size_t num_channels;
68 };
69 
70 static inline bool ep93xx_dma_chan_is_m2p(struct dma_chan *chan)
71 {
72  return !strcmp(dev_name(chan->device->dev), "ep93xx-dma-m2p");
73 }
74 
83 static inline enum dma_transfer_direction
84 ep93xx_dma_chan_direction(struct dma_chan *chan)
85 {
86  if (!ep93xx_dma_chan_is_m2p(chan))
87  return DMA_NONE;
88 
89  /* even channels are for TX, odd for RX */
90  return (chan->chan_id % 2 == 0) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
91 }
92 
93 #endif /* __ASM_ARCH_DMA_H */