public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCH  3/4] MMC/SD Controller driver for OMAP2430
@ 2007-12-07 13:50 Madhusudhan Chikkature Rajashekar
  2007-12-10 17:56 ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Madhusudhan Chikkature Rajashekar @ 2007-12-07 13:50 UTC (permalink / raw)
  To: linux-omap-open-source; +Cc: linux-omap

This patch registers the MMC device for OMAP2430/3430.

Signed-off-by: Madhusudhan Chikkature<madhu.cr@ti.com>

---
 arch/arm/plat-omap/devices.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

Index: linux-omap-2.6/arch/arm/plat-omap/devices.c
===================================================================
--- linux-omap-2.6.orig/arch/arm/plat-omap/devices.c	2007-12-06 16:04:39.000000000 +0530
+++ linux-omap-2.6/arch/arm/plat-omap/devices.c	2007-12-07 11:15:50.567693917 +0530
@@ -19,6 +19,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
 
+#include <asm/arch/mmc.h>
 #include <asm/arch/tc.h>
 #include <asm/arch/board.h>
 #include <asm/arch/mmc.h>
@@ -156,7 +157,7 @@
 
 #if	defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
 
-#ifdef CONFIG_ARCH_OMAP24XX
+#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
 #define	OMAP_MMC1_BASE		0x4809c000
 #define OMAP_MMC1_INT		INT_24XX_MMC_IRQ
 #else
@@ -228,10 +229,6 @@
 	const struct omap_mmc_config	*mmc_conf;
 	const struct omap_mmc_conf	*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)
@@ -239,6 +236,15 @@
 
 	/* block 1 is always available and has just one pinout option */
 	mmc = &mmc_conf->mmc[0];
+
+#if     defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430)
+	if (cpu_is_omap2430() || cpu_is_omap34xx()) {
+		if (mmc->enabled)
+			(void) platform_device_register(&mmc_omap_device1);
+		return;
+	}
+#else
 	if (mmc->enabled) {
 		if (cpu_is_omap24xx()) {
 			omap_cfg_reg(H18_24XX_MMC_CMD);
@@ -289,7 +295,7 @@
 		mmc1_data.conf = *mmc;
 		(void) platform_device_register(&mmc_omap_device1);
 	}
-
+#endif
 #ifdef	CONFIG_ARCH_OMAP16XX
 	/* block 2 is on newer chips, and has many pinout options */
 	mmc = &mmc_conf->mmc[1];
@@ -339,6 +345,7 @@
 }
 
 #else
+void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info) {}
 static inline void omap_init_mmc(void) {}
 #endif
 

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

* Re: [RFC/PATCH  3/4] MMC/SD Controller driver for OMAP2430
  2007-12-07 13:50 [RFC/PATCH 3/4] MMC/SD Controller driver for OMAP2430 Madhusudhan Chikkature Rajashekar
@ 2007-12-10 17:56 ` Tony Lindgren
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2007-12-10 17:56 UTC (permalink / raw)
  To: Madhusudhan Chikkature Rajashekar; +Cc: linux-omap, linux-omap-open-source

* Madhusudhan Chikkature Rajashekar <madhu.cr@ti.com> [071207 05:51]:
> This patch registers the MMC device for OMAP2430/3430.
> 
> Signed-off-by: Madhusudhan Chikkature<madhu.cr@ti.com>
> 
> ---
>  arch/arm/plat-omap/devices.c |   19 +++++++++++++------
>  1 files changed, 13 insertions(+), 6 deletions(-)
> 
> Index: linux-omap-2.6/arch/arm/plat-omap/devices.c
> ===================================================================
> --- linux-omap-2.6.orig/arch/arm/plat-omap/devices.c	2007-12-06 16:04:39.000000000 +0530
> +++ linux-omap-2.6/arch/arm/plat-omap/devices.c	2007-12-07 11:15:50.567693917 +0530
> @@ -19,6 +19,7 @@
>  #include <asm/mach-types.h>
>  #include <asm/mach/map.h>
>  
> +#include <asm/arch/mmc.h>
>  #include <asm/arch/tc.h>
>  #include <asm/arch/board.h>
>  #include <asm/arch/mmc.h>
> @@ -156,7 +157,7 @@
>  
>  #if	defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
>  
> -#ifdef CONFIG_ARCH_OMAP24XX
> +#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
>  #define	OMAP_MMC1_BASE		0x4809c000
>  #define OMAP_MMC1_INT		INT_24XX_MMC_IRQ
>  #else
> @@ -228,10 +229,6 @@
>  	const struct omap_mmc_config	*mmc_conf;
>  	const struct omap_mmc_conf	*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)
> @@ -239,6 +236,15 @@
>  
>  	/* block 1 is always available and has just one pinout option */
>  	mmc = &mmc_conf->mmc[0];
> +
> +#if     defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430)
> +	if (cpu_is_omap2430() || cpu_is_omap34xx()) {
> +		if (mmc->enabled)
> +			(void) platform_device_register(&mmc_omap_device1);
> +		return;
> +	}
> +#else
>  	if (mmc->enabled) {
>  		if (cpu_is_omap24xx()) {
>  			omap_cfg_reg(H18_24XX_MMC_CMD);

No ifdefs should be needed here. If 2430 and 34xx are not selected it
gets optimized out as if (0) {}.

Regards,

Tony

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

* [RFC/PATCH  3/4] MMC/SD Controller driver for OMAP2430
@ 2007-12-11  6:48 Madhusudhan Chikkature Rajashekar
  0 siblings, 0 replies; 3+ messages in thread
From: Madhusudhan Chikkature Rajashekar @ 2007-12-11  6:48 UTC (permalink / raw)
  To: linux-omap-open-source; +Cc: linux-omap

Hi Tony,

I am reposting the patch after removing the ifdefs pointed out by you.

Thanks,
Madhu
--------------------------------------------------------------------------------


This patch registers the MMC device for OMAP2430/3430.

Signed-off-by: Madhusudhan Chikkature<madhu.cr@ti.com>

---
 arch/arm/plat-omap/devices.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

Index: Madhu-linux-mmc/arch/arm/plat-omap/devices.c
===================================================================
--- Madhu-linux-mmc.orig/arch/arm/plat-omap/devices.c	2007-12-06 16:04:39.000000000 +0530
+++ Madhu-linux-mmc/arch/arm/plat-omap/devices.c	2007-12-11 12:05:27.521559900 +0530
@@ -19,6 +19,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
 
+#include <asm/arch/mmc.h>
 #include <asm/arch/tc.h>
 #include <asm/arch/board.h>
 #include <asm/arch/mmc.h>
@@ -156,7 +157,7 @@
 
 #if	defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
 
-#ifdef CONFIG_ARCH_OMAP24XX
+#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
 #define	OMAP_MMC1_BASE		0x4809c000
 #define OMAP_MMC1_INT		INT_24XX_MMC_IRQ
 #else
@@ -228,10 +229,6 @@
 	const struct omap_mmc_config	*mmc_conf;
 	const struct omap_mmc_conf	*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)
@@ -239,6 +236,13 @@
 
 	/* block 1 is always available and has just one pinout option */
 	mmc = &mmc_conf->mmc[0];
+
+	if (cpu_is_omap2430() || cpu_is_omap34xx()) {
+		if (mmc->enabled)
+			(void) platform_device_register(&mmc_omap_device1);
+		return;
+	}
+
 	if (mmc->enabled) {
 		if (cpu_is_omap24xx()) {
 			omap_cfg_reg(H18_24XX_MMC_CMD);
@@ -339,6 +343,7 @@
 }
 
 #else
+void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info) {}
 static inline void omap_init_mmc(void) {}
 #endif
 

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

end of thread, other threads:[~2007-12-11  6:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-07 13:50 [RFC/PATCH 3/4] MMC/SD Controller driver for OMAP2430 Madhusudhan Chikkature Rajashekar
2007-12-10 17:56 ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2007-12-11  6:48 Madhusudhan Chikkature Rajashekar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox