From df39b7abc0d08cc8f5a9e61177e4924a37be71ab Mon Sep 17 00:00:00 2001 From: Stefan Nilsson XK Date: Thu, 15 Sep 2011 17:50:38 +0200 Subject: [PATCH] --- yaml --- r: 270267 b: refs/heads/master c: 44669034815a7ad263542ac605c581a10b22d146 h: refs/heads/master i: 270265: 4304a01c6f6f0c7469bed9b70d0741f7b5747fcb 270263: d33a08f066226a344393616d236d9fcd9632616a v: v3 --- [refs] | 2 +- trunk/drivers/mmc/core/core.c | 8 +++----- trunk/drivers/mmc/core/mmc.c | 8 ++++++++ trunk/drivers/mmc/core/sd.c | 2 -- trunk/drivers/mmc/core/sdio.c | 2 -- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 20edac710d06..2f3fc85deb9f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9a0da648ff3a5020406ac7784eb3b519014f66f6 +refs/heads/master: 44669034815a7ad263542ac605c581a10b22d146 diff --git a/trunk/drivers/mmc/core/core.c b/trunk/drivers/mmc/core/core.c index 5ae6b159dbea..45ea968e7dd1 100644 --- a/trunk/drivers/mmc/core/core.c +++ b/trunk/drivers/mmc/core/core.c @@ -1160,13 +1160,11 @@ static void mmc_power_up(struct mmc_host *host) bit = fls(host->ocr_avail) - 1; host->ios.vdd = bit; - if (mmc_host_is_spi(host)) { + if (mmc_host_is_spi(host)) host->ios.chip_select = MMC_CS_HIGH; - host->ios.bus_mode = MMC_BUSMODE_PUSHPULL; - } else { + else host->ios.chip_select = MMC_CS_DONTCARE; - host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN; - } + host->ios.bus_mode = MMC_BUSMODE_PUSHPULL; host->ios.power_mode = MMC_POWER_UP; host->ios.bus_width = MMC_BUS_WIDTH_1; host->ios.timing = MMC_TIMING_LEGACY; diff --git a/trunk/drivers/mmc/core/mmc.c b/trunk/drivers/mmc/core/mmc.c index 3b7c069a4ea6..b74e6f14b3ac 100644 --- a/trunk/drivers/mmc/core/mmc.c +++ b/trunk/drivers/mmc/core/mmc.c @@ -548,6 +548,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, BUG_ON(!host); WARN_ON(!host->claimed); + /* Set correct bus mode for MMC before attempting init */ + if (!mmc_host_is_spi(host)) + mmc_set_bus_mode(host, MMC_BUSMODE_OPENDRAIN); + /* * Since we're changing the OCR value, we seem to * need to tell some cards to go back to the idle @@ -1022,6 +1026,10 @@ int mmc_attach_mmc(struct mmc_host *host) BUG_ON(!host); WARN_ON(!host->claimed); + /* Set correct bus mode for MMC before attempting attach */ + if (!mmc_host_is_spi(host)) + mmc_set_bus_mode(host, MMC_BUSMODE_OPENDRAIN); + err = mmc_send_op_cond(host, 0, &ocr); if (err) return err; diff --git a/trunk/drivers/mmc/core/sd.c b/trunk/drivers/mmc/core/sd.c index 4c281a4bf058..342b18c4afcb 100644 --- a/trunk/drivers/mmc/core/sd.c +++ b/trunk/drivers/mmc/core/sd.c @@ -929,8 +929,6 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, err = mmc_send_relative_addr(host, &card->rca); if (err) return err; - - mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL); } if (!oldcard) { diff --git a/trunk/drivers/mmc/core/sdio.c b/trunk/drivers/mmc/core/sdio.c index ac492ac974e1..698d813cff3b 100644 --- a/trunk/drivers/mmc/core/sdio.c +++ b/trunk/drivers/mmc/core/sdio.c @@ -408,8 +408,6 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, */ if (oldcard) oldcard->rca = card->rca; - - mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL); } /*