[alsa-devel] [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes
Hello,
Changes since v1: - include plat/mcbsp.c in arch/arm/mach-omap1/devices.c - Runtime port number configuration based on OMAP type (both omap1 and omap2)
Commit message from the first series:
The following series introduces some cleanups for OMAP platforms in multi-component branch.
- Enable audio for OMAP1 class - Registers only the available amount of omap-mcbsp-dai devices for OMAP2,3, and 4
Please do verify, if the chages are correct, especially the number of McBSP ports on different devices.
Liam: in case you take this, you can squash this to the corresponding commit.
Since I do not have access at the moment to OMAP1 based board, the changes has not been tested, but at least it should allow the audio (in theory)..
Peter
--- Peter Ujfalusi (3): ASoC: multi-comp: OMAP McBSP: use macro for platform_device ASoC: multi-comp: OMAP McBSP: Enable audio on OMAP1 platform ASoC: multi-comp: OMAP2,3,4 McBSP: register correct number of ports
arch/arm/mach-omap1/devices.c | 26 +++++++++++++++++ arch/arm/mach-omap2/devices.c | 46 ++++++++++++------------------- arch/arm/plat-omap/include/plat/mcbsp.h | 7 +++++ 3 files changed, 51 insertions(+), 28 deletions(-)
-- 1.7.2
Use macro (and define it in the plat/mcbsp.h) to create the omap-mcbsp-dai devices.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@nokia.com --- arch/arm/mach-omap2/devices.c | 29 +++++------------------------ arch/arm/plat-omap/include/plat/mcbsp.h | 7 +++++++ 2 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 088b050..758d39b 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -297,30 +297,11 @@ static struct platform_device omap_pcm = { .id = -1, };
-static struct platform_device omap_mcbsp1 = { - .name = "omap-mcbsp-dai", - .id = OMAP_MCBSP1, -}; - -static struct platform_device omap_mcbsp2 = { - .name = "omap-mcbsp-dai", - .id = OMAP_MCBSP2, -}; - -static struct platform_device omap_mcbsp3 = { - .name = "omap-mcbsp-dai", - .id = OMAP_MCBSP3, -}; - -static struct platform_device omap_mcbsp4 = { - .name = "omap-mcbsp-dai", - .id = OMAP_MCBSP4, -}; - -static struct platform_device omap_mcbsp5 = { - .name = "omap-mcbsp-dai", - .id = OMAP_MCBSP5, -}; +OMAP_MCBSP_PLATFORM_DEVICE(1); +OMAP_MCBSP_PLATFORM_DEVICE(2); +OMAP_MCBSP_PLATFORM_DEVICE(3); +OMAP_MCBSP_PLATFORM_DEVICE(4); +OMAP_MCBSP_PLATFORM_DEVICE(5);
static void omap_init_audio(void) { diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h index b4ff6a1..5b20103 100644 --- a/arch/arm/plat-omap/include/plat/mcbsp.h +++ b/arch/arm/plat-omap/include/plat/mcbsp.h @@ -30,6 +30,13 @@ #include <mach/hardware.h> #include <plat/clock.h>
+/* macro for building platform_device for McBSP ports */ +#define OMAP_MCBSP_PLATFORM_DEVICE(port_nr) \ +static struct platform_device omap_mcbsp##port_nr = { \ + .name = "omap-mcbsp-dai", \ + .id = OMAP_MCBSP##port_nr, \ +} + #define OMAP7XX_MCBSP1_BASE 0xfffb1000 #define OMAP7XX_MCBSP2_BASE 0xfffb1800
OMAP1 class has 3 McBSP ports, if I'm not mistaken. Enable the audio with multi-comp on OMAP1 class.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@nokia.com --- arch/arm/mach-omap1/devices.c | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c index 379100c..eb98eb8 100644 --- a/arch/arm/mach-omap1/devices.c +++ b/arch/arm/mach-omap1/devices.c @@ -25,6 +25,7 @@ #include <mach/gpio.h> #include <plat/mmc.h> #include <plat/omap7xx.h> +#include <plat/mcbsp.h>
/*-------------------------------------------------------------------------*/
@@ -267,6 +268,30 @@ static inline void omap_init_sti(void) static inline void omap_init_sti(void) {} #endif
+#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE) + +static struct platform_device omap_pcm = { + .name = "omap-pcm-audio", + .id = -1, +}; + +OMAP_MCBSP_PLATFORM_DEVICE(1); +OMAP_MCBSP_PLATFORM_DEVICE(2); +OMAP_MCBSP_PLATFORM_DEVICE(3); + +static void omap_init_audio(void) +{ + platform_device_register(&omap_mcbsp1); + platform_device_register(&omap_mcbsp2); + if (!cpu_is_omap7xx()) + platform_device_register(&omap_mcbsp3); + platform_device_register(&omap_pcm); +} + +#else +static inline void omap_init_audio(void) {} +#endif + /*-------------------------------------------------------------------------*/
/* @@ -299,6 +324,7 @@ static int __init omap1_init_devices(void) omap_init_rtc(); omap_init_spi100k(); omap_init_sti(); + omap_init_audio();
return 0; }
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@nokia.com --- arch/arm/mach-omap2/devices.c | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 758d39b..f9a5961 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -297,6 +297,12 @@ 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 + */ OMAP_MCBSP_PLATFORM_DEVICE(1); OMAP_MCBSP_PLATFORM_DEVICE(2); OMAP_MCBSP_PLATFORM_DEVICE(3); @@ -307,9 +313,13 @@ static void omap_init_audio(void) { platform_device_register(&omap_mcbsp1); platform_device_register(&omap_mcbsp2); - platform_device_register(&omap_mcbsp3); - platform_device_register(&omap_mcbsp4); - platform_device_register(&omap_mcbsp5); + if (cpu_is_omap243x() || cpu_is_omap34xx() || cpu_is_omap44xx()) { + platform_device_register(&omap_mcbsp3); + platform_device_register(&omap_mcbsp4); + } + if (cpu_is_omap243x() || cpu_is_omap34xx()) + platform_device_register(&omap_mcbsp5); + platform_device_register(&omap_pcm); }
@@ -317,7 +327,6 @@ static void omap_init_audio(void) static inline void omap_init_audio(void) {} #endif
- #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
#include <plat/mcspi.h>
On Fri, 6 Aug 2010 14:10:35 +0300 Peter Ujfalusi peter.ujfalusi@nokia.com wrote:
Liam: in case you take this, you can squash this to the corresponding commit.
All in this series:
Acked-by: Jarkko Nikula jhnikula@gmail.com
On Fri, 2010-08-06 at 14:10 +0300, Peter Ujfalusi wrote:
Hello,
Changes since v1:
- include plat/mcbsp.c in arch/arm/mach-omap1/devices.c
- Runtime port number configuration based on OMAP type (both omap1 and omap2)
Commit message from the first series:
The following series introduces some cleanups for OMAP platforms in multi-component branch.
- Enable audio for OMAP1 class
- Registers only the available amount of omap-mcbsp-dai devices for OMAP2,3, and 4
Please do verify, if the chages are correct, especially the number of McBSP ports on different devices.
Liam: in case you take this, you can squash this to the corresponding commit.
Applied.
Thanks
Liam
participants (3)
-
Jarkko Nikula
-
Liam Girdwood
-
Peter Ujfalusi