diff options
Diffstat (limited to 'arch/arm/mach-omap2/mcbsp.c')
-rw-r--r-- | arch/arm/mach-omap2/mcbsp.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index a846aa1ebb4d..2f3cad6f9402 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -16,12 +16,13 @@ | |||
16 | #include <linux/err.h> | 16 | #include <linux/err.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/slab.h> | ||
19 | 20 | ||
20 | #include <mach/irqs.h> | 21 | #include <mach/irqs.h> |
21 | #include <mach/dma.h> | 22 | #include <plat/dma.h> |
22 | #include <mach/mux.h> | 23 | #include <plat/mux.h> |
23 | #include <mach/cpu.h> | 24 | #include <plat/cpu.h> |
24 | #include <mach/mcbsp.h> | 25 | #include <plat/mcbsp.h> |
25 | 26 | ||
26 | static void omap2_mcbsp2_mux_setup(void) | 27 | static void omap2_mcbsp2_mux_setup(void) |
27 | { | 28 | { |
@@ -65,9 +66,11 @@ static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = { | |||
65 | }, | 66 | }, |
66 | }; | 67 | }; |
67 | #define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata) | 68 | #define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata) |
69 | #define OMAP2420_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
68 | #else | 70 | #else |
69 | #define omap2420_mcbsp_pdata NULL | 71 | #define omap2420_mcbsp_pdata NULL |
70 | #define OMAP2420_MCBSP_PDATA_SZ 0 | 72 | #define OMAP2420_MCBSP_PDATA_SZ 0 |
73 | #define OMAP2420_MCBSP_REG_NUM 0 | ||
71 | #endif | 74 | #endif |
72 | 75 | ||
73 | #ifdef CONFIG_ARCH_OMAP2430 | 76 | #ifdef CONFIG_ARCH_OMAP2430 |
@@ -114,12 +117,14 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { | |||
114 | }, | 117 | }, |
115 | }; | 118 | }; |
116 | #define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata) | 119 | #define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata) |
120 | #define OMAP2430_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
117 | #else | 121 | #else |
118 | #define omap2430_mcbsp_pdata NULL | 122 | #define omap2430_mcbsp_pdata NULL |
119 | #define OMAP2430_MCBSP_PDATA_SZ 0 | 123 | #define OMAP2430_MCBSP_PDATA_SZ 0 |
124 | #define OMAP2430_MCBSP_REG_NUM 0 | ||
120 | #endif | 125 | #endif |
121 | 126 | ||
122 | #ifdef CONFIG_ARCH_OMAP34XX | 127 | #ifdef CONFIG_ARCH_OMAP3 |
123 | static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | 128 | static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { |
124 | { | 129 | { |
125 | .phys_base = OMAP34XX_MCBSP1_BASE, | 130 | .phys_base = OMAP34XX_MCBSP1_BASE, |
@@ -132,6 +137,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
132 | }, | 137 | }, |
133 | { | 138 | { |
134 | .phys_base = OMAP34XX_MCBSP2_BASE, | 139 | .phys_base = OMAP34XX_MCBSP2_BASE, |
140 | .phys_base_st = OMAP34XX_MCBSP2_ST_BASE, | ||
135 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, | 141 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, |
136 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, | 142 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, |
137 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | 143 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, |
@@ -141,6 +147,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
141 | }, | 147 | }, |
142 | { | 148 | { |
143 | .phys_base = OMAP34XX_MCBSP3_BASE, | 149 | .phys_base = OMAP34XX_MCBSP3_BASE, |
150 | .phys_base_st = OMAP34XX_MCBSP3_ST_BASE, | ||
144 | .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX, | 151 | .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX, |
145 | .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX, | 152 | .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX, |
146 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, | 153 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, |
@@ -168,9 +175,11 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
168 | }, | 175 | }, |
169 | }; | 176 | }; |
170 | #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata) | 177 | #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata) |
178 | #define OMAP34XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
171 | #else | 179 | #else |
172 | #define omap34xx_mcbsp_pdata NULL | 180 | #define omap34xx_mcbsp_pdata NULL |
173 | #define OMAP34XX_MCBSP_PDATA_SZ 0 | 181 | #define OMAP34XX_MCBSP_PDATA_SZ 0 |
182 | #define OMAP34XX_MCBSP_REG_NUM 0 | ||
174 | #endif | 183 | #endif |
175 | 184 | ||
176 | static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { | 185 | static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { |
@@ -208,17 +217,23 @@ static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { | |||
208 | }, | 217 | }, |
209 | }; | 218 | }; |
210 | #define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata) | 219 | #define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata) |
220 | #define OMAP44XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
211 | 221 | ||
212 | static int __init omap2_mcbsp_init(void) | 222 | static int __init omap2_mcbsp_init(void) |
213 | { | 223 | { |
214 | if (cpu_is_omap2420()) | 224 | if (cpu_is_omap2420()) { |
215 | omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ; | 225 | omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ; |
216 | if (cpu_is_omap2430()) | 226 | omap_mcbsp_cache_size = OMAP2420_MCBSP_REG_NUM * sizeof(u16); |
227 | } else if (cpu_is_omap2430()) { | ||
217 | omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; | 228 | omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; |
218 | if (cpu_is_omap34xx()) | 229 | omap_mcbsp_cache_size = OMAP2430_MCBSP_REG_NUM * sizeof(u32); |
230 | } else if (cpu_is_omap34xx()) { | ||
219 | omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; | 231 | omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; |
220 | if (cpu_is_omap44xx()) | 232 | omap_mcbsp_cache_size = OMAP34XX_MCBSP_REG_NUM * sizeof(u32); |
233 | } else if (cpu_is_omap44xx()) { | ||
221 | omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ; | 234 | omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ; |
235 | omap_mcbsp_cache_size = OMAP44XX_MCBSP_REG_NUM * sizeof(u32); | ||
236 | } | ||
222 | 237 | ||
223 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), | 238 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), |
224 | GFP_KERNEL); | 239 | GFP_KERNEL); |