All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes
@ 2010-08-06 11:10 Peter Ujfalusi
  2010-08-06 11:10 ` [PATCH v2 1/3] ASoC: multi-comp: OMAP McBSP: use macro for platform_device Peter Ujfalusi
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2010-08-06 11:10 UTC (permalink / raw)
  To: alsa-devel; +Cc: jkrzyszt, broonie, lrg

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/3] ASoC: multi-comp: OMAP McBSP: use macro for platform_device
  2010-08-06 11:10 [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes Peter Ujfalusi
@ 2010-08-06 11:10 ` Peter Ujfalusi
  2010-08-06 11:10 ` [PATCH v2 2/3] ASoC: multi-comp: OMAP McBSP: Enable audio on OMAP1 platform Peter Ujfalusi
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2010-08-06 11:10 UTC (permalink / raw)
  To: alsa-devel; +Cc: jkrzyszt, broonie, lrg

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/3] ASoC: multi-comp: OMAP McBSP: Enable audio on OMAP1 platform
  2010-08-06 11:10 [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes Peter Ujfalusi
  2010-08-06 11:10 ` [PATCH v2 1/3] ASoC: multi-comp: OMAP McBSP: use macro for platform_device Peter Ujfalusi
@ 2010-08-06 11:10 ` Peter Ujfalusi
  2010-08-06 11:10 ` [PATCH v2 3/3] ASoC: multi-comp: OMAP2, 3, 4 McBSP: register correct number of ports Peter Ujfalusi
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2010-08-06 11:10 UTC (permalink / raw)
  To: alsa-devel; +Cc: jkrzyszt, broonie, lrg

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;
 }
-- 
1.7.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 3/3] ASoC: multi-comp: OMAP2, 3, 4 McBSP: register correct number of ports
  2010-08-06 11:10 [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes Peter Ujfalusi
  2010-08-06 11:10 ` [PATCH v2 1/3] ASoC: multi-comp: OMAP McBSP: use macro for platform_device Peter Ujfalusi
  2010-08-06 11:10 ` [PATCH v2 2/3] ASoC: multi-comp: OMAP McBSP: Enable audio on OMAP1 platform Peter Ujfalusi
@ 2010-08-06 11:10 ` Peter Ujfalusi
  2010-08-06 12:04 ` [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes Jarkko Nikula
  2010-08-07 12:02 ` Liam Girdwood
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2010-08-06 11:10 UTC (permalink / raw)
  To: alsa-devel; +Cc: jkrzyszt, broonie, lrg

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes
  2010-08-06 11:10 [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes Peter Ujfalusi
                   ` (2 preceding siblings ...)
  2010-08-06 11:10 ` [PATCH v2 3/3] ASoC: multi-comp: OMAP2, 3, 4 McBSP: register correct number of ports Peter Ujfalusi
@ 2010-08-06 12:04 ` Jarkko Nikula
  2010-08-07 12:02 ` Liam Girdwood
  4 siblings, 0 replies; 6+ messages in thread
From: Jarkko Nikula @ 2010-08-06 12:04 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: jkrzyszt, alsa-devel, broonie, lrg

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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes
  2010-08-06 11:10 [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes Peter Ujfalusi
                   ` (3 preceding siblings ...)
  2010-08-06 12:04 ` [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes Jarkko Nikula
@ 2010-08-07 12:02 ` Liam Girdwood
  4 siblings, 0 replies; 6+ messages in thread
From: Liam Girdwood @ 2010-08-07 12:02 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: alsa-devel, broonie, jkrzyszt

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
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-07 12:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-06 11:10 [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes Peter Ujfalusi
2010-08-06 11:10 ` [PATCH v2 1/3] ASoC: multi-comp: OMAP McBSP: use macro for platform_device Peter Ujfalusi
2010-08-06 11:10 ` [PATCH v2 2/3] ASoC: multi-comp: OMAP McBSP: Enable audio on OMAP1 platform Peter Ujfalusi
2010-08-06 11:10 ` [PATCH v2 3/3] ASoC: multi-comp: OMAP2, 3, 4 McBSP: register correct number of ports Peter Ujfalusi
2010-08-06 12:04 ` [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes Jarkko Nikula
2010-08-07 12:02 ` Liam Girdwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.