aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorJarkko Lavinen <jarkko.lavinen@nokia.com>2008-11-17 07:35:21 -0500
committerPierre Ossman <drzeus@drzeus.cx>2008-12-31 12:18:12 -0500
commitb30f8af3358b5c66be223e3a9f3d11b3d02b4a8f (patch)
tree937cf3024bdb48da748c8fece5cfaa6f6ef45744 /drivers/mmc
parent35ff8554d12ecc80a46ea0d9bce34fe28733ff38 (diff)
mmc: Add 8-bit bus width support
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/mmc.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index fdd7c760be8c..c232d11a7ed4 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -434,13 +434,24 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
434 * Activate wide bus (if supported). 434 * Activate wide bus (if supported).
435 */ 435 */
436 if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) && 436 if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
437 (host->caps & MMC_CAP_4_BIT_DATA)) { 437 (host->caps & (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA))) {
438 unsigned ext_csd_bit, bus_width;
439
440 if (host->caps & MMC_CAP_8_BIT_DATA) {
441 ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
442 bus_width = MMC_BUS_WIDTH_8;
443 } else {
444 ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
445 bus_width = MMC_BUS_WIDTH_4;
446 }
447
438 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, 448 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
439 EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_4); 449 EXT_CSD_BUS_WIDTH, ext_csd_bit);
450
440 if (err) 451 if (err)
441 goto free_card; 452 goto free_card;
442 453
443 mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4); 454 mmc_set_bus_width(card->host, bus_width);
444 } 455 }
445 456
446 if (!oldcard) 457 if (!oldcard)
@@ -624,4 +635,3 @@ err:
624 635
625 return err; 636 return err;
626} 637}
627