Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4ff6471c028a9885e8f09a000d87694f81190ab9
Commit:     4ff6471c028a9885e8f09a000d87694f81190ab9
Parent:     6db5020e7386ddf17378f91eb8c445433e5b07cd
Author:     Pierre Ossman <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 30 18:23:53 2007 +0200
Committer:  Pierre Ossman <[EMAIL PROTECTED]>
CommitDate: Sun Sep 23 21:15:16 2007 +0200

    sdio: enable wide bus mode
    
    Enable 4-bit data bus mode, according to host and card
    capabilities.
    
    Signed-off-by: Pierre Ossman <[EMAIL PROTECTED]>
---
 drivers/mmc/core/sdio.c |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 62df8e1..48c465a 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -138,6 +138,32 @@ out:
        return ret;
 }
 
+static int sdio_enable_wide(struct mmc_card *card)
+{
+       int ret;
+       u8 ctrl;
+
+       if (!(card->host->caps & MMC_CAP_4_BIT_DATA))
+               return 0;
+
+       if (card->cccr.low_speed && !card->cccr.wide_bus)
+               return 0;
+
+       ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_IF, 0, &ctrl);
+       if (ret)
+               return ret;
+
+       ctrl |= SDIO_BUS_WIDTH_4BIT;
+
+       ret = mmc_io_rw_direct(card, 1, 0, SDIO_CCCR_IF, ctrl, NULL);
+       if (ret)
+               return ret;
+
+       mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4);
+
+       return 0;
+}
+
 /*
  * Host is being removed. Free up the current card.
  */
@@ -300,6 +326,13 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
        mmc_set_clock(host, card->cis.max_dtr);
 
        /*
+        * Switch to wider bus (if supported).
+        */
+       err = sdio_enable_wide(card);
+       if (err)
+               goto remove;
+
+       /*
         * Initialize (but don't add) all present functions.
         */
        for (i = 0;i < funcs;i++) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to