diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2018-04-05 16:31:25 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2018-05-08 09:33:56 +0200 |
commit | 7405df4c79cd7b4204c5b4b5af2b1ad362ea85ad (patch) | |
tree | 67e7d5c25e11611cc498d85569a3970ac2e9690b /drivers/mmc | |
parent | 508c9864ccede5dd4b8a7220b3fe6998763e4407 (diff) | |
download | talos-op-linux-7405df4c79cd7b4204c5b4b5af2b1ad362ea85ad.tar.gz talos-op-linux-7405df4c79cd7b4204c5b4b5af2b1ad362ea85ad.zip |
mmc: core: Implement ->sw_reset bus ops for SDIO
Let's implement the ->sw_reset() bus ops to allow SDIO func drivers, in
particular, to make a SW reset without doing a full power cycle of the SDIO
card.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Quentin Schulz <quentin.schulz@bootlin.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/sdio.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 362737052f84..a86490dbca70 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -1056,6 +1056,18 @@ static int mmc_sdio_hw_reset(struct mmc_host *host) return mmc_sdio_power_restore(host); } +static int mmc_sdio_sw_reset(struct mmc_host *host) +{ + mmc_set_clock(host, host->f_init); + sdio_reset(host); + mmc_go_idle(host); + + mmc_set_initial_state(host); + mmc_set_initial_signal_voltage(host); + + return mmc_sdio_reinit_card(host, 0); +} + static const struct mmc_bus_ops mmc_sdio_ops = { .remove = mmc_sdio_remove, .detect = mmc_sdio_detect, @@ -1067,6 +1079,7 @@ static const struct mmc_bus_ops mmc_sdio_ops = { .power_restore = mmc_sdio_power_restore, .alive = mmc_sdio_alive, .hw_reset = mmc_sdio_hw_reset, + .sw_reset = mmc_sdio_sw_reset, }; |