summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sdio.c
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2010-10-02 13:54:11 +0200
committerChris Ball <cjb@laptop.org>2010-10-23 21:11:18 +0800
commit40bba0c1ca83a370f749c8bc9afda71cf79ebd91 (patch)
tree1d2725b031284717468b22b90df59d5939506187 /drivers/mmc/core/sdio.c
parent81968561bd69536c82be7ee654b04c68cd3e1746 (diff)
downloadlinux-40bba0c1ca83a370f749c8bc9afda71cf79ebd91.tar.gz
linux-40bba0c1ca83a370f749c8bc9afda71cf79ebd91.tar.bz2
linux-40bba0c1ca83a370f749c8bc9afda71cf79ebd91.zip
mmc: sdio: enable runtime PM for SDIO functions
Enable runtime PM for SDIO functions. SDIO functions are initialized with a disabled runtime PM state, and are set active (and their usage count is incremented) only before potential drivers are probed. SDIO function drivers that support runtime PM should call pm_runtime_put_noidle() in their probe routine, and pm_runtime_get_noresume() in their remove routine (very similarly to PCI drivers). In case a matching driver does not support runtime PM, power will always be kept high (since the usage count is positive). Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/sdio.c')
-rw-r--r--drivers/mmc/core/sdio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 0dbd6fe66660..85561dde4c9d 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -734,6 +734,11 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
err = sdio_init_func(host->card, i + 1);
if (err)
goto remove;
+
+ /*
+ * Enable Runtime PM for this func
+ */
+ pm_runtime_enable(&card->sdio_func[i]->dev);
}
mmc_release_host(host);