diff options
Diffstat (limited to 'arch/arm/mach-omap2/mcbsp.c')
-rw-r--r-- | arch/arm/mach-omap2/mcbsp.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index 4b6e5157520f..d601f9405d11 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -65,9 +65,11 @@ static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = { | |||
65 | }, | 65 | }, |
66 | }; | 66 | }; |
67 | #define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata) | 67 | #define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata) |
68 | #define OMAP2420_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
68 | #else | 69 | #else |
69 | #define omap2420_mcbsp_pdata NULL | 70 | #define omap2420_mcbsp_pdata NULL |
70 | #define OMAP2420_MCBSP_PDATA_SZ 0 | 71 | #define OMAP2420_MCBSP_PDATA_SZ 0 |
72 | #define OMAP2420_MCBSP_REG_NUM 0 | ||
71 | #endif | 73 | #endif |
72 | 74 | ||
73 | #ifdef CONFIG_ARCH_OMAP2430 | 75 | #ifdef CONFIG_ARCH_OMAP2430 |
@@ -114,9 +116,11 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { | |||
114 | }, | 116 | }, |
115 | }; | 117 | }; |
116 | #define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata) | 118 | #define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata) |
119 | #define OMAP2430_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
117 | #else | 120 | #else |
118 | #define omap2430_mcbsp_pdata NULL | 121 | #define omap2430_mcbsp_pdata NULL |
119 | #define OMAP2430_MCBSP_PDATA_SZ 0 | 122 | #define OMAP2430_MCBSP_PDATA_SZ 0 |
123 | #define OMAP2430_MCBSP_REG_NUM 0 | ||
120 | #endif | 124 | #endif |
121 | 125 | ||
122 | #ifdef CONFIG_ARCH_OMAP3 | 126 | #ifdef CONFIG_ARCH_OMAP3 |
@@ -168,9 +172,11 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
168 | }, | 172 | }, |
169 | }; | 173 | }; |
170 | #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata) | 174 | #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata) |
175 | #define OMAP34XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
171 | #else | 176 | #else |
172 | #define omap34xx_mcbsp_pdata NULL | 177 | #define omap34xx_mcbsp_pdata NULL |
173 | #define OMAP34XX_MCBSP_PDATA_SZ 0 | 178 | #define OMAP34XX_MCBSP_PDATA_SZ 0 |
179 | #define OMAP34XX_MCBSP_REG_NUM 0 | ||
174 | #endif | 180 | #endif |
175 | 181 | ||
176 | static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { | 182 | static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { |
@@ -208,17 +214,23 @@ static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { | |||
208 | }, | 214 | }, |
209 | }; | 215 | }; |
210 | #define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata) | 216 | #define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata) |
217 | #define OMAP44XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
211 | 218 | ||
212 | static int __init omap2_mcbsp_init(void) | 219 | static int __init omap2_mcbsp_init(void) |
213 | { | 220 | { |
214 | if (cpu_is_omap2420()) | 221 | if (cpu_is_omap2420()) { |
215 | omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ; | 222 | omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ; |
216 | if (cpu_is_omap2430()) | 223 | omap_mcbsp_cache_size = OMAP2420_MCBSP_REG_NUM * sizeof(u16); |
224 | } else if (cpu_is_omap2430()) { | ||
217 | omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; | 225 | omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; |
218 | if (cpu_is_omap34xx()) | 226 | omap_mcbsp_cache_size = OMAP2430_MCBSP_REG_NUM * sizeof(u32); |
227 | } else if (cpu_is_omap34xx()) { | ||
219 | omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; | 228 | omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; |
220 | if (cpu_is_omap44xx()) | 229 | omap_mcbsp_cache_size = OMAP34XX_MCBSP_REG_NUM * sizeof(u32); |
230 | } else if (cpu_is_omap44xx()) { | ||
221 | omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ; | 231 | omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ; |
232 | omap_mcbsp_cache_size = OMAP44XX_MCBSP_REG_NUM * sizeof(u32); | ||
233 | } | ||
222 | 234 | ||
223 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), | 235 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), |
224 | GFP_KERNEL); | 236 | GFP_KERNEL); |