[RFC/PATCH 5/6] sdio: enable Runtime PM for SDIO cards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Before adding SDIO functions, indicate to the runtime pm core
the card is active, and enable runtime pm.

The power will be released automatically if the card
will be idle.

Signed-off-by: Ohad Ben-Cohen <ohad@xxxxxxxxxx>
---
 drivers/mmc/core/sdio.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index ddbb9d3..498fdfb 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -10,6 +10,7 @@
  */
 
 #include <linux/err.h>
+#include <linux/pm_runtime.h>
 
 #include <linux/mmc/host.h>
 #include <linux/mmc/card.h>
@@ -610,6 +611,9 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
 	if (err)
 		goto remove_added;
 
+	pm_runtime_set_active(&host->card->dev);
+	pm_runtime_enable(&host->card->dev);
+
 	/*
 	 * ...then the SDIO functions.
 	 */
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux