diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 19:55:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 19:55:55 -0400 |
commit | 8c1c77ff9be27137fa7cbbf51efedef1a2ae915b (patch) | |
tree | cdbd09cac5f5d1c6eb5ec4257dc478c6acca70c5 /drivers/mmc/core/sdio.c | |
parent | f3ae1c75203535f65448517e46c8dd70a56b6c71 (diff) | |
parent | 08ee80cc397ac1a306ca689a22ede954d92d0db1 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (75 commits)
mmc: core: eMMC bus width may not work on all platforms
mmc: sdhci: Auto-CMD23 fixes.
mmc: sdhci: Auto-CMD23 support.
mmc: core: Block CMD23 support for UHS104/SDXC cards.
mmc: sdhci: Implement MMC_CAP_CMD23 for SDHCI.
mmc: core: Use CMD23 for multiblock transfers when we can.
mmc: quirks: Add/remove quirks conditional support.
mmc: Add new VUB300 USB-to-SD/SDIO/MMC driver
mmc: sdhci-pxa: Add quirks for DMA/ADMA to match h/w
mmc: core: duplicated trial with same freq in mmc_rescan_try_freq()
mmc: core: add support for eMMC Dual Data Rate
mmc: core: eMMC signal voltage does not use CMD11
mmc: sdhci-pxa: add platform code for UHS signaling
mmc: sdhci: add hooks for setting UHS in platform specific code
mmc: core: clear MMC_PM_KEEP_POWER flag on resume
mmc: dw_mmc: fixed wrong regulator_enable in suspend/resume
mmc: sdhi: allow powering down controller with no card inserted
mmc: tmio: runtime suspend the controller, where possible
mmc: sdhi: support up to 3 interrupt sources
mmc: sdhi: print physical base address and clock rate
...
Diffstat (limited to 'drivers/mmc/core/sdio.c')
-rw-r--r-- | drivers/mmc/core/sdio.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index db0f0b44d684..4d0c15bfa514 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/mmc/card.h> | 16 | #include <linux/mmc/card.h> |
17 | #include <linux/mmc/sdio.h> | 17 | #include <linux/mmc/sdio.h> |
18 | #include <linux/mmc/sdio_func.h> | 18 | #include <linux/mmc/sdio_func.h> |
19 | #include <linux/mmc/sdio_ids.h> | ||
19 | 20 | ||
20 | #include "core.h" | 21 | #include "core.h" |
21 | #include "bus.h" | 22 | #include "bus.h" |
@@ -31,6 +32,11 @@ static int sdio_read_fbr(struct sdio_func *func) | |||
31 | int ret; | 32 | int ret; |
32 | unsigned char data; | 33 | unsigned char data; |
33 | 34 | ||
35 | if (mmc_card_nonstd_func_interface(func->card)) { | ||
36 | func->class = SDIO_CLASS_NONE; | ||
37 | return 0; | ||
38 | } | ||
39 | |||
34 | ret = mmc_io_rw_direct(func->card, 0, 0, | 40 | ret = mmc_io_rw_direct(func->card, 0, 0, |
35 | SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF, 0, &data); | 41 | SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF, 0, &data); |
36 | if (ret) | 42 | if (ret) |
@@ -181,7 +187,7 @@ static int sdio_disable_cd(struct mmc_card *card) | |||
181 | int ret; | 187 | int ret; |
182 | u8 ctrl; | 188 | u8 ctrl; |
183 | 189 | ||
184 | if (!card->cccr.disable_cd) | 190 | if (!mmc_card_disable_cd(card)) |
185 | return 0; | 191 | return 0; |
186 | 192 | ||
187 | ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_IF, 0, &ctrl); | 193 | ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_IF, 0, &ctrl); |
@@ -363,8 +369,8 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, | |||
363 | goto err; | 369 | goto err; |
364 | } | 370 | } |
365 | 371 | ||
366 | if (ocr & R4_MEMORY_PRESENT | 372 | if ((ocr & R4_MEMORY_PRESENT) && |
367 | && mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid) == 0) { | 373 | mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid, NULL) == 0) { |
368 | card->type = MMC_TYPE_SD_COMBO; | 374 | card->type = MMC_TYPE_SD_COMBO; |
369 | 375 | ||
370 | if (oldcard && (oldcard->type != MMC_TYPE_SD_COMBO || | 376 | if (oldcard && (oldcard->type != MMC_TYPE_SD_COMBO || |
@@ -466,7 +472,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, | |||
466 | 472 | ||
467 | card = oldcard; | 473 | card = oldcard; |
468 | } | 474 | } |
469 | mmc_fixup_device(card); | 475 | mmc_fixup_device(card, NULL); |
470 | 476 | ||
471 | if (card->type == MMC_TYPE_SD_COMBO) { | 477 | if (card->type == MMC_TYPE_SD_COMBO) { |
472 | err = mmc_sd_setup_card(host, card, oldcard != NULL); | 478 | err = mmc_sd_setup_card(host, card, oldcard != NULL); |
@@ -625,7 +631,7 @@ static int mmc_sdio_suspend(struct mmc_host *host) | |||
625 | } | 631 | } |
626 | } | 632 | } |
627 | 633 | ||
628 | if (!err && host->pm_flags & MMC_PM_KEEP_POWER) { | 634 | if (!err && mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) { |
629 | mmc_claim_host(host); | 635 | mmc_claim_host(host); |
630 | sdio_disable_wide(host->card); | 636 | sdio_disable_wide(host->card); |
631 | mmc_release_host(host); | 637 | mmc_release_host(host); |
@@ -645,10 +651,10 @@ static int mmc_sdio_resume(struct mmc_host *host) | |||
645 | mmc_claim_host(host); | 651 | mmc_claim_host(host); |
646 | 652 | ||
647 | /* No need to reinitialize powered-resumed nonremovable cards */ | 653 | /* No need to reinitialize powered-resumed nonremovable cards */ |
648 | if (mmc_card_is_removable(host) || !mmc_card_is_powered_resumed(host)) | 654 | if (mmc_card_is_removable(host) || !mmc_card_keep_power(host)) |
649 | err = mmc_sdio_init_card(host, host->ocr, host->card, | 655 | err = mmc_sdio_init_card(host, host->ocr, host->card, |
650 | (host->pm_flags & MMC_PM_KEEP_POWER)); | 656 | mmc_card_keep_power(host)); |
651 | else if (mmc_card_is_powered_resumed(host)) { | 657 | else if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) { |
652 | /* We may have switched to 1-bit mode during suspend */ | 658 | /* We may have switched to 1-bit mode during suspend */ |
653 | err = sdio_enable_4bit_bus(host->card); | 659 | err = sdio_enable_4bit_bus(host->card); |
654 | if (err > 0) { | 660 | if (err > 0) { |
@@ -691,7 +697,7 @@ static int mmc_sdio_power_restore(struct mmc_host *host) | |||
691 | 697 | ||
692 | mmc_claim_host(host); | 698 | mmc_claim_host(host); |
693 | ret = mmc_sdio_init_card(host, host->ocr, host->card, | 699 | ret = mmc_sdio_init_card(host, host->ocr, host->card, |
694 | (host->pm_flags & MMC_PM_KEEP_POWER)); | 700 | mmc_card_keep_power(host)); |
695 | if (!ret && host->sdio_irqs) | 701 | if (!ret && host->sdio_irqs) |
696 | mmc_signal_sdio_irq(host); | 702 | mmc_signal_sdio_irq(host); |
697 | mmc_release_host(host); | 703 | mmc_release_host(host); |