Skip to content

Commit

Permalink
mmc: sdio: enable runtime PM for SDIO cards
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ohad Ben-Cohen authored and Chris Ball committed Oct 23, 2010
1 parent 80fd933 commit 8196856
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/mmc/core/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

#include <linux/err.h>
#include <linux/pm_runtime.h>

#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
Expand Down Expand Up @@ -707,6 +708,18 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
goto err;
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.
Expand Down

0 comments on commit 8196856

Please sign in to comment.