summaryrefslogtreecommitdiff
path: root/drivers/mmc/core/mmc_ops.h
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2016-11-09 17:33:36 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2016-11-29 09:05:25 +0100
commitaa33ce3c411ab7a1b3c56f584b27bf4b6cc523ba (patch)
tree0d62e4099d82083dc00b625c39352bfa88c916df /drivers/mmc/core/mmc_ops.h
parent5ec32f84111a500c142961c82dd415c22e64e2be (diff)
mmc: core: Enable __mmc_switch() to change bus speed timing for the host
In cases when a speed mode change is requested for mmc cards, a CMD6 is sent by calling __mmc_switch() during the card initialization. The CMD6 leads to the card entering a busy period. When that is completed, the host must parse the CMD6 status to find out whether the change of the speed mode succeeded. To enable the mmc core to poll the card by using CMD13 to find out when the busy period is completed, it's reasonable to make sure polling is done by having the mmc host and the mmc card, being configured to operate at the same selected bus speed timing. Therefore, let's extend __mmc_switch() to take yet another parameter, which allow its callers to update the bus speed timing of the mmc host. In this way, __mmc_switch() also becomes capable of reading and validating the CMD6 status by sending a CMD13, in cases when that's desired. If __mmc_switch() encounters a failure, we make sure to restores the old bus speed timing for the mmc host, before propagating the error code. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Diffstat (limited to 'drivers/mmc/core/mmc_ops.h')
-rw-r--r--drivers/mmc/core/mmc_ops.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/core/mmc_ops.h b/drivers/mmc/core/mmc_ops.h
index 9fccddb48148..761cb69c46af 100644
--- a/drivers/mmc/core/mmc_ops.h
+++ b/drivers/mmc/core/mmc_ops.h
@@ -29,8 +29,8 @@ int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status);
int mmc_can_ext_csd(struct mmc_card *card);
int mmc_switch_status(struct mmc_card *card);
int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
- unsigned int timeout_ms, bool use_busy_signal, bool send_status,
- bool retry_crc_err);
+ unsigned int timeout_ms, unsigned char timing,
+ bool use_busy_signal, bool send_status, bool retry_crc_err);
#endif