diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-04-19 15:12:11 +0200 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-05-26 14:23:17 -0400 |
commit | 07a682160866e302d696f5c76d74024d575fb79d (patch) | |
tree | a2c74c48a953607d255ad006e3a58a2ed0969515 /drivers/mmc/core/mmc_ops.c | |
parent | c4d770d72492df510077b277f21ac5f0dad9e5eb (diff) | |
download | linux-07a682160866e302d696f5c76d74024d575fb79d.tar.gz linux-07a682160866e302d696f5c76d74024d575fb79d.tar.bz2 linux-07a682160866e302d696f5c76d74024d575fb79d.zip |
mmc: core: Restructure and simplify code for mmc sleep|awake
The mmc_card_sleep|awake APIs are not being used since the support is
already properly encapsulated within the suspend sequence. Sleep|awake
command is also specific for eMMC.
We remove the sleep|awake bus_ops, the mmc_card_sleep|awake APIs and
move the code into the mmc specific core instead. This also includes
the mmc ops function, mmc_sleepawake. All releated functions have then
become static and we have got far less code to maintain.
Additionally this patch also simplifies the code from mmc_sleepawake,
since it is only used to put the card to sleep and not awake.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/mmc_ops.c')
-rw-r--r-- | drivers/mmc/core/mmc_ops.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 124af5238d0a..837fc7386e23 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -59,40 +59,6 @@ int mmc_deselect_cards(struct mmc_host *host) return _mmc_select_card(host, NULL); } -int mmc_card_sleepawake(struct mmc_host *host, int sleep) -{ - struct mmc_command cmd = {0}; - struct mmc_card *card = host->card; - int err; - - if (sleep) - mmc_deselect_cards(host); - - cmd.opcode = MMC_SLEEP_AWAKE; - cmd.arg = card->rca << 16; - if (sleep) - cmd.arg |= 1 << 15; - - cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; - err = mmc_wait_for_cmd(host, &cmd, 0); - if (err) - return err; - - /* - * If the host does not wait while the card signals busy, then we will - * will have to wait the sleep/awake timeout. Note, we cannot use the - * SEND_STATUS command to poll the status because that command (and most - * others) is invalid while the card sleeps. - */ - if (!(host->caps & MMC_CAP_WAIT_WHILE_BUSY)) - mmc_delay(DIV_ROUND_UP(card->ext_csd.sa_timeout, 10000)); - - if (!sleep) - err = mmc_select_card(card); - - return err; -} - int mmc_go_idle(struct mmc_host *host) { int err; |