aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/core.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-05-02 08:02:38 -0400
committerChris Ball <cjb@laptop.org>2013-05-26 14:23:16 -0400
commite94cfef698aae6b209d8918dd319312e4b02118d (patch)
treebbf4978bf665c480608317d0544967f6600b21a3 /drivers/mmc/core/core.c
parent12d01d0b813b93e7bde1b5f468b5c85aa8b33590 (diff)
mmc: block: Enable runtime pm for mmc blkdevice
Once the mmc blkdevice is being probed, runtime pm will be enabled. By using runtime autosuspend, the power save operations can be done when request inactivity occurs for a certain time. Right now the selected timeout value is set to 3 s. Obviously this value will likely need to be configurable somehow since it needs to be trimmed depending on the power save algorithm. For SD-combo cards, we are still leaving the enablement of runtime PM to the SDIO init sequence since it depends on the capabilities of the SDIO func driver. Moreover, when the blk device is being suspended, we make sure the device will be runtime resumed. The reason for doing this is that we want the host suspend sequence to be unaware of any runtime power save operations done for the card in this phase. Thus it can just handle the suspend as the card is fully powered from a runtime perspective. Finally, this patch prepares to make it possible to move BKOPS handling into the runtime callbacks for the mmc bus_ops. Thus IDLE BKOPS can be accomplished. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r--drivers/mmc/core/core.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index dc0cb5929c64..0f86144b0c51 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -971,6 +971,29 @@ void mmc_release_host(struct mmc_host *host)
971EXPORT_SYMBOL(mmc_release_host); 971EXPORT_SYMBOL(mmc_release_host);
972 972
973/* 973/*
974 * This is a helper function, which fetches a runtime pm reference for the
975 * card device and also claims the host.
976 */
977void mmc_get_card(struct mmc_card *card)
978{
979 pm_runtime_get_sync(&card->dev);
980 mmc_claim_host(card->host);
981}
982EXPORT_SYMBOL(mmc_get_card);
983
984/*
985 * This is a helper function, which releases the host and drops the runtime
986 * pm reference for the card device.
987 */
988void mmc_put_card(struct mmc_card *card)
989{
990 mmc_release_host(card->host);
991 pm_runtime_mark_last_busy(&card->dev);
992 pm_runtime_put_autosuspend(&card->dev);
993}
994EXPORT_SYMBOL(mmc_put_card);
995
996/*
974 * Internal function that does the actual ios call to the host driver, 997 * Internal function that does the actual ios call to the host driver,
975 * optionally printing some debug output. 998 * optionally printing some debug output.
976 */ 999 */