aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2009-09-24 19:23:05 -0400
committerTony Lindgren <tony@atomide.com>2009-09-24 19:23:05 -0400
commitaf41a12f09cf78498f63d5cd726d604739671001 (patch)
tree51f0b64a82dcfeb8677098be7891c3186ae3a853 /arch
parent5328ae3af18b16df758df1bcb28fb5e1ad56d97a (diff)
omap: Fix mcspi compile for 2420
Commit 7869c0b9ed44404bbc675ef76f8ccb3be5496f39 added support for additional McSPI ports. Unfortunately that broke compile for 2420. Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/devices.c65
1 files changed, 48 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index bcfcfc7fdb9b..faf7a1e0c525 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -355,29 +355,60 @@ static struct platform_device omap2_mcspi4 = {
355}; 355};
356#endif 356#endif
357 357
358static void omap_init_mcspi(void) 358#ifdef CONFIG_ARCH_OMAP4
359static inline void omap4_mcspi_fixup(void)
359{ 360{
360 if (cpu_is_omap44xx()) { 361 omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE;
361 omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE; 362 omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff;
362 omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff; 363 omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE;
363 omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE; 364 omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff;
364 omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff; 365 omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE;
365 omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE; 366 omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff;
366 omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff; 367 omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE;
367 omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE; 368 omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff;
368 omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff; 369}
369 } 370#else
370 platform_device_register(&omap2_mcspi1); 371static inline void omap4_mcspi_fixup(void)
371 platform_device_register(&omap2_mcspi2); 372{
373}
374#endif
375
372#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ 376#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
373 defined(CONFIG_ARCH_OMAP4) 377 defined(CONFIG_ARCH_OMAP4)
374 if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx()) 378static inline void omap2_mcspi3_init(void)
375 platform_device_register(&omap2_mcspi3); 379{
380 platform_device_register(&omap2_mcspi3);
381}
382#else
383static inline void omap2_mcspi3_init(void)
384{
385}
376#endif 386#endif
387
377#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 388#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
378 if (cpu_is_omap343x() || cpu_is_omap44xx()) 389static inline void omap2_mcspi4_init(void)
379 platform_device_register(&omap2_mcspi4); 390{
391 platform_device_register(&omap2_mcspi4);
392}
393#else
394static inline void omap2_mcspi4_init(void)
395{
396}
380#endif 397#endif
398
399static void omap_init_mcspi(void)
400{
401 if (cpu_is_omap44xx())
402 omap4_mcspi_fixup();
403
404 platform_device_register(&omap2_mcspi1);
405 platform_device_register(&omap2_mcspi2);
406
407 if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx())
408 omap2_mcspi3_init();
409
410 if (cpu_is_omap343x() || cpu_is_omap44xx())
411 omap2_mcspi4_init();
381} 412}
382 413
383#else 414#else