diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2010-10-02 13:54:10 +0200 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2010-10-23 21:11:18 +0800 |
commit | 81968561bd69536c82be7ee654b04c68cd3e1746 (patch) | |
tree | e6a4553cb6ce672d73bf0d9ae1dec50cf64e6ddf /drivers/mmc | |
parent | 80fd933c44557c5261b80f8f8145b4fe071aeaf3 (diff) | |
download | linux-81968561bd69536c82be7ee654b04c68cd3e1746.tar.gz linux-81968561bd69536c82be7ee654b04c68cd3e1746.tar.bz2 linux-81968561bd69536c82be7ee654b04c68cd3e1746.zip |
mmc: sdio: enable runtime PM for SDIO cards
Enable runtime PM for new SDIO cards.
As soon as the card will be added to the device tree, runtime PM core
will release its power, since it doesn't have any users yet.
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')
-rw-r--r-- | drivers/mmc/core/sdio.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index f17e0e0bd9d1..0dbd6fe66660 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> @@ -708,6 +709,18 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr) card = host->card; /* + * Let runtime PM core know our card is active + */ + err = pm_runtime_set_active(&card->dev); + if (err) + goto remove; + + /* + * Enable runtime PM for this card + */ + pm_runtime_enable(&card->dev); + + /* * The number of functions on the card is encoded inside * the ocr. */ |