diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-04-19 09:12:11 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-05-26 14:23:17 -0400 |
commit | 07a682160866e302d696f5c76d74024d575fb79d (patch) | |
tree | a2c74c48a953607d255ad006e3a58a2ed0969515 /drivers/mmc/core/core.c | |
parent | c4d770d72492df510077b277f21ac5f0dad9e5eb (diff) |
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/core.c')
-rw-r--r-- | drivers/mmc/core/core.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 0f86144b0c51..e9a104b9e4d3 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -2550,52 +2550,6 @@ int mmc_power_restore_host(struct mmc_host *host) | |||
2550 | } | 2550 | } |
2551 | EXPORT_SYMBOL(mmc_power_restore_host); | 2551 | EXPORT_SYMBOL(mmc_power_restore_host); |
2552 | 2552 | ||
2553 | int mmc_card_awake(struct mmc_host *host) | ||
2554 | { | ||
2555 | int err = -ENOSYS; | ||
2556 | |||
2557 | if (host->caps2 & MMC_CAP2_NO_SLEEP_CMD) | ||
2558 | return 0; | ||
2559 | |||
2560 | mmc_bus_get(host); | ||
2561 | |||
2562 | if (host->bus_ops && !host->bus_dead && host->bus_ops->awake) | ||
2563 | err = host->bus_ops->awake(host); | ||
2564 | |||
2565 | mmc_bus_put(host); | ||
2566 | |||
2567 | return err; | ||
2568 | } | ||
2569 | EXPORT_SYMBOL(mmc_card_awake); | ||
2570 | |||
2571 | int mmc_card_sleep(struct mmc_host *host) | ||
2572 | { | ||
2573 | int err = -ENOSYS; | ||
2574 | |||
2575 | if (host->caps2 & MMC_CAP2_NO_SLEEP_CMD) | ||
2576 | return 0; | ||
2577 | |||
2578 | mmc_bus_get(host); | ||
2579 | |||
2580 | if (host->bus_ops && !host->bus_dead && host->bus_ops->sleep) | ||
2581 | err = host->bus_ops->sleep(host); | ||
2582 | |||
2583 | mmc_bus_put(host); | ||
2584 | |||
2585 | return err; | ||
2586 | } | ||
2587 | EXPORT_SYMBOL(mmc_card_sleep); | ||
2588 | |||
2589 | int mmc_card_can_sleep(struct mmc_host *host) | ||
2590 | { | ||
2591 | struct mmc_card *card = host->card; | ||
2592 | |||
2593 | if (card && mmc_card_mmc(card) && card->ext_csd.rev >= 3) | ||
2594 | return 1; | ||
2595 | return 0; | ||
2596 | } | ||
2597 | EXPORT_SYMBOL(mmc_card_can_sleep); | ||
2598 | |||
2599 | /* | 2553 | /* |
2600 | * Flush the cache to the non-volatile storage. | 2554 | * Flush the cache to the non-volatile storage. |
2601 | */ | 2555 | */ |