]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: core: Enable __mmc_switch() to change bus speed timing for the host
authorUlf Hansson <ulf.hansson@linaro.org>
Wed, 9 Nov 2016 16:33:36 +0000 (17:33 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 29 Nov 2016 08:05:25 +0000 (09:05 +0100)
commit9e722ee0f820fa3ea64d70bc2c913c4321deebd9
tree0d62e4099d82083dc00b625c39352bfa88c916df
parentef502a893602f0ee126468f99b74b0a9b1c279f9
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>
drivers/mmc/core/core.c
drivers/mmc/core/mmc.c
drivers/mmc/core/mmc_ops.c
drivers/mmc/core/mmc_ops.h