mmc: Add "ignore mmc pm notify" functionality
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 7 Oct 2010 21:39:16 +0000 (14:39 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Thu, 7 Oct 2010 22:19:50 +0000 (15:19 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/mmc/core/host.c
include/linux/mmc/pm.h

index d80cfdc8edd2663841894348fa33e7dc4e597b1e..ba684e6d2b6b4ce8e7d530b3a17cb9ab9468f797 100644 (file)
@@ -137,7 +137,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;
 }
@@ -154,7 +155,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