diff options
Diffstat (limited to 'drivers/mmc/core/sdio.c')
| -rw-r--r-- | drivers/mmc/core/sdio.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index b9dee28ee7d..47d1708810b 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | #include "core.h" | 19 | #include "core.h" |
| 20 | #include "bus.h" | 20 | #include "bus.h" |
| 21 | #include "sd.h" | ||
| 21 | #include "sdio_bus.h" | 22 | #include "sdio_bus.h" |
| 22 | #include "mmc_ops.h" | 23 | #include "mmc_ops.h" |
| 23 | #include "sd_ops.h" | 24 | #include "sd_ops.h" |
| @@ -245,10 +246,26 @@ static int sdio_enable_hs(struct mmc_card *card) | |||
| 245 | if (ret) | 246 | if (ret) |
| 246 | return ret; | 247 | return ret; |
| 247 | 248 | ||
| 248 | mmc_card_set_highspeed(card); | 249 | return 1; |
| 249 | mmc_set_timing(card->host, MMC_TIMING_SD_HS); | 250 | } |
| 250 | 251 | ||
| 251 | return 0; | 252 | static unsigned mmc_sdio_get_max_clock(struct mmc_card *card) |
| 253 | { | ||
| 254 | unsigned max_dtr; | ||
| 255 | |||
| 256 | if (mmc_card_highspeed(card)) { | ||
| 257 | /* | ||
| 258 | * The SDIO specification doesn't mention how | ||
| 259 | * the CIS transfer speed register relates to | ||
| 260 | * high-speed, but it seems that 50 MHz is | ||
| 261 | * mandatory. | ||
| 262 | */ | ||
| 263 | max_dtr = 50000000; | ||
| 264 | } else { | ||
| 265 | max_dtr = card->cis.max_dtr; | ||
| 266 | } | ||
| 267 | |||
| 268 | return max_dtr; | ||
| 252 | } | 269 | } |
| 253 | 270 | ||
| 254 | /* | 271 | /* |
| @@ -351,23 +368,15 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, | |||
| 351 | * Switch to high-speed (if supported). | 368 | * Switch to high-speed (if supported). |
| 352 | */ | 369 | */ |
| 353 | err = sdio_enable_hs(card); | 370 | err = sdio_enable_hs(card); |
| 354 | if (err) | 371 | if (err > 0) |
| 372 | mmc_sd_go_highspeed(card); | ||
| 373 | else if (err) | ||
| 355 | goto remove; | 374 | goto remove; |
| 356 | 375 | ||
| 357 | /* | 376 | /* |
| 358 | * Change to the card's maximum speed. | 377 | * Change to the card's maximum speed. |
| 359 | */ | 378 | */ |
| 360 | if (mmc_card_highspeed(card)) { | 379 | mmc_set_clock(host, mmc_sdio_get_max_clock(card)); |
| 361 | /* | ||
| 362 | * The SDIO specification doesn't mention how | ||
| 363 | * the CIS transfer speed register relates to | ||
| 364 | * high-speed, but it seems that 50 MHz is | ||
| 365 | * mandatory. | ||
| 366 | */ | ||
| 367 | mmc_set_clock(host, 50000000); | ||
| 368 | } else { | ||
| 369 | mmc_set_clock(host, card->cis.max_dtr); | ||
| 370 | } | ||
| 371 | 380 | ||
| 372 | /* | 381 | /* |
| 373 | * Switch to wider bus (if supported). | 382 | * Switch to wider bus (if supported). |
