Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125506
b: refs/heads/master
c: b30f8af
h: refs/heads/master
v: v3
  • Loading branch information
Jarkko Lavinen authored and Pierre Ossman committed Dec 31, 2008
1 parent 91b1fc7 commit 0d64791
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 35ff8554d12ecc80a46ea0d9bce34fe28733ff38
refs/heads/master: b30f8af3358b5c66be223e3a9f3d11b3d02b4a8f
18 changes: 14 additions & 4 deletions trunk/drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,13 +434,24 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
* Activate wide bus (if supported).
*/
if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
(host->caps & MMC_CAP_4_BIT_DATA)) {
(host->caps & (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA))) {
unsigned ext_csd_bit, bus_width;

if (host->caps & MMC_CAP_8_BIT_DATA) {
ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
bus_width = MMC_BUS_WIDTH_8;
} else {
ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
bus_width = MMC_BUS_WIDTH_4;
}

err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_4);
EXT_CSD_BUS_WIDTH, ext_csd_bit);

if (err)
goto free_card;

mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4);
mmc_set_bus_width(card->host, bus_width);
}

if (!oldcard)
Expand Down Expand Up @@ -624,4 +635,3 @@ int mmc_attach_mmc(struct mmc_host *host, u32 ocr)

return err;
}

2 changes: 2 additions & 0 deletions trunk/include/linux/mmc/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct mmc_ios {

#define MMC_BUS_WIDTH_1 0
#define MMC_BUS_WIDTH_4 2
#define MMC_BUS_WIDTH_8 3

unsigned char timing; /* timing specification used */

Expand Down Expand Up @@ -116,6 +117,7 @@ struct mmc_host {
#define MMC_CAP_SDIO_IRQ (1 << 3) /* Can signal pending SDIO IRQs */
#define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */
#define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */
#define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */

/* host specific block data */
unsigned int max_seg_size; /* see blk_queue_max_segment_size */
Expand Down

0 comments on commit 0d64791

Please sign in to comment.