mmc: Add "ignore mmc pm notify" functionality
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 7 Oct 2010 21:39:16 +0000 (14:39 -0700)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:06:15 +0000 (12:06 -0800)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/mmc/core/host.c
include/linux/mmc/pm.h

index 793d0a0..04994bd 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 d37aac4..3903823 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