diff options
author | Haibo Chen <haibo.chen@nxp.com> | 2016-04-26 11:21:02 +0800 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2016-06-24 14:46:29 +0200 |
commit | 5e38fedc81d06ea06f13c037c6cb589d7b8ee8e1 (patch) | |
tree | 76736f11d390c9dca4597df4236f662cb37c597b | |
parent | b1f06c361104c693ca0adf9cb6fe14be28d143c1 (diff) |
MLK-12706-1 mmc: sdio: add sdio reset function for bcmdhd wifi
This patch add function sdio_reset_comm() to support bcmdhd wifi
dirver build-in type.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
-rw-r--r-- | drivers/mmc/core/sdio.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 3b37f9d1af64..9a03630ebb53 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -786,6 +786,37 @@ err: return err; } +int sdio_reset_comm(struct mmc_card *card) +{ + struct mmc_host *host = card->host; + u32 ocr; + u32 rocr; + int err; + + mmc_claim_host(host); + mmc_go_idle(host); + mmc_set_clock(host, host->f_min); + err = mmc_send_io_op_cond(host, 0, &ocr); + if (err) + goto err; + rocr = mmc_select_voltage(host, ocr); + if (!rocr) { + err = -EINVAL; + goto err; + } + err = mmc_sdio_init_card(host, rocr, card, 0); + if (err) + goto err; + mmc_release_host(host); + return 0; +err: + pr_err("%s: Error resetting SDIO communications (%d)\n", + mmc_hostname(host), err); + mmc_release_host(host); + return err; +} +EXPORT_SYMBOL(sdio_reset_comm); + /* * Host is being removed. Free up the current card. */ |