diff options
author | Haibo Chen <haibo.chen@nxp.com> | 2016-04-26 11:21:02 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:24:39 +0800 |
commit | f50bd444631cf707029e93c58ec0c22a05610d62 (patch) | |
tree | 32734c0c06665867cd21d76a76bd91afc5ce0192 /drivers/mmc/core | |
parent | c1e8a674168b10a7ce3338b0105107787ade8e11 (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>
Diffstat (limited to 'drivers/mmc/core')
-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 5db90b0b60b5..abe5cbbadb82 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -802,6 +802,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. */ |