Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dma.c
Go to the documentation of this file.
1 /*
2  * the simple DMA Implementation for Blackfin
3  *
4  * Copyright 2007-2008 Analog Devices Inc.
5  *
6  * Licensed under the GPL-2 or later.
7  */
8 
9 #include <linux/module.h>
10 
11 #include <asm/blackfin.h>
12 #include <asm/dma.h>
13 
51 };
52 EXPORT_SYMBOL(dma_io_base_addr);
53 
54 int channel2irq(unsigned int channel)
55 {
56  int ret_irq = -1;
57 
58  switch (channel) {
59  case CH_PPI0:
60  ret_irq = IRQ_PPI0;
61  break;
62  case CH_PPI1:
63  ret_irq = IRQ_PPI1;
64  break;
65  case CH_SPORT0_RX:
66  ret_irq = IRQ_SPORT0_RX;
67  break;
68  case CH_SPORT0_TX:
69  ret_irq = IRQ_SPORT0_TX;
70  break;
71  case CH_SPORT1_RX:
72  ret_irq = IRQ_SPORT1_RX;
73  break;
74  case CH_SPORT1_TX:
75  ret_irq = IRQ_SPORT1_TX;
76  break;
77  case CH_SPI:
78  ret_irq = IRQ_SPI;
79  break;
80  case CH_UART_RX:
81  ret_irq = IRQ_UART_RX;
82  break;
83  case CH_UART_TX:
84  ret_irq = IRQ_UART_TX;
85  break;
86 
87  case CH_MEM_STREAM0_SRC:
89  ret_irq = IRQ_MEM_DMA0;
90  break;
91  case CH_MEM_STREAM1_SRC:
93  ret_irq = IRQ_MEM_DMA1;
94  break;
95  case CH_MEM_STREAM2_SRC:
97  ret_irq = IRQ_MEM_DMA2;
98  break;
99  case CH_MEM_STREAM3_SRC:
100  case CH_MEM_STREAM3_DEST:
101  ret_irq = IRQ_MEM_DMA3;
102  break;
103 
104  case CH_IMEM_STREAM0_SRC:
106  ret_irq = IRQ_IMEM_DMA0;
107  break;
108  case CH_IMEM_STREAM1_SRC:
110  ret_irq = IRQ_IMEM_DMA1;
111  break;
112  }
113  return ret_irq;
114 }