Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65624
b: refs/heads/master
c: 4ff6471
h: refs/heads/master
v: v3
  • Loading branch information
Pierre Ossman committed Sep 23, 2007
1 parent 09aaac2 commit aa5f6dd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6db5020e7386ddf17378f91eb8c445433e5b07cd
refs/heads/master: 4ff6471c028a9885e8f09a000d87694f81190ab9
33 changes: 33 additions & 0 deletions trunk/drivers/mmc/core/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,32 @@ static int sdio_read_cccr(struct mmc_card *card)
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.
*/
Expand Down Expand Up @@ -299,6 +325,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.
*/
Expand Down

0 comments on commit aa5f6dd

Please sign in to comment.