From: Richard Purdie <rpurdie@rpsys.net>
Date: Thu, 8 Sep 2005 21:48:16 +0000 (+0100)
Subject: [MMC] Add mmc_detect_change() delay support for PXAMCI driver
X-Git-Tag: v2.6.14-rc1~492^2~25^2
X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c26971cbb39727b0b692c6236f890ba13046a663;p=linux-2.6-omap-h63xx.git

[MMC] Add mmc_detect_change() delay support for PXAMCI driver

Allow PXA platforms to pass an appropriate delay value to the
PXA MCI driver for delaying detection changes.

Signed-Off-By: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---

diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c
index 5223cd3bfc1..b53af57074e 100644
--- a/drivers/mmc/pxamci.c
+++ b/drivers/mmc/pxamci.c
@@ -423,7 +423,9 @@ static void pxamci_dma_irq(int dma, void *devid, struct pt_regs *regs)
 
 static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs *regs)
 {
-	mmc_detect_change(devid, 0);
+	struct pxamci_host *host = mmc_priv(devid);
+
+	mmc_detect_change(devid, host->pdata->detect_delay);
 	return IRQ_HANDLED;
 }
 
diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h
index 9718063a211..88c17dd02ed 100644
--- a/include/asm-arm/arch-pxa/mmc.h
+++ b/include/asm-arm/arch-pxa/mmc.h
@@ -9,6 +9,7 @@ struct mmc_host;
 
 struct pxamci_platform_data {
 	unsigned int ocr_mask;			/* available voltages */
+	unsigned long detect_delay;		/* delay in jiffies before detecting cards after interrupt */
 	int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *);
 	int (*get_ro)(struct device *);
 	void (*setpower)(struct device *, unsigned int);