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

Ohad Ben-Cohen ohad at wizery.com
Wed Aug 11 09:19:29 EDT 2010


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 at wizery.com>
---
 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




More information about the linux-arm-kernel mailing list