From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: alsa-devel@alsa-project.org
Cc: jkrzyszt@tis.icnet.pl, broonie@opensource.wolfsonmicro.com,
lrg@slimlogic.co.uk
Subject: [PATCH v2 1/3] ASoC: multi-comp: OMAP McBSP: use macro for platform_device
Date: Fri, 6 Aug 2010 14:10:36 +0300 [thread overview]
Message-ID: <1281093038-24247-2-git-send-email-peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <1281093038-24247-1-git-send-email-peter.ujfalusi@nokia.com>
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
next prev parent reply other threads:[~2010-08-06 11:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-06 11:10 [PATCH v2 0/3] ASoC: multi-comp: OMAP platform fixes Peter Ujfalusi
2010-08-06 11:10 ` Peter Ujfalusi [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1281093038-24247-2-git-send-email-peter.ujfalusi@nokia.com \
--to=peter.ujfalusi@nokia.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=jkrzyszt@tis.icnet.pl \
--cc=lrg@slimlogic.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).