Skip to contentSkip to conversation

ASoC: multi-comp: OMAP platform fixes

PATCH Applied Peter Ujfalusi 3 participants 6 messages Aug 6, 2010 – Aug 7, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover 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

#1 lore raw

PATCH v2 1/3 ASoC: multi-comp: OMAP McBSP: use macro for platform_device

Use macro (and define it in the plat/mcbsp.h) to create the omap-mcbsp-dai devices.

---
 arch/arm/mach-omap2/devices.c           |   29 +++++------------------------
 arch/arm/plat-omap/include/plat/mcbsp.h |    7 +++++++
 2 files changed, 12 insertions(+), 24 deletions(-)
arch/arm/mach-omap2/devices.c +5 -24
index 088b050..758d39b 100644
@@ -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)
 {
arch/arm/plat-omap/include/plat/mcbsp.h +7 -0
index b4ff6a1..5b20103 100644
@@ -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
 
Signature · 1 line
1.7.2
#2 lore raw

PATCH v2 2/3 ASoC: multi-comp: OMAP McBSP: Enable audio on OMAP1 platform

In reply to Peter Ujfalusi

OMAP1 class has 3 McBSP ports, if I'm not mistaken. Enable the audio with multi-comp on OMAP1 class.

---
 arch/arm/mach-omap1/devices.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
arch/arm/mach-omap1/devices.c +26 -0
index 379100c..eb98eb8 100644
@@ -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;
 }
Signature · 1 line
1.7.2
#3 lore raw

PATCH v2 3/3 ASoC: multi-comp: OMAP2, 3, 4 McBSP: register correct number of ports

In reply to Peter Ujfalusi

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...

---
 arch/arm/mach-omap2/devices.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/devices.c +13 -4
index 758d39b..f9a5961 100644
@@ -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>
Signature · 1 line
1.7.2
#5 lore raw
In reply to Peter Ujfalusi
Quoted 11 lines · Peter Ujfalusi

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.

Quoted 9 lines

- 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

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk