From: Dong Aisheng <b29396@freescale.com>
To: alsa-devel@alsa-project.org
Cc: s.hauer@pengutronix.de, broonie@opensource.wolfsonmicro.com,
w.sang@pengutronix.de, u.kleine-koenig@pengutronix.de,
lrg@ti.com, linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/3] ARM: mx28evk: add platform data for saif
Date: Mon, 26 Sep 2011 23:52:32 +0800 [thread overview]
Message-ID: <1317052353-6029-3-git-send-email-b29396@freescale.com> (raw)
In-Reply-To: <1317052353-6029-1-git-send-email-b29396@freescale.com>
This is for supporting saif record function.
Signed-off-by: Dong Aisheng <b29396@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@ti.com>
---
Changes since v2:
* separate clkmux code into another patch
* A few minus fixes suggested by Uwe & Wolfram.
Changes since v1:
* move saif clkmux code into mach-specific part
---
arch/arm/mach-mxs/devices-mx28.h | 3 ++-
arch/arm/mach-mxs/devices/platform-mxs-saif.c | 5 +++--
arch/arm/mach-mxs/include/mach/common.h | 2 ++
arch/arm/mach-mxs/include/mach/devices-common.h | 4 +++-
arch/arm/mach-mxs/mach-mx28evk.c | 16 ++++++++++++++--
5 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h
index c888710..4f50094 100644
--- a/arch/arm/mach-mxs/devices-mx28.h
+++ b/arch/arm/mach-mxs/devices-mx28.h
@@ -47,6 +47,7 @@ struct platform_device *__init mx28_add_mxsfb(
const struct mxsfb_platform_data *pdata);
extern const struct mxs_saif_data mx28_saif_data[] __initconst;
-#define mx28_add_saif(id) mxs_add_saif(&mx28_saif_data[id])
+#define mx28_add_saif(id, pdata) \
+ mxs_add_saif(&mx28_saif_data[id], pdata)
struct platform_device *__init mx28_add_rtc_stmp3xxx(void);
diff --git a/arch/arm/mach-mxs/devices/platform-mxs-saif.c b/arch/arm/mach-mxs/devices/platform-mxs-saif.c
index 1ec965e..f6e3a60 100644
--- a/arch/arm/mach-mxs/devices/platform-mxs-saif.c
+++ b/arch/arm/mach-mxs/devices/platform-mxs-saif.c
@@ -32,7 +32,8 @@ const struct mxs_saif_data mx28_saif_data[] __initconst = {
};
#endif
-struct platform_device *__init mxs_add_saif(const struct mxs_saif_data *data)
+struct platform_device *__init mxs_add_saif(const struct mxs_saif_data *data,
+ const struct mxs_saif_platform_data *pdata)
{
struct resource res[] = {
{
@@ -56,5 +57,5 @@ struct platform_device *__init mxs_add_saif(const struct mxs_saif_data *data)
};
return mxs_add_platform_device("mxs-saif", data->id, res,
- ARRAY_SIZE(res), NULL, 0);
+ ARRAY_SIZE(res), pdata, sizeof(*pdata));
}
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
index 635bb5d..bf91a10 100644
--- a/arch/arm/mach-mxs/include/mach/common.h
+++ b/arch/arm/mach-mxs/include/mach/common.h
@@ -29,4 +29,6 @@ extern void mx28_init_irq(void);
extern void icoll_init_irq(void);
+extern int mxs_saif_clkmux_select(unsigned int clkmux);
+extern int mxs_get_saif_clk_master_id(unsigned int saif_id);
#endif /* __MACH_MXS_COMMON_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h
index a8080f4..dc369c1 100644
--- a/arch/arm/mach-mxs/include/mach/devices-common.h
+++ b/arch/arm/mach-mxs/include/mach/devices-common.h
@@ -94,6 +94,7 @@ struct platform_device *__init mxs_add_mxs_pwm(
resource_size_t iobase, int id);
/* saif */
+#include <sound/saif.h>
struct mxs_saif_data {
int id;
resource_size_t iobase;
@@ -103,4 +104,5 @@ struct mxs_saif_data {
};
struct platform_device *__init mxs_add_saif(
- const struct mxs_saif_data *data);
+ const struct mxs_saif_data *data,
+ const struct mxs_saif_platform_data *pdata);
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
index 4a3cca3..5aab344 100644
--- a/arch/arm/mach-mxs/mach-mx28evk.c
+++ b/arch/arm/mach-mxs/mach-mx28evk.c
@@ -28,6 +28,7 @@
#include <mach/common.h>
#include <mach/iomux-mx28.h>
+#include <mach/digctl.h>
#include "devices-mx28.h"
@@ -417,6 +418,17 @@ static void __init mx28evk_add_regulators(void)
static void __init mx28evk_add_regulators(void) {}
#endif
+static int mx28evk_mxs_saif_pinit(void)
+{
+ return mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
+}
+
+static const struct mxs_saif_platform_data
+ mx28evk_mxs_saif_pdata __initconst = {
+ .init = mx28evk_mxs_saif_pinit,
+ .get_master_id = mxs_get_saif_clk_master_id,
+};
+
static void __init mx28evk_init(void)
{
int ret;
@@ -457,8 +469,8 @@ static void __init mx28evk_init(void)
mx28_add_mxsfb(&mx28evk_mxsfb_pdata);
- mx28_add_saif(0);
- mx28_add_saif(1);
+ mx28_add_saif(0, &mx28evk_mxs_saif_pdata);
+ mx28_add_saif(1, &mx28evk_mxs_saif_pdata);
mx28_add_mxs_i2c(0);
i2c_register_board_info(0, mxs_i2c0_board_info,
--
1.7.0.4
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2011-09-26 15:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-26 15:52 [PATCH v3 0/3] ARM: mxs: add recording support for saif Dong Aisheng
2011-09-26 15:52 ` [PATCH v3 1/3] ARM: mxs: add saif clkmux functions Dong Aisheng
2011-11-09 11:35 ` Sascha Hauer
2011-11-09 13:48 ` Dong Aisheng-B29396
2011-09-26 15:52 ` Dong Aisheng [this message]
2011-09-26 15:52 ` [PATCH v3 3/3] ARM: mx28evk: set a initial clock rate for saif Dong Aisheng
2011-10-11 13:39 ` [PATCH v3 0/3] ARM: mxs: add recording support " Dong Aisheng
2011-11-09 7:28 ` Dong Aisheng
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=1317052353-6029-3-git-send-email-b29396@freescale.com \
--to=b29396@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=lrg@ti.com \
--cc=s.hauer@pengutronix.de \
--cc=u.kleine-koenig@pengutronix.de \
--cc=w.sang@pengutronix.de \
/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).