1 From 0b9879757f15d4ac99e032647cb3ee26393031b0 Mon Sep 17 00:00:00 2001
2 From: San Mehat <san@android.com>
3 Date: Thu, 15 May 2008 09:15:37 -0700
4 Subject: [PATCH 097/134] mmc: Add new API call 'sdio_reset_comm' for resetting communication with an SDIO device
6 Signed-off-by: San Mehat <san@android.com>
8 drivers/mmc/core/sdio.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++
9 1 files changed, 58 insertions(+), 0 deletions(-)
11 --- a/drivers/mmc/core/sdio.c
12 +++ b/drivers/mmc/core/sdio.c
13 @@ -482,3 +482,61 @@ err:
17 +int sdio_reset_comm(struct mmc_card *card)
19 + struct mmc_host *host = card->host;
23 + printk("%s():\n", __func__);
26 + mmc_set_clock(host, host->f_min);
28 + err = mmc_send_io_op_cond(host, 0, &ocr);
32 + host->ocr = mmc_select_voltage(host, ocr);
38 + err = mmc_send_io_op_cond(host, host->ocr, &ocr);
42 + if (mmc_host_is_spi(host)) {
43 + err = mmc_spi_set_crc(host, use_spi_crc);
48 + if (!mmc_host_is_spi(host)) {
49 + err = mmc_send_relative_addr(host, &card->rca);
52 + mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
54 + if (!mmc_host_is_spi(host)) {
55 + err = mmc_select_card(card);
60 + mmc_set_clock(host, card->cis.max_dtr);
61 + err = sdio_enable_wide(card);
67 + printk("%s: Error resetting SDIO communications (%d)\n",
68 + mmc_hostname(host), err);
69 + mmc_release_host(host);
72 +EXPORT_SYMBOL(sdio_reset_comm);