tree 7fc17315c0d948cd106b89d250355bf59978ae39
parent caf39e87cc1182f7dae84eefc43ca14d54c78ef9
author Richard Purdie <[EMAIL PROTECTED]> Thu, 08 Sep 2005 17:53:01 +0100
committer Russell King <[EMAIL PROTECTED]> Thu, 08 Sep 2005 17:53:01 +0100

[MMC] Allow detection/removal to be delayed

Change mmc_detect_change() to take a delay argument such that
the detection of card insertions and removals can be delayed
according to the requirements of the host driver or platform.

Signed-off-by: Richard Purdie <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>

 drivers/mmc/mmc.c        |   12 ++++++++----
 drivers/mmc/mmci.c       |    2 +-
 drivers/mmc/pxamci.c     |    2 +-
 drivers/mmc/wbsd.c       |    4 ++--
 include/linux/mmc/host.h |    2 +-
 5 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1079,13 +1079,17 @@ static void mmc_setup(struct mmc_host *h
 /**
  *     mmc_detect_change - process change of state on a MMC socket
  *     @host: host which changed state.
+ *     @delay: optional delay to wait before detection (jiffies)
  *
  *     All we know is that card(s) have been inserted or removed
  *     from the socket(s).  We don't know which socket or cards.
  */
-void mmc_detect_change(struct mmc_host *host)
+void mmc_detect_change(struct mmc_host *host, unsigned long delay)
 {
-       schedule_work(&host->detect);
+       if (delay)
+               schedule_delayed_work(&host->detect, delay);
+       else
+               schedule_work(&host->detect);
 }
 
 EXPORT_SYMBOL(mmc_detect_change);
@@ -1189,7 +1193,7 @@ int mmc_add_host(struct mmc_host *host)
        ret = mmc_add_host_sysfs(host);
        if (ret == 0) {
                mmc_power_off(host);
-               mmc_detect_change(host);
+               mmc_detect_change(host, 0);
        }
 
        return ret;
@@ -1259,7 +1263,7 @@ EXPORT_SYMBOL(mmc_suspend_host);
  */
 int mmc_resume_host(struct mmc_host *host)
 {
-       mmc_detect_change(host);
+       mmc_detect_change(host, 0);
 
        return 0;
 }
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c
--- a/drivers/mmc/mmci.c
+++ b/drivers/mmc/mmci.c
@@ -442,7 +442,7 @@ static void mmci_check_status(unsigned l
 
        status = host->plat->status(mmc_dev(host->mmc));
        if (status ^ host->oldstat)
-               mmc_detect_change(host->mmc);
+               mmc_detect_change(host->mmc, 0);
 
        host->oldstat = status;
        mod_timer(&host->timer, jiffies + HZ);
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c
--- a/drivers/mmc/pxamci.c
+++ b/drivers/mmc/pxamci.c
@@ -423,7 +423,7 @@ static void pxamci_dma_irq(int dma, void
 
 static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs 
*regs)
 {
-       mmc_detect_change(devid);
+       mmc_detect_change(devid, 0);
        return IRQ_HANDLED;
 }
 
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c
--- a/drivers/mmc/wbsd.c
+++ b/drivers/mmc/wbsd.c
@@ -1122,7 +1122,7 @@ static void wbsd_detect_card(unsigned lo
        
        DBG("Executing card detection\n");
        
-       mmc_detect_change(host->mmc);   
+       mmc_detect_change(host->mmc, 0);        
 }
 
 /*
@@ -1198,7 +1198,7 @@ static void wbsd_tasklet_card(unsigned l
                 */
                spin_unlock(&host->lock);
 
-               mmc_detect_change(host->mmc);
+               mmc_detect_change(host->mmc, 0);
        }
        else
                spin_unlock(&host->lock);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -123,7 +123,7 @@ extern void mmc_free_host(struct mmc_hos
 extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
 extern int mmc_resume_host(struct mmc_host *);
 
-extern void mmc_detect_change(struct mmc_host *);
+extern void mmc_detect_change(struct mmc_host *, unsigned long delay);
 extern void mmc_request_done(struct mmc_host *, struct mmc_request *);
 
 #endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to