ar71xx: add support for the Buffalo WHR-HP-GN board
[openwrt.git] / target / linux / goldfish / patches-2.6.30 / 0097-mmc-Add-new-API-call-sdio_reset_comm-for-resettin.patch
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
5
6 Signed-off-by: San Mehat <san@android.com>
7 ---
8 drivers/mmc/core/sdio.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++
9 1 files changed, 58 insertions(+), 0 deletions(-)
10
11 --- a/drivers/mmc/core/sdio.c
12 +++ b/drivers/mmc/core/sdio.c
13 @@ -482,3 +482,61 @@ err:
14 return err;
15 }
16
17 +int sdio_reset_comm(struct mmc_card *card)
18 +{
19 + struct mmc_host *host = card->host;
20 + u32 ocr;
21 + int err;
22 +
23 + printk("%s():\n", __func__);
24 + mmc_go_idle(host);
25 +
26 + mmc_set_clock(host, host->f_min);
27 +
28 + err = mmc_send_io_op_cond(host, 0, &ocr);
29 + if (err)
30 + goto err;
31 +
32 + host->ocr = mmc_select_voltage(host, ocr);
33 + if (!host->ocr) {
34 + err = -EINVAL;
35 + goto err;
36 + }
37 +
38 + err = mmc_send_io_op_cond(host, host->ocr, &ocr);
39 + if (err)
40 + goto err;
41 +
42 + if (mmc_host_is_spi(host)) {
43 + err = mmc_spi_set_crc(host, use_spi_crc);
44 + if (err)
45 + goto err;
46 + }
47 +
48 + if (!mmc_host_is_spi(host)) {
49 + err = mmc_send_relative_addr(host, &card->rca);
50 + if (err)
51 + goto err;
52 + mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
53 + }
54 + if (!mmc_host_is_spi(host)) {
55 + err = mmc_select_card(card);
56 + if (err)
57 + goto err;
58 + }
59 +
60 + mmc_set_clock(host, card->cis.max_dtr);
61 + err = sdio_enable_wide(card);
62 + if (err)
63 + goto err;
64 +
65 + return 0;
66 + err:
67 + printk("%s: Error resetting SDIO communications (%d)\n",
68 + mmc_hostname(host), err);
69 + mmc_release_host(host);
70 + return err;
71 +}
72 +EXPORT_SYMBOL(sdio_reset_comm);
73 +
74 +
This page took 0.046041 seconds and 5 git commands to generate.