mmc: Add "ignore mmc pm notify" functionality
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 7 Oct 2010 21:39:16 +0000 (14:39 -0700)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:51:09 +0000 (13:51 -0800)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/mmc/core/host.c
include/linux/mmc/pm.h

index da950c44204d27d6db8cd5a2d56b6b3e88e27c09..fcf7829c759e200baa7ef5f9cd456c18dd83ac48 100644 (file)
@@ -395,7 +395,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;
 }
@@ -412,7 +413,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 4a139204c20c0bb8aab7a7759c74e7e5d5cde9a4..6e2d6a135c7e0d75f830af3a429fb5bc02ca07b2 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 /* LINUX_MMC_PM_H */