diff options
author | Manuel Lauss <manuel.lauss@googlemail.com> | 2011-08-12 05:39:42 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-10-24 18:34:24 -0400 |
commit | f2e442fd2ff4ed565835e407114f75c92c9fe443 (patch) | |
tree | ad9c165e7e6f73d8618e79435ea807592dd1e231 /arch/mips/alchemy/common/dbdma.c | |
parent | d4f07ae748539d792162a9aa56f192c3992cb3fb (diff) |
MIPS: Alchemy: clean DMA code of CONFIG_SOC_AU1??? defines
This patch gets rid of all CONFIG_SOC_AU1XXX defines in
DMA/DBDMA-related code.
Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/2704/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/alchemy/common/dbdma.c')
-rw-r--r-- | arch/mips/alchemy/common/dbdma.c | 203 |
1 files changed, 91 insertions, 112 deletions
diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c index 3a5abb54d505..0e63ee487d6d 100644 --- a/arch/mips/alchemy/common/dbdma.c +++ b/arch/mips/alchemy/common/dbdma.c | |||
@@ -40,8 +40,6 @@ | |||
40 | #include <asm/mach-au1x00/au1000.h> | 40 | #include <asm/mach-au1x00/au1000.h> |
41 | #include <asm/mach-au1x00/au1xxx_dbdma.h> | 41 | #include <asm/mach-au1x00/au1xxx_dbdma.h> |
42 | 42 | ||
43 | #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) | ||
44 | |||
45 | /* | 43 | /* |
46 | * The Descriptor Based DMA supports up to 16 channels. | 44 | * The Descriptor Based DMA supports up to 16 channels. |
47 | * | 45 | * |
@@ -62,120 +60,96 @@ static dbdma_global_t *dbdma_gptr = | |||
62 | (dbdma_global_t *)KSEG1ADDR(AU1550_DBDMA_CONF_PHYS_ADDR); | 60 | (dbdma_global_t *)KSEG1ADDR(AU1550_DBDMA_CONF_PHYS_ADDR); |
63 | static int dbdma_initialized; | 61 | static int dbdma_initialized; |
64 | 62 | ||
65 | static dbdev_tab_t dbdev_tab[] = { | 63 | static dbdev_tab_t *dbdev_tab; |
66 | #ifdef CONFIG_SOC_AU1550 | 64 | |
65 | static dbdev_tab_t au1550_dbdev_tab[] __initdata = { | ||
67 | /* UARTS */ | 66 | /* UARTS */ |
68 | { DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, | 67 | { AU1550_DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, |
69 | { DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, | 68 | { AU1550_DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, |
70 | { DSCR_CMD0_UART3_TX, DEV_FLAGS_OUT, 0, 8, 0x11400004, 0, 0 }, | 69 | { AU1550_DSCR_CMD0_UART3_TX, DEV_FLAGS_OUT, 0, 8, 0x11400004, 0, 0 }, |
71 | { DSCR_CMD0_UART3_RX, DEV_FLAGS_IN, 0, 8, 0x11400000, 0, 0 }, | 70 | { AU1550_DSCR_CMD0_UART3_RX, DEV_FLAGS_IN, 0, 8, 0x11400000, 0, 0 }, |
72 | 71 | ||
73 | /* EXT DMA */ | 72 | /* EXT DMA */ |
74 | { DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, | 73 | { AU1550_DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, |
75 | { DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, | 74 | { AU1550_DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, |
76 | { DSCR_CMD0_DMA_REQ2, 0, 0, 0, 0x00000000, 0, 0 }, | 75 | { AU1550_DSCR_CMD0_DMA_REQ2, 0, 0, 0, 0x00000000, 0, 0 }, |
77 | { DSCR_CMD0_DMA_REQ3, 0, 0, 0, 0x00000000, 0, 0 }, | 76 | { AU1550_DSCR_CMD0_DMA_REQ3, 0, 0, 0, 0x00000000, 0, 0 }, |
78 | 77 | ||
79 | /* USB DEV */ | 78 | /* USB DEV */ |
80 | { DSCR_CMD0_USBDEV_RX0, DEV_FLAGS_IN, 4, 8, 0x10200000, 0, 0 }, | 79 | { AU1550_DSCR_CMD0_USBDEV_RX0, DEV_FLAGS_IN, 4, 8, 0x10200000, 0, 0 }, |
81 | { DSCR_CMD0_USBDEV_TX0, DEV_FLAGS_OUT, 4, 8, 0x10200004, 0, 0 }, | 80 | { AU1550_DSCR_CMD0_USBDEV_TX0, DEV_FLAGS_OUT, 4, 8, 0x10200004, 0, 0 }, |
82 | { DSCR_CMD0_USBDEV_TX1, DEV_FLAGS_OUT, 4, 8, 0x10200008, 0, 0 }, | 81 | { AU1550_DSCR_CMD0_USBDEV_TX1, DEV_FLAGS_OUT, 4, 8, 0x10200008, 0, 0 }, |
83 | { DSCR_CMD0_USBDEV_TX2, DEV_FLAGS_OUT, 4, 8, 0x1020000c, 0, 0 }, | 82 | { AU1550_DSCR_CMD0_USBDEV_TX2, DEV_FLAGS_OUT, 4, 8, 0x1020000c, 0, 0 }, |
84 | { DSCR_CMD0_USBDEV_RX3, DEV_FLAGS_IN, 4, 8, 0x10200010, 0, 0 }, | 83 | { AU1550_DSCR_CMD0_USBDEV_RX3, DEV_FLAGS_IN, 4, 8, 0x10200010, 0, 0 }, |
85 | { DSCR_CMD0_USBDEV_RX4, DEV_FLAGS_IN, 4, 8, 0x10200014, 0, 0 }, | 84 | { AU1550_DSCR_CMD0_USBDEV_RX4, DEV_FLAGS_IN, 4, 8, 0x10200014, 0, 0 }, |
86 | 85 | ||
87 | /* PSC 0 */ | 86 | /* PSCs */ |
88 | { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 }, | 87 | { AU1550_DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 }, |
89 | { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 }, | 88 | { AU1550_DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 }, |
90 | 89 | { AU1550_DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 0, 0x11b0001c, 0, 0 }, | |
91 | /* PSC 1 */ | 90 | { AU1550_DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 }, |
92 | { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 0, 0x11b0001c, 0, 0 }, | 91 | { AU1550_DSCR_CMD0_PSC2_TX, DEV_FLAGS_OUT, 0, 0, 0x10a0001c, 0, 0 }, |
93 | { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 }, | 92 | { AU1550_DSCR_CMD0_PSC2_RX, DEV_FLAGS_IN, 0, 0, 0x10a0001c, 0, 0 }, |
94 | 93 | { AU1550_DSCR_CMD0_PSC3_TX, DEV_FLAGS_OUT, 0, 0, 0x10b0001c, 0, 0 }, | |
95 | /* PSC 2 */ | 94 | { AU1550_DSCR_CMD0_PSC3_RX, DEV_FLAGS_IN, 0, 0, 0x10b0001c, 0, 0 }, |
96 | { DSCR_CMD0_PSC2_TX, DEV_FLAGS_OUT, 0, 0, 0x10a0001c, 0, 0 }, | 95 | |
97 | { DSCR_CMD0_PSC2_RX, DEV_FLAGS_IN, 0, 0, 0x10a0001c, 0, 0 }, | 96 | { AU1550_DSCR_CMD0_PCI_WRITE, 0, 0, 0, 0x00000000, 0, 0 }, /* PCI */ |
98 | 97 | { AU1550_DSCR_CMD0_NAND_FLASH, 0, 0, 0, 0x00000000, 0, 0 }, /* NAND */ | |
99 | /* PSC 3 */ | ||
100 | { DSCR_CMD0_PSC3_TX, DEV_FLAGS_OUT, 0, 0, 0x10b0001c, 0, 0 }, | ||
101 | { DSCR_CMD0_PSC3_RX, DEV_FLAGS_IN, 0, 0, 0x10b0001c, 0, 0 }, | ||
102 | |||
103 | { DSCR_CMD0_PCI_WRITE, 0, 0, 0, 0x00000000, 0, 0 }, /* PCI */ | ||
104 | { DSCR_CMD0_NAND_FLASH, 0, 0, 0, 0x00000000, 0, 0 }, /* NAND */ | ||
105 | 98 | ||
106 | /* MAC 0 */ | 99 | /* MAC 0 */ |
107 | { DSCR_CMD0_MAC0_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, | 100 | { AU1550_DSCR_CMD0_MAC0_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, |
108 | { DSCR_CMD0_MAC0_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, | 101 | { AU1550_DSCR_CMD0_MAC0_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, |
109 | 102 | ||
110 | /* MAC 1 */ | 103 | /* MAC 1 */ |
111 | { DSCR_CMD0_MAC1_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, | 104 | { AU1550_DSCR_CMD0_MAC1_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, |
112 | { DSCR_CMD0_MAC1_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, | 105 | { AU1550_DSCR_CMD0_MAC1_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, |
113 | |||
114 | #endif /* CONFIG_SOC_AU1550 */ | ||
115 | 106 | ||
116 | #ifdef CONFIG_SOC_AU1200 | 107 | { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, |
117 | { DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, | 108 | { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, |
118 | { DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, | 109 | }; |
119 | { DSCR_CMD0_UART1_TX, DEV_FLAGS_OUT, 0, 8, 0x11200004, 0, 0 }, | ||
120 | { DSCR_CMD0_UART1_RX, DEV_FLAGS_IN, 0, 8, 0x11200000, 0, 0 }, | ||
121 | |||
122 | { DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, | ||
123 | { DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, | ||
124 | 110 | ||
125 | { DSCR_CMD0_MAE_BE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | 111 | static dbdev_tab_t au1200_dbdev_tab[] __initdata = { |
126 | { DSCR_CMD0_MAE_FE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | 112 | { AU1200_DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, |
127 | { DSCR_CMD0_MAE_BOTH, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | 113 | { AU1200_DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, |
128 | { DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | 114 | { AU1200_DSCR_CMD0_UART1_TX, DEV_FLAGS_OUT, 0, 8, 0x11200004, 0, 0 }, |
115 | { AU1200_DSCR_CMD0_UART1_RX, DEV_FLAGS_IN, 0, 8, 0x11200000, 0, 0 }, | ||
129 | 116 | ||
130 | { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 4, 8, 0x10600000, 0, 0 }, | 117 | { AU1200_DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, |
131 | { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 4, 8, 0x10600004, 0, 0 }, | 118 | { AU1200_DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, |
132 | { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 4, 8, 0x10680000, 0, 0 }, | ||
133 | { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 4, 8, 0x10680004, 0, 0 }, | ||
134 | 119 | ||
135 | { DSCR_CMD0_AES_RX, DEV_FLAGS_IN , 4, 32, 0x10300008, 0, 0 }, | 120 | { AU1200_DSCR_CMD0_MAE_BE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, |
136 | { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 4, 32, 0x10300004, 0, 0 }, | 121 | { AU1200_DSCR_CMD0_MAE_FE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, |
122 | { AU1200_DSCR_CMD0_MAE_BOTH, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | ||
123 | { AU1200_DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | ||
137 | 124 | ||
138 | { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 16, 0x11a0001c, 0, 0 }, | 125 | { AU1200_DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 4, 8, 0x10600000, 0, 0 }, |
139 | { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 16, 0x11a0001c, 0, 0 }, | 126 | { AU1200_DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 4, 8, 0x10600004, 0, 0 }, |
140 | { DSCR_CMD0_PSC0_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | 127 | { AU1200_DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 4, 8, 0x10680000, 0, 0 }, |
128 | { AU1200_DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 4, 8, 0x10680004, 0, 0 }, | ||
141 | 129 | ||
142 | { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 16, 0x11b0001c, 0, 0 }, | 130 | { AU1200_DSCR_CMD0_AES_RX, DEV_FLAGS_IN , 4, 32, 0x10300008, 0, 0 }, |
143 | { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 16, 0x11b0001c, 0, 0 }, | 131 | { AU1200_DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 4, 32, 0x10300004, 0, 0 }, |
144 | { DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | ||
145 | 132 | ||
146 | { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 32, 0x14004020, 0, 0 }, | 133 | { AU1200_DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 16, 0x11a0001c, 0, 0 }, |
147 | { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 32, 0x14004040, 0, 0 }, | 134 | { AU1200_DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 16, 0x11a0001c, 0, 0 }, |
148 | { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 32, 0x14004060, 0, 0 }, | 135 | { AU1200_DSCR_CMD0_PSC0_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, |
149 | { DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | 136 | { AU1200_DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 16, 0x11b0001c, 0, 0 }, |
137 | { AU1200_DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 16, 0x11b0001c, 0, 0 }, | ||
138 | { AU1200_DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | ||
150 | 139 | ||
151 | { DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, | 140 | { AU1200_DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 32, 0x14004020, 0, 0 }, |
141 | { AU1200_DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 32, 0x14004040, 0, 0 }, | ||
142 | { AU1200_DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 32, 0x14004060, 0, 0 }, | ||
143 | { AU1200_DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | ||
152 | 144 | ||
153 | #endif /* CONFIG_SOC_AU1200 */ | 145 | { AU1200_DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, |
154 | 146 | ||
155 | { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | 147 | { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, |
156 | { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, | 148 | { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, |
157 | |||
158 | /* Provide 16 user definable device types */ | ||
159 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
160 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
161 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
162 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
163 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
164 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
165 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
166 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
167 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
168 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
169 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
170 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
171 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
172 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
173 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
174 | { ~0, 0, 0, 0, 0, 0, 0 }, | ||
175 | }; | 149 | }; |
176 | 150 | ||
177 | #define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab) | 151 | /* 32 predefined plus 32 custom */ |
178 | 152 | #define DBDEV_TAB_SIZE 64 | |
179 | 153 | ||
180 | static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS]; | 154 | static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS]; |
181 | 155 | ||
@@ -1028,38 +1002,43 @@ static struct syscore_ops alchemy_dbdma_syscore_ops = { | |||
1028 | .resume = alchemy_dbdma_resume, | 1002 | .resume = alchemy_dbdma_resume, |
1029 | }; | 1003 | }; |
1030 | 1004 | ||
1031 | static int __init au1xxx_dbdma_init(void) | 1005 | static int __init dbdma_setup(unsigned int irq, dbdev_tab_t *idtable) |
1032 | { | 1006 | { |
1033 | int irq_nr, ret; | 1007 | int ret; |
1008 | |||
1009 | dbdev_tab = kzalloc(sizeof(dbdev_tab_t) * DBDEV_TAB_SIZE, GFP_KERNEL); | ||
1010 | if (!dbdev_tab) | ||
1011 | return -ENOMEM; | ||
1012 | |||
1013 | memcpy(dbdev_tab, idtable, 32 * sizeof(dbdev_tab_t)); | ||
1014 | for (ret = 32; ret < DBDEV_TAB_SIZE; ret++) | ||
1015 | dbdev_tab[ret].dev_id = ~0; | ||
1034 | 1016 | ||
1035 | dbdma_gptr->ddma_config = 0; | 1017 | dbdma_gptr->ddma_config = 0; |
1036 | dbdma_gptr->ddma_throttle = 0; | 1018 | dbdma_gptr->ddma_throttle = 0; |
1037 | dbdma_gptr->ddma_inten = 0xffff; | 1019 | dbdma_gptr->ddma_inten = 0xffff; |
1038 | au_sync(); | 1020 | au_sync(); |
1039 | 1021 | ||
1040 | switch (alchemy_get_cputype()) { | 1022 | ret = request_irq(irq, dbdma_interrupt, IRQF_DISABLED, "dbdma", |
1041 | case ALCHEMY_CPU_AU1550: | 1023 | (void *)dbdma_gptr); |
1042 | irq_nr = AU1550_DDMA_INT; | ||
1043 | break; | ||
1044 | case ALCHEMY_CPU_AU1200: | ||
1045 | irq_nr = AU1200_DDMA_INT; | ||
1046 | break; | ||
1047 | default: | ||
1048 | return -ENODEV; | ||
1049 | } | ||
1050 | |||
1051 | ret = request_irq(irq_nr, dbdma_interrupt, IRQF_DISABLED, | ||
1052 | "Au1xxx dbdma", (void *)dbdma_gptr); | ||
1053 | if (ret) | 1024 | if (ret) |
1054 | printk(KERN_ERR "Cannot grab DBDMA interrupt!\n"); | 1025 | printk(KERN_ERR "Cannot grab DBDMA interrupt!\n"); |
1055 | else { | 1026 | else { |
1056 | dbdma_initialized = 1; | 1027 | dbdma_initialized = 1; |
1057 | printk(KERN_INFO "Alchemy DBDMA initialized\n"); | ||
1058 | register_syscore_ops(&alchemy_dbdma_syscore_ops); | 1028 | register_syscore_ops(&alchemy_dbdma_syscore_ops); |
1059 | } | 1029 | } |
1060 | 1030 | ||
1061 | return ret; | 1031 | return ret; |
1062 | } | 1032 | } |
1063 | subsys_initcall(au1xxx_dbdma_init); | ||
1064 | 1033 | ||
1065 | #endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */ | 1034 | static int __init alchemy_dbdma_init(void) |
1035 | { | ||
1036 | switch (alchemy_get_cputype()) { | ||
1037 | case ALCHEMY_CPU_AU1550: | ||
1038 | return dbdma_setup(AU1550_DDMA_INT, au1550_dbdev_tab); | ||
1039 | case ALCHEMY_CPU_AU1200: | ||
1040 | return dbdma_setup(AU1200_DDMA_INT, au1200_dbdev_tab); | ||
1041 | } | ||
1042 | return 0; | ||
1043 | } | ||
1044 | subsys_initcall(alchemy_dbdma_init); | ||