diff options
Diffstat (limited to 'arch/arm/plat-omap/devices.c')
-rw-r--r-- | arch/arm/plat-omap/devices.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index 4a53f9ba6c43..81002b722da1 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/arch/mux.h> | 24 | #include <asm/arch/mux.h> |
25 | #include <asm/arch/gpio.h> | 25 | #include <asm/arch/gpio.h> |
26 | #include <asm/arch/menelaus.h> | 26 | #include <asm/arch/menelaus.h> |
27 | #include <asm/arch/mcbsp.h> | ||
27 | 28 | ||
28 | #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) | 29 | #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) |
29 | 30 | ||
@@ -145,6 +146,53 @@ static inline void omap_init_kp(void) {} | |||
145 | #endif | 146 | #endif |
146 | 147 | ||
147 | /*-------------------------------------------------------------------------*/ | 148 | /*-------------------------------------------------------------------------*/ |
149 | #if defined(CONFIG_OMAP_MCBSP) || defined(CONFIG_OMAP_MCBSP_MODULE) | ||
150 | |||
151 | static struct platform_device **omap_mcbsp_devices; | ||
152 | |||
153 | void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, | ||
154 | int size) | ||
155 | { | ||
156 | int i; | ||
157 | |||
158 | if (size > OMAP_MAX_MCBSP_COUNT) { | ||
159 | printk(KERN_WARNING "Registered too many McBSPs platform_data." | ||
160 | " Using maximum (%d) available.\n", | ||
161 | OMAP_MAX_MCBSP_COUNT); | ||
162 | size = OMAP_MAX_MCBSP_COUNT; | ||
163 | } | ||
164 | |||
165 | omap_mcbsp_devices = kzalloc(size * sizeof(struct platform_device *), | ||
166 | GFP_KERNEL); | ||
167 | if (!omap_mcbsp_devices) { | ||
168 | printk(KERN_ERR "Could not register McBSP devices\n"); | ||
169 | return; | ||
170 | } | ||
171 | |||
172 | for (i = 0; i < size; i++) { | ||
173 | struct platform_device *new_mcbsp; | ||
174 | int ret; | ||
175 | |||
176 | new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1); | ||
177 | if (!new_mcbsp) | ||
178 | continue; | ||
179 | new_mcbsp->dev.platform_data = &config[i]; | ||
180 | ret = platform_device_add(new_mcbsp); | ||
181 | if (ret) { | ||
182 | platform_device_put(new_mcbsp); | ||
183 | continue; | ||
184 | } | ||
185 | omap_mcbsp_devices[i] = new_mcbsp; | ||
186 | } | ||
187 | } | ||
188 | |||
189 | #else | ||
190 | void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, | ||
191 | int size) | ||
192 | { } | ||
193 | #endif | ||
194 | |||
195 | /*-------------------------------------------------------------------------*/ | ||
148 | 196 | ||
149 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) | 197 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) |
150 | 198 | ||