diff options
| -rw-r--r-- | drivers/mmc/core/sdio.c | 36 | ||||
| -rw-r--r-- | include/linux/mmc/card.h | 2 |
2 files changed, 32 insertions, 6 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index b0b6ce93e519..bd2755e8d9a3 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c | |||
| @@ -63,13 +63,19 @@ static int sdio_init_func(struct mmc_card *card, unsigned int fn) | |||
| 63 | 63 | ||
| 64 | func->num = fn; | 64 | func->num = fn; |
| 65 | 65 | ||
| 66 | ret = sdio_read_fbr(func); | 66 | if (!(card->quirks & MMC_QUIRK_NONSTD_SDIO)) { |
| 67 | if (ret) | 67 | ret = sdio_read_fbr(func); |
| 68 | goto fail; | 68 | if (ret) |
| 69 | goto fail; | ||
| 69 | 70 | ||
| 70 | ret = sdio_read_func_cis(func); | 71 | ret = sdio_read_func_cis(func); |
| 71 | if (ret) | 72 | if (ret) |
| 72 | goto fail; | 73 | goto fail; |
| 74 | } else { | ||
| 75 | func->vendor = func->card->cis.vendor; | ||
| 76 | func->device = func->card->cis.device; | ||
| 77 | func->max_blksize = func->card->cis.blksize; | ||
| 78 | } | ||
| 73 | 79 | ||
| 74 | card->sdio_func[fn - 1] = func; | 80 | card->sdio_func[fn - 1] = func; |
| 75 | 81 | ||
| @@ -412,6 +418,23 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, | |||
| 412 | goto remove; | 418 | goto remove; |
| 413 | } | 419 | } |
| 414 | 420 | ||
| 421 | if (card->quirks & MMC_QUIRK_NONSTD_SDIO) { | ||
| 422 | /* | ||
| 423 | * This is non-standard SDIO device, meaning it doesn't | ||
| 424 | * have any CIA (Common I/O area) registers present. | ||
| 425 | * It's host's responsibility to fill cccr and cis | ||
| 426 | * structures in init_card(). | ||
| 427 | */ | ||
| 428 | mmc_set_clock(host, card->cis.max_dtr); | ||
| 429 | |||
| 430 | if (card->cccr.high_speed) { | ||
| 431 | mmc_card_set_highspeed(card); | ||
| 432 | mmc_set_timing(card->host, MMC_TIMING_SD_HS); | ||
| 433 | } | ||
| 434 | |||
| 435 | goto finish; | ||
| 436 | } | ||
| 437 | |||
| 415 | /* | 438 | /* |
| 416 | * Read the common registers. | 439 | * Read the common registers. |
| 417 | */ | 440 | */ |
| @@ -480,6 +503,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, | |||
| 480 | else if (err) | 503 | else if (err) |
| 481 | goto remove; | 504 | goto remove; |
| 482 | 505 | ||
| 506 | finish: | ||
| 483 | if (!oldcard) | 507 | if (!oldcard) |
| 484 | host->card = card; | 508 | host->card = card; |
| 485 | return 0; | 509 | return 0; |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 340d391aecbb..4d893eaf8174 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -103,6 +103,8 @@ struct mmc_card { | |||
| 103 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ | 103 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ |
| 104 | #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ | 104 | #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ |
| 105 | /* for byte mode */ | 105 | /* for byte mode */ |
| 106 | #define MMC_QUIRK_NONSTD_SDIO (1<<2) /* non-standard SDIO card attached */ | ||
| 107 | /* (missing CIA registers) */ | ||
| 106 | 108 | ||
| 107 | u32 raw_cid[4]; /* raw card CID */ | 109 | u32 raw_cid[4]; /* raw card CID */ |
| 108 | u32 raw_csd[4]; /* raw card CSD */ | 110 | u32 raw_csd[4]; /* raw card CSD */ |
