---
 arch/arm/mach-s3c2410/devs.c       |   16 	15 +	1 -	0 !
 drivers/mmc/s3cmci.c               |   18 	16 +	2 -	0 !
 drivers/mmc/s3cmci.h               |    3 	3 +	0 -	0 !
 include/asm-arm/arch-s3c2410/mmc.h |   24 	24 +	0 -	0 !
 4 files changed, 58 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/mmc/s3cmci.c
===================================================================
--- linux-2.6.orig/drivers/mmc/s3cmci.c	2006-11-23 23:27:24.000000000 +0100
+++ linux-2.6/drivers/mmc/s3cmci.c	2006-11-23 23:29:11.000000000 +0100
@@ -21,6 +21,7 @@
 #include <asm/io.h>
 #include <asm/arch/regs-sdi.h>
 #include <asm/arch/regs-gpio.h>
+#include <asm/arch/mmc.h>
 
 #include "mmc_debug.h"
 #include "s3cmci.h"
@@ -1073,10 +1074,15 @@ static struct mmc_host_ops s3cmci_ops = 
 	.set_ios	= s3cmci_set_ios,
 };
 
+static struct s3c24xx_mmc_platdata s3c2410_mmc_defplat = {
+	.gpio_detect	= S3C2410_GPF2,
+};
+
 static int s3cmci_probe(struct platform_device *pdev, int is2440)
 {
 	struct mmc_host 	*mmc;
 	struct s3cmci_host 	*host;
+	s3c24xx_mmc_pdata_t	*pdata;
 
 	int ret;
 
@@ -1108,7 +1114,15 @@ static int s3cmci_probe(struct platform_
 	host->pio_active 	= XFER_NONE;
 
 	host->dma		= S3CMCI_DMA;
-	host->irq_cd		= IRQ_EINT2;
+
+	pdata = pdev->dev.platform_data;
+	if (!pdata) {
+		pdev->dev.platform_data = &s3c2410_mmc_defplat;
+		pdata = &s3c2410_mmc_defplat;
+	}
+
+	host->pdata = pdata;
+	host->irq_cd = s3c2410_gpio_getirq(pdata->gpio_detect);
 
 	host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!host->mem) {
@@ -1150,7 +1164,7 @@ static int s3cmci_probe(struct platform_
 
 	disable_irq(host->irq);
 
-	s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_EINT2);
+	s3c2410_gpio_cfgpin(pdata->gpio_detect, S3C2410_GPIO_IRQ);
 
 	if (request_irq(host->irq_cd, s3cmci_irq_cd, \
 		SA_TRIGGER_RISING | SA_TRIGGER_FALLING, DRIVER_NAME, host)) {
Index: linux-2.6/drivers/mmc/s3cmci.h
===================================================================
--- linux-2.6.orig/drivers/mmc/s3cmci.h	2006-11-23 23:27:24.000000000 +0100
+++ linux-2.6/drivers/mmc/s3cmci.h	2006-11-23 23:29:11.000000000 +0100
@@ -20,8 +20,11 @@ enum s3cmci_waitfor {
 	COMPLETION_XFERFINISH_RSPFIN,
 };
 
+typedef struct s3c24xx_mmc_platdata s3c24xx_mmc_pdata_t;
+
 struct s3cmci_host {
 	struct platform_device	*pdev;
+	s3c24xx_mmc_pdata_t	*pdata;
 	struct mmc_host		*mmc;
 	struct resource		*mem;
 	struct clk		*clk;
Index: linux-2.6/include/asm-arm/arch-s3c2410/mmc.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6/include/asm-arm/arch-s3c2410/mmc.h	2006-11-23 23:30:23.000000000 +0100
@@ -0,0 +1,24 @@
+/* linux/include/asm-arm/arch-s3c2410/mmc.h
+ *
+ * (c) 2004-2005 Simtec Electronics
+ *	http://www.simtec.co.uk/products/SWLINUX/
+ *	Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C24XX - MMC/SD platform data
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+
+#ifndef __ASM_ARCH_MMC_H
+#define __ASM_ARCH_MMC_H __FILE__
+
+struct s3c24xx_mmc_platdata {
+	unsigned int	gpio_detect;
+};
+
+extern void __init s3c24xx_sdi_set_platdata(struct s3c24xx_mmc_platdata *pd);
+#endif /* __ASM_ARCH_MMC_H */
+
Index: linux-2.6/arch/arm/mach-s3c2410/devs.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-s3c2410/devs.c	2006-11-23 23:25:16.000000000 +0100
+++ linux-2.6/arch/arm/mach-s3c2410/devs.c	2006-11-23 23:36:54.000000000 +0100
@@ -31,6 +31,7 @@
 #include <asm/arch/udc.h>
 #include <asm/arch/ts.h>
 #include <asm/arch/lcd.h>
+#include <asm/arch/mmc.h>
 #include <asm/arch/buttons.h>
 
 #include "devs.h"
@@ -300,7 +301,6 @@ void __init s3c24xx_udc_set_platdata(str
 	}
 }
 
-
 /* Watchdog */
 
 static struct resource s3c_wdt_resource[] = {
@@ -458,6 +458,20 @@ struct platform_device s3c_device_sdi = 
 
 EXPORT_SYMBOL(s3c_device_sdi);
 
+void __init s3c24xx_sdi_set_platdata(struct s3c24xx_mmc_platdata *pd)
+{
+	struct s3c24xx_mmc_platdata *npd;
+
+	npd = kmalloc(sizeof(*npd), GFP_KERNEL);
+	if (npd) {
+		memcpy(npd, pd, sizeof(*npd));
+		s3c_device_sdi.dev.platform_data = npd;
+	} else {
+		printk(KERN_ERR "no memory for sdi platform data\n");
+	}
+}
+
+
 /* SPI (0) */
 
 static struct resource s3c_spi0_resource[] = {

