mmc: block: Enable runtime pm for mmc blkdevice
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 2 May 2013 12:02:38 +0000 (14:02 +0200)
committerlintao <lintao@rock-chips.com>
Fri, 7 Mar 2014 04:45:16 +0000 (12:45 +0800)
commit22c6d9771f91da26f12857ad9069ff0a48d7bb39
tree1a72d6614cab733b17347f82f0ad75c55647aa14
parent32c59bface93104d09e847e88b35eb336b0448ec
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>
drivers/mmc/card/block.c
drivers/mmc/core/core.c
drivers/mmc/core/debugfs.c
drivers/mmc/core/mmc.c
drivers/mmc/core/sd.c
include/linux/mmc/core.h