Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208435
b: refs/heads/master
c: 6f51be3
h: refs/heads/master
i:
  208433: 5a0fcc7
  208431: 71bca38
v: v3
  • Loading branch information
Grazvydas Ignotas authored and Linus Torvalds committed Aug 11, 2010
1 parent ad9c71b commit 0db99a9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 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: 20b1597bcf4a76ccab232fa032f5f9ad30069167
refs/heads/master: 6f51be3d37dff73cf8db771df4169f4c2f1cbf66
36 changes: 30 additions & 6 deletions trunk/drivers/mmc/core/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,19 @@ static int sdio_init_func(struct mmc_card *card, unsigned int fn)

func->num = fn;

ret = sdio_read_fbr(func);
if (ret)
goto fail;
if (!(card->quirks & MMC_QUIRK_NONSTD_SDIO)) {
ret = sdio_read_fbr(func);
if (ret)
goto fail;

ret = sdio_read_func_cis(func);
if (ret)
goto fail;
ret = sdio_read_func_cis(func);
if (ret)
goto fail;
} else {
func->vendor = func->card->cis.vendor;
func->device = func->card->cis.device;
func->max_blksize = func->card->cis.blksize;
}

card->sdio_func[fn - 1] = func;

Expand Down Expand Up @@ -412,6 +418,23 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
goto remove;
}

if (card->quirks & MMC_QUIRK_NONSTD_SDIO) {
/*
* This is non-standard SDIO device, meaning it doesn't
* have any CIA (Common I/O area) registers present.
* It's host's responsibility to fill cccr and cis
* structures in init_card().
*/
mmc_set_clock(host, card->cis.max_dtr);

if (card->cccr.high_speed) {
mmc_card_set_highspeed(card);
mmc_set_timing(card->host, MMC_TIMING_SD_HS);
}

goto finish;
}

/*
* Read the common registers.
*/
Expand Down Expand Up @@ -480,6 +503,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
else if (err)
goto remove;

finish:
if (!oldcard)
host->card = card;
return 0;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/mmc/card.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ struct mmc_card {
#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */
#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */
/* for byte mode */
#define MMC_QUIRK_NONSTD_SDIO (1<<2) /* non-standard SDIO card attached */
/* (missing CIA registers) */

u32 raw_cid[4]; /* raw card CID */
u32 raw_csd[4]; /* raw card CSD */
Expand Down

0 comments on commit 0db99a9

Please sign in to comment.