[alsa-devel] [PATCH 3/3] ASoC: multi-comp: OMAP2, 3, 4 McBSP: register correct number of ports
Peter Ujfalusi
peter.ujfalusi at nokia.com
Fri Aug 6 09:39:15 CEST 2010
Different OMAPs has different number of McBSP ports...
OMAP2420 has 2 McBSP ports
OMAP2430 has 5 McBSP ports
OMAP3 has 5 McBSP ports
OMAP4 has 4 McBSP ports
Since I don't have access to OMAP4 TRM, the number of ports on OMAP4
is guessed based on the original OMAP4 related McBSP code...
Signed-off-by: Peter Ujfalusi <peter.ujfalusi at nokia.com>
---
arch/arm/mach-omap2/devices.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 758d39b..d78cf6a 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -297,19 +297,42 @@ static struct platform_device omap_pcm = {
.id = -1,
};
+/*
+ * OMAP2420 has 2 McBSP ports
+ * OMAP2430 has 5 McBSP ports
+ * OMAP3 has 5 McBSP ports
+ * OMAP4 has 4 McBSP ports
+ */
+#if defined(CONFIG_ARCH_OMAP4) || \
+ defined(CONFIG_ARCH_OMAP3) || \
+ defined(CONFIG_ARCH_OMAP2430)
+#define OMAP_HAS_4_MCBSP_PORTS
+#endif
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP2430)
+#define OMAP_HAS_5_MCBSP_PORTS
+#endif
+
OMAP_MCBSP_PLATFORM_DEVICE(1);
OMAP_MCBSP_PLATFORM_DEVICE(2);
+#ifdef OMAP_HAS_4_MCBSP_PORTS
OMAP_MCBSP_PLATFORM_DEVICE(3);
OMAP_MCBSP_PLATFORM_DEVICE(4);
+#endif
+#ifdef OMAP_HAS_5_MCBSP_PORTS
OMAP_MCBSP_PLATFORM_DEVICE(5);
+#endif
static void omap_init_audio(void)
{
platform_device_register(&omap_mcbsp1);
platform_device_register(&omap_mcbsp2);
+#ifdef OMAP_HAS_4_MCBSP_PORTS
platform_device_register(&omap_mcbsp3);
platform_device_register(&omap_mcbsp4);
+#endif
+#ifdef OMAP_HAS_5_MCBSP_PORTS
platform_device_register(&omap_mcbsp5);
+#endif
platform_device_register(&omap_pcm);
}
--
1.7.2
More information about the Alsa-devel
mailing list