diff options
Diffstat (limited to 'arch/arm/mach-omap1/mcbsp.c')
-rw-r--r-- | arch/arm/mach-omap1/mcbsp.c | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c index 505d98cfe508..e9bdff192f82 100644 --- a/arch/arm/mach-omap1/mcbsp.c +++ b/arch/arm/mach-omap1/mcbsp.c | |||
@@ -16,13 +16,14 @@ | |||
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 | #include <mach/dsp_common.h> | 26 | #include <plat/dsp_common.h> |
26 | 27 | ||
27 | #define DPS_RSTCT2_PER_EN (1 << 0) | 28 | #define DPS_RSTCT2_PER_EN (1 << 0) |
28 | #define DSP_RSTCT2_WD_PER_EN (1 << 1) | 29 | #define DSP_RSTCT2_WD_PER_EN (1 << 1) |
@@ -79,29 +80,31 @@ static struct omap_mcbsp_ops omap1_mcbsp_ops = { | |||
79 | .free = omap1_mcbsp_free, | 80 | .free = omap1_mcbsp_free, |
80 | }; | 81 | }; |
81 | 82 | ||
82 | #ifdef CONFIG_ARCH_OMAP730 | 83 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
83 | static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = { | 84 | static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = { |
84 | { | 85 | { |
85 | .phys_base = OMAP730_MCBSP1_BASE, | 86 | .phys_base = OMAP7XX_MCBSP1_BASE, |
86 | .dma_rx_sync = OMAP_DMA_MCBSP1_RX, | 87 | .dma_rx_sync = OMAP_DMA_MCBSP1_RX, |
87 | .dma_tx_sync = OMAP_DMA_MCBSP1_TX, | 88 | .dma_tx_sync = OMAP_DMA_MCBSP1_TX, |
88 | .rx_irq = INT_730_McBSP1RX, | 89 | .rx_irq = INT_7XX_McBSP1RX, |
89 | .tx_irq = INT_730_McBSP1TX, | 90 | .tx_irq = INT_7XX_McBSP1TX, |
90 | .ops = &omap1_mcbsp_ops, | 91 | .ops = &omap1_mcbsp_ops, |
91 | }, | 92 | }, |
92 | { | 93 | { |
93 | .phys_base = OMAP730_MCBSP2_BASE, | 94 | .phys_base = OMAP7XX_MCBSP2_BASE, |
94 | .dma_rx_sync = OMAP_DMA_MCBSP3_RX, | 95 | .dma_rx_sync = OMAP_DMA_MCBSP3_RX, |
95 | .dma_tx_sync = OMAP_DMA_MCBSP3_TX, | 96 | .dma_tx_sync = OMAP_DMA_MCBSP3_TX, |
96 | .rx_irq = INT_730_McBSP2RX, | 97 | .rx_irq = INT_7XX_McBSP2RX, |
97 | .tx_irq = INT_730_McBSP2TX, | 98 | .tx_irq = INT_7XX_McBSP2TX, |
98 | .ops = &omap1_mcbsp_ops, | 99 | .ops = &omap1_mcbsp_ops, |
99 | }, | 100 | }, |
100 | }; | 101 | }; |
101 | #define OMAP730_MCBSP_PDATA_SZ ARRAY_SIZE(omap730_mcbsp_pdata) | 102 | #define OMAP7XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap7xx_mcbsp_pdata) |
103 | #define OMAP7XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) | ||
102 | #else | 104 | #else |
103 | #define omap730_mcbsp_pdata NULL | 105 | #define omap7xx_mcbsp_pdata NULL |
104 | #define OMAP730_MCBSP_PDATA_SZ 0 | 106 | #define OMAP7XX_MCBSP_PDATA_SZ 0 |
107 | #define OMAP7XX_MCBSP_REG_NUM 0 | ||
105 | #endif | 108 | #endif |
106 | 109 | ||
107 | #ifdef CONFIG_ARCH_OMAP15XX | 110 | #ifdef CONFIG_ARCH_OMAP15XX |
@@ -132,9 +135,11 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { | |||
132 | }, | 135 | }, |
133 | }; | 136 | }; |
134 | #define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata) | 137 | #define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata) |
138 | #define OMAP15XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) | ||
135 | #else | 139 | #else |
136 | #define omap15xx_mcbsp_pdata NULL | 140 | #define omap15xx_mcbsp_pdata NULL |
137 | #define OMAP15XX_MCBSP_PDATA_SZ 0 | 141 | #define OMAP15XX_MCBSP_PDATA_SZ 0 |
142 | #define OMAP15XX_MCBSP_REG_NUM 0 | ||
138 | #endif | 143 | #endif |
139 | 144 | ||
140 | #ifdef CONFIG_ARCH_OMAP16XX | 145 | #ifdef CONFIG_ARCH_OMAP16XX |
@@ -165,28 +170,34 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { | |||
165 | }, | 170 | }, |
166 | }; | 171 | }; |
167 | #define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata) | 172 | #define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata) |
173 | #define OMAP16XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) | ||
168 | #else | 174 | #else |
169 | #define omap16xx_mcbsp_pdata NULL | 175 | #define omap16xx_mcbsp_pdata NULL |
170 | #define OMAP16XX_MCBSP_PDATA_SZ 0 | 176 | #define OMAP16XX_MCBSP_PDATA_SZ 0 |
177 | #define OMAP16XX_MCBSP_REG_NUM 0 | ||
171 | #endif | 178 | #endif |
172 | 179 | ||
173 | int __init omap1_mcbsp_init(void) | 180 | int __init omap1_mcbsp_init(void) |
174 | { | 181 | { |
175 | if (cpu_is_omap730()) | 182 | if (cpu_is_omap7xx()) { |
176 | omap_mcbsp_count = OMAP730_MCBSP_PDATA_SZ; | 183 | omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ; |
177 | if (cpu_is_omap15xx()) | 184 | omap_mcbsp_cache_size = OMAP7XX_MCBSP_REG_NUM * sizeof(u16); |
185 | } else if (cpu_is_omap15xx()) { | ||
178 | omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ; | 186 | omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ; |
179 | if (cpu_is_omap16xx()) | 187 | omap_mcbsp_cache_size = OMAP15XX_MCBSP_REG_NUM * sizeof(u16); |
188 | } else if (cpu_is_omap16xx()) { | ||
180 | omap_mcbsp_count = OMAP16XX_MCBSP_PDATA_SZ; | 189 | omap_mcbsp_count = OMAP16XX_MCBSP_PDATA_SZ; |
190 | omap_mcbsp_cache_size = OMAP16XX_MCBSP_REG_NUM * sizeof(u16); | ||
191 | } | ||
181 | 192 | ||
182 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), | 193 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), |
183 | GFP_KERNEL); | 194 | GFP_KERNEL); |
184 | if (!mcbsp_ptr) | 195 | if (!mcbsp_ptr) |
185 | return -ENOMEM; | 196 | return -ENOMEM; |
186 | 197 | ||
187 | if (cpu_is_omap730()) | 198 | if (cpu_is_omap7xx()) |
188 | omap_mcbsp_register_board_cfg(omap730_mcbsp_pdata, | 199 | omap_mcbsp_register_board_cfg(omap7xx_mcbsp_pdata, |
189 | OMAP730_MCBSP_PDATA_SZ); | 200 | OMAP7XX_MCBSP_PDATA_SZ); |
190 | 201 | ||
191 | if (cpu_is_omap15xx()) | 202 | if (cpu_is_omap15xx()) |
192 | omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, | 203 | omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, |