Skip to contentSkip to conversation

ASoC: multi-comp: OMAP platform fixes

PATCH Superseded Peter Ujfalusi 5 participants 15 messages Aug 6, 2010 – Aug 10, 2010

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover ASoC: multi-comp: OMAP platform fixes

Hello,

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.

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           |   24 +++++++++++++++
 arch/arm/mach-omap2/devices.c           |   50 ++++++++++++++++--------------
 arch/arm/plat-omap/include/plat/mcbsp.h |    7 ++++
 3 files changed, 58 insertions(+), 23 deletions(-)

--
1.7.2

#1 lore raw

PATCH 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 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 |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
arch/arm/mach-omap1/devices.c +24 -0
index 379100c..523bbc4 100644
@@ -267,6 +267,29 @@ 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);
+	platform_device_register(&omap_mcbsp3);
+	platform_device_register(&omap_pcm);
+}
+
+#else
+static inline void omap_init_audio(void) {}
+#endif
+
 /*-------------------------------------------------------------------------*/
 
 /*
@@ -299,6 +322,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

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

Quoted 13 lines · On Friday 06 August 2010 10:39:14 Ujfalusi Peter (Nokia-MS/Tampere) wrote:

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 |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
arch/arm/mach-omap1/devices.c +0 -0
index 379100c..523bbc4 100644

arch/arm/mach-omap1/devices.c static inline void omap_init_sti(void) · line 268

Quoted 2 lines
arch/arm/mach-omap1/devices.c +0 -0
@@ -267,6 +267,29 @@ static inline void omap_init_sti(void)
 static inline void omap_init_sti(void) {}
 #endif

Hmm,

+#include <plat/mcbsp.h>

Might help at compile time ;)

Liam, would you be so kind to fix this is you take the series. I could as well resend...

Thanks,
Péter

Quoted 36 lines
arch/arm/mach-omap1/devices.c +24 -1
+#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);
+	platform_device_register(&omap_mcbsp3);
+	platform_device_register(&omap_pcm);
+}
+
+#else
+static inline void omap_init_audio(void) {}
+#endif
+
 /*------------------------------------------------------------------------
-*/
 
 /*
@@ -299,6 +322,7 @@ static int __init omap1_init_devices(void)
 	omap_init_rtc();
 	omap_init_spi100k();
 	omap_init_sti();
+	omap_init_audio();
 
 	return 0;
 }
#4 lore raw

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

Quoted 2 lines · On Friday 06 August 2010 10:50:09 Ujfalusi Peter (Nokia-MS/Tampere) wrote:

Liam, would you be so kind to fix this is you take the series. I could as well resend...

I have found one cosmetic problem in the mach-omap2/devices.c changes. I'll resend the series.

BTW: it seams Arun's email address has been changed ([email protected] is not alive)...

Signature · 1 line
Péter
#5 lore raw

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

In reply to Peter Ujfalusi
Quoted 3 lines · On Fri, 6 Aug 2010 10:39:14 +0300 Peter Ujfalusi <[email protected]>…

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 static inline void omap_init_sti(void) · line 288

Quoted 8 lines
arch/arm/mach-omap1/devices.c +8 -0
+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_pcm);
+}
+

Not for sure but according to code only omap15xx and 16xx have three ports, 7xx two and I'm unsure about 8xx. At least cpu_is_omap7xx seems to be valid for both 730 and 850.

Signature · 1 line
Jarkko
#6 lore raw

PATCH 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 |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/devices.c +23 -0
index 758d39b..d78cf6a 100644
@@ -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);
 }
 
Signature · 1 line
1.7.2
#7 lore raw

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

Quoted 4 lines · On Fri, 6 Aug 2010 10:39:15 +0300 Peter Ujfalusi <[email protected]>…

static void omap_init_audio(void)
{

arch/arm/mach-omap2/devices.c +0 -0
 	platform_device_register(&omap_mcbsp1);

arch/arm/mach-omap2/devices.c static struct platform_device omap_pcm = { · line 337

Quoted 10 lines
arch/arm/mach-omap2/devices.c +4 -0
 	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);
 }

This must be done at runtime since we can have multi omap builds now. So use cpu_is_omapxxx instead of conditional compilation. Simplifies patch too :-)

Signature · 1 line
Jarkko
#8 lore raw

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

Quoted 3 lines · On Friday 06 August 2010 11:08:08 ext Jarkko Nikula wrote:

This must be done at runtime since we can have multi omap builds now. So use cpu_is_omapxxx instead of conditional compilation. Simplifies patch too :-)

Yes, you are right, I'll do that.
I'll do the same with OMAP1 (2 vs 3 ports)..

Thanks,
Péter

#9 lore raw
In reply to Peter Ujfalusi

Hi, notes for Arun and Janusz below.

Quoted 6 lines · On Fri, 6 Aug 2010 10:39:12 +0300 Peter Ujfalusi <[email protected]>…

Hello,

The following series introduces some cleanups for OMAP platforms in multi-component branch.

- Enable audio for OMAP1 class

There's a on-going development going on to update ASoC framework. This multi-compont work requires major changes and our problem is that we don't have any OMAP1 boards to test these changes.

We'd glad if you could test these changes with Peter's patches on OMAP1 board.

The ASoC multi-component development happens in
origin/topic/multi-component branch of this tree:

git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6.git

Signature · 1 line
Jarkko
#10 lore raw
Quoted 10 lines · Jarkko Nikula

Hi, notes for Arun and Janusz below.

Quoted 5 lines · On Fri,  6 Aug 2010 10:39:12 +0300 Peter Ujfalusi <[email protected]>…

Hello,

The following series introduces some cleanups for OMAP platforms in multi-component branch.

Quoted 8 lines
Quoted 1 line

- Enable audio for OMAP1 class

There's a on-going development going on to update ASoC framework. This multi-compont work requires major changes and our problem is that we don't have any OMAP1 boards to test these changes.

We'd glad if you could test these changes with Peter's patches on OMAP1 board.

Jarkko,

I m sorry to inform you that I m not having access to OSK anymore. It was with my previous employer.

Arun

Quoted 14 lines

The ASoC multi-component development happens in
origin/topic/multi-component branch of this tree:

git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6.git

--
Jarkko
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#11 lore raw
In reply to Jarkko Nikula
Quoted 16 lines · Friday 06 August 2010 09:56:28 Jarkko Nikula wrote:

Hi, notes for Arun and Janusz below.

On Fri, 6 Aug 2010 10:39:12 +0300

Quoted 6 lines · Peter Ujfalusi

Hello,

The following series introduces some cleanups for OMAP platforms in multi-component branch.

- Enable audio for OMAP1 class

There's a on-going development going on to update ASoC framework. This multi-compont work requires major changes and our problem is that we don't have any OMAP1 boards to test these changes.

Quoted 7 lines

We'd glad if you could test these changes with Peter's patches on OMAP1 board.

The ASoC multi-component development happens in
origin/topic/multi-component branch of this tree:

git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6.git

Hi,
If your request for testing Peter's patches is still valid, what exact tree and branch would you like me to test the patches against? I've tried to locate a tree with the patches already applied by Liam, but failed.

Meanwhile, I've verified that the patches, or their OMAP1 related bits, are harmless when applied against (almost) current l-o master. However, I'm not sure if testing the new platform devices not actually used by any corresponding platform drivers is what you expected.

Thanks,
Janusz

#12 lore raw

Hi

Quoted 4 lines · On Mon, 9 Aug 2010 19:09:57 +0200 Janusz Krzysztofik <[email protected]>…

If your request for testing Peter's patches is still valid, what exact tree and branch would you like me to test the patches against? I've tried to locate a tree with the patches already applied by Liam, but failed.

Sure, we are glad if you can give a test to ASoC multi-component as there are major changes coming and we don't have any omap1 boards to try.

Peter's patches are already integrated into TI OMAP update of multi-component so for you it's just enough to clone the development tree and then going to topic/multi-component branch of it.

git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6.git
and
git checkout -b multi-component_20100809 origin/topic/multi-component

There are no config changes so you should be able to test with your regular .config. It should work as before if everything goes well. There could be probing problems but usually fix is around the struct snd_soc_dai_link in a machine driver (e.g. ams_delta_dai_link).

Signature · 1 line
Jarkko
#13 lore raw
In reply to Janusz Krzysztofik

Hello Janusz,

Quoted 10 lines · On Monday 09 August 2010 20:09:57 ext Janusz Krzysztofik wrote:

Hi,
If your request for testing Peter's patches is still valid, what exact tree and branch would you like me to test the patches against? I've tried to locate a tree with the patches already applied by Liam, but failed.

Meanwhile, I've verified that the patches, or their OMAP1 related bits, are harmless when applied against (almost) current l-o master. However, I'm not sure if testing the new platform devices not actually used by any corresponding platform drivers is what you expected.

Since I do not have access to OMAP1 based boards, I can not test the patch which adds support for ASoC/multi-comp on OMAP1, I would be glad, if you could verify, if it is working on your board.

Liam has squashed the patches, so they are not visible.
In theory you can use your existing config, and the audio shall be working as it used to (before multi-comp).

It would be nice to know, if OMAP1 still works...

Thanks for taking time for this!
Péter

Acked-by on the v1 series
#14 lore raw
In reply to Peter Ujfalusi
Quoted 9 lines · Peter Ujfalusi

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.

from a code point of view only (ie, I've no idea if the definitions are correct for any particular OMAP).