From: Carlos Aguiar <carlos.aguiar@indt.org.br>
To: omap-linux <linux-omap-open-source@linux.omap.com>
Subject: [PATCH 08/14] PLAT: OMAP: Modifications at devices.c to use multislot structures
Date: Thu, 20 Sep 2007 11:03:35 -0400 [thread overview]
Message-ID: <46F28BC7.80309@indt.org.br> (raw)
From: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Modifications at arch/arm/plat-omap/devices.c to use multislot structures.
Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Signed-off-by: Felipe Balbi <felipe.lima@indt.org.br>
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
---
arch/arm/plat-omap/devices.c | 52 ++++++++++++++++++++---------------------
1 files changed, 25 insertions(+), 27 deletions(-)
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index c2828fe..3f6a6af 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -21,6 +21,7 @@
#include <asm/arch/tc.h>
#include <asm/arch/board.h>
+#include <asm/arch/mmc.h>
#include <asm/arch/mux.h>
#include <asm/arch/gpio.h>
#include <asm/arch/menelaus.h>
@@ -231,7 +232,7 @@ static inline void omap_init_kp(void) {}
#endif
#define OMAP_MMC2_BASE 0xfffb7c00 /* omap16xx only */
-static struct omap_mmc_conf mmc1_conf;
+static struct omap_mmc_platform_data mmc1_data;
static u64 mmc1_dmamask = 0xffffffff;
@@ -252,7 +253,7 @@ static struct platform_device mmc_omap_device1 = {
.id = 1,
.dev = {
.dma_mask = &mmc1_dmamask,
- .platform_data = &mmc1_conf,
+ .platform_data = &mmc1_data,
},
.num_resources = ARRAY_SIZE(mmc1_resources),
.resource = mmc1_resources,
@@ -260,7 +261,7 @@ static struct platform_device mmc_omap_device1 = {
#ifdef CONFIG_ARCH_OMAP16XX
-static struct omap_mmc_conf mmc2_conf;
+static struct omap_mmc_platform_data mmc2_data;
static u64 mmc2_dmamask = 0xffffffff;
@@ -282,7 +283,7 @@ static struct platform_device mmc_omap_device2 = {
.id = 2,
.dev = {
.dma_mask = &mmc2_dmamask,
- .platform_data = &mmc2_conf,
+ .platform_data = &mmc2_data,
},
.num_resources = ARRAY_SIZE(mmc2_resources),
.resource = mmc2_resources,
@@ -291,20 +292,13 @@ static struct platform_device mmc_omap_device2 = {
static void __init omap_init_mmc(void)
{
- const struct omap_mmc_config *mmc_conf;
- const struct omap_mmc_conf *mmc;
+ const struct omap_mmc_platform_data *mmc;
/* REVISIT: 2430 has HS MMC */
if (cpu_is_omap2430() || cpu_is_omap34xx())
return;
- /* NOTE: assumes MMC was never (wrongly) enabled */
- mmc_conf = omap_get_config(OMAP_TAG_MMC, struct omap_mmc_config);
- if (!mmc_conf)
- return;
-
- /* block 1 is always available and has just one pinout option */
- mmc = &mmc_conf->mmc[0];
+ mmc = &mmc1_data;
if (mmc->enabled) {
if (cpu_is_omap24xx()) {
omap_cfg_reg(H18_24XX_MMC_CMD);
@@ -339,24 +333,12 @@ static void __init omap_init_mmc(void)
omap_cfg_reg(MMC_DAT3);
}
}
- if (mmc->internal_clock) {
- /*
- * Use internal loop-back in MMC/SDIO
- * Module Input Clock selection
- */
- if (cpu_is_omap24xx()) {
- u32 v = omap_readl(OMAP2_CONTROL_DEVCONF);
- v |= (1 << 24);
- omap_writel(v, OMAP2_CONTROL_DEVCONF);
- }
- }
- mmc1_conf = *mmc;
(void) platform_device_register(&mmc_omap_device1);
}
#ifdef CONFIG_ARCH_OMAP16XX
/* block 2 is on newer chips, and has many pinout options */
- mmc = &mmc_conf->mmc[1];
+ mmc = &mmc2_data;
if (mmc->enabled) {
if (!mmc->nomux) {
omap_cfg_reg(Y8_1610_MMC2_CMD);
@@ -379,12 +361,28 @@ static void __init omap_init_mmc(void)
if (cpu_is_omap1710())
omap_writel(omap_readl(MOD_CONF_CTRL_1) | (1 << 24),
MOD_CONF_CTRL_1);
- mmc2_conf = *mmc;
(void) platform_device_register(&mmc_omap_device2);
}
#endif
return;
}
+
+void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info)
+{
+ switch (host) {
+ case 1:
+ mmc1_data = *info;
+ break;
+#ifdef CONFIG_ARCH_OMAP16XX
+ case 2:
+ mmc2_data = *info;
+ break;
+#endif
+ default:
+ BUG();
+ }
+}
+
#else
static inline void omap_init_mmc(void) {}
#endif
-- 1.5.3.GIT
next reply other threads:[~2007-09-20 15:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-20 15:03 Carlos Aguiar [this message]
2007-11-01 12:55 ` [PATCH 08/14] PLAT: OMAP: Modifications at devices.c to use multislot structures Tony Lindgren
2007-11-01 13:30 ` SPI slave / receive w/ DMA failing Heilpern, Mark
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=46F28BC7.80309@indt.org.br \
--to=carlos.aguiar@indt.org.br \
--cc=linux-omap-open-source@linux.omap.com \
/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 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.