mmc: wifi sdio card ignore pm notify. otherwise wifi may work abnormally when resum...
authorlbt <lbt@rock-chip.com>
Tue, 5 Jul 2011 06:42:31 +0000 (14:42 +0800)
committerlbt <lbt@rock-chip.com>
Tue, 5 Jul 2011 06:42:31 +0000 (14:42 +0800)
drivers/mmc/core/host.c
drivers/mmc/host/rk29_sdmmc.c
include/linux/mmc/host.h
include/linux/mmc/pm.h [new file with mode: 0644]

index bc875cda66ffdacd3ab8c38e9bd614ffea648935..94f35ca5c413b39677c19540aaef65aa37456821 100644 (file)
@@ -136,7 +136,8 @@ int mmc_add_host(struct mmc_host *host)
 #endif
 
        mmc_start_host(host);
-       register_pm_notifier(&host->pm_notify);
+        if (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY))
+          register_pm_notifier(&host->pm_notify);
 
        return 0;
 }
@@ -153,7 +154,8 @@ EXPORT_SYMBOL(mmc_add_host);
  */
 void mmc_remove_host(struct mmc_host *host)
 {
-       unregister_pm_notifier(&host->pm_notify);
+        if (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY))       
+           unregister_pm_notifier(&host->pm_notify);
        mmc_stop_host(host);
 
 #ifdef CONFIG_DEBUG_FS
index 8696c6c640e2a325aff3753133333e7bc75bc5fc..b33d69c2300b096ad81025fb4e5d0a7f5b57fc52 100755 (executable)
@@ -1378,6 +1378,9 @@ static int rk29_sdmmc_probe(struct platform_device *pdev)
                mmc->ops = &rk29_sdmmc_ops[1];
        else
                mmc->ops = &rk29_sdmmc_ops[0];
+  
+        if (host->is_sdio) 
+           mmc->pm_flags = MMC_PM_IGNORE_PM_NOTIFY;   //ignore pm notify    
        
        mmc->f_min = DIV_ROUND_UP(host->bus_hz, 510);
        mmc->f_max = host->bus_hz; 
index 1ba648eb868e0273c964200967064a2a0ed9f296..01f21a50a2bf6c21bac992b8336ee5d006e25cc8 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/sched.h>
 
 #include <linux/mmc/core.h>
+#include <linux/mmc/pm.h>
 
 struct mmc_ios {
        unsigned int    clock;                  /* clock rate */
@@ -206,6 +207,8 @@ struct mmc_host {
        struct task_struct      *sdio_irq_thread;
        atomic_t                sdio_irq_thread_abort;
 
+        mmc_pm_flag_t           pm_flags;       /* requested pm features */
+
 #ifdef CONFIG_LEDS_TRIGGERS
        struct led_trigger      *led;           /* activity led */
 #endif
diff --git a/include/linux/mmc/pm.h b/include/linux/mmc/pm.h
new file mode 100644 (file)
index 0000000..3903823
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * linux/include/linux/mmc/pm.h
+ *
+ * Author:     Nicolas Pitre
+ * Copyright:  (C) 2009 Marvell Technology Group Ltd.
+ *
+ * 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 LINUX_MMC_PM_H
+#define LINUX_MMC_PM_H
+
+/*
+ * These flags are used to describe power management features that
+ * some cards (typically SDIO cards) might wish to benefit from when
+ * the host system is being suspended.  There are several layers of
+ * abstractions involved, from the host controller driver, to the MMC core
+ * code, to the SDIO core code, to finally get to the actual SDIO function
+ * driver.  This file is therefore used for common definitions shared across
+ * all those layers.
+ */
+
+typedef unsigned int mmc_pm_flag_t;
+
+#define MMC_PM_KEEP_POWER      (1 << 0)        /* preserve card power during suspend */
+#define MMC_PM_WAKE_SDIO_IRQ   (1 << 1)        /* wake up host system on SDIO IRQ assertion */
+#define MMC_PM_IGNORE_PM_NOTIFY        (1 << 2)        /* ignore mmc pm notify */
+
+#endif