mmc: Add "ignore mmc pm notify" functionality
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 7 Oct 2010 21:39:16 +0000 (14:39 -0700)
committerColin Cross <ccross@android.com>
Tue, 14 Jun 2011 16:09:37 +0000 (09:09 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/mmc/core/host.c
include/linux/mmc/pm.h

index b29d3e8fd3a2ad713525c4be82c9b2f9699910ec..84694a9410d90d139e3a29e88692fc7922878ada 100644 (file)
@@ -336,7 +336,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;
 }
@@ -353,7 +354,9 @@ 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 d37aac49cf9a5406934f975c9b76ec6815d5576f..390382367acbda949f5b15ec543c2d01913eaea2 100644 (file)
@@ -26,5 +26,6 @@ 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