diff options
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 6fbbc005dd7f..fc7cb489bdb7 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -112,6 +112,9 @@ static void sdhci_set_card_detection(struct sdhci_host *host, bool enable) | |||
112 | { | 112 | { |
113 | u32 irqs = SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT; | 113 | u32 irqs = SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT; |
114 | 114 | ||
115 | if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) | ||
116 | return; | ||
117 | |||
115 | if (enable) | 118 | if (enable) |
116 | sdhci_unmask_irqs(host, irqs); | 119 | sdhci_unmask_irqs(host, irqs); |
117 | else | 120 | else |
@@ -1041,6 +1044,7 @@ out: | |||
1041 | static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) | 1044 | static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) |
1042 | { | 1045 | { |
1043 | struct sdhci_host *host; | 1046 | struct sdhci_host *host; |
1047 | bool present; | ||
1044 | unsigned long flags; | 1048 | unsigned long flags; |
1045 | 1049 | ||
1046 | host = mmc_priv(mmc); | 1050 | host = mmc_priv(mmc); |
@@ -1055,8 +1059,14 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) | |||
1055 | 1059 | ||
1056 | host->mrq = mrq; | 1060 | host->mrq = mrq; |
1057 | 1061 | ||
1058 | if (!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT) | 1062 | /* If polling, assume that the card is always present. */ |
1059 | || (host->flags & SDHCI_DEVICE_DEAD)) { | 1063 | if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) |
1064 | present = true; | ||
1065 | else | ||
1066 | present = sdhci_readl(host, SDHCI_PRESENT_STATE) & | ||
1067 | SDHCI_CARD_PRESENT; | ||
1068 | |||
1069 | if (!present || host->flags & SDHCI_DEVICE_DEAD) { | ||
1060 | host->mrq->cmd->error = -ENOMEDIUM; | 1070 | host->mrq->cmd->error = -ENOMEDIUM; |
1061 | tasklet_schedule(&host->finish_tasklet); | 1071 | tasklet_schedule(&host->finish_tasklet); |
1062 | } else | 1072 | } else |
@@ -1690,6 +1700,9 @@ int sdhci_add_host(struct sdhci_host *host) | |||
1690 | if (caps & SDHCI_CAN_DO_HISPD) | 1700 | if (caps & SDHCI_CAN_DO_HISPD) |
1691 | mmc->caps |= MMC_CAP_SD_HIGHSPEED; | 1701 | mmc->caps |= MMC_CAP_SD_HIGHSPEED; |
1692 | 1702 | ||
1703 | if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) | ||
1704 | mmc->caps |= MMC_CAP_NEEDS_POLL; | ||
1705 | |||
1693 | mmc->ocr_avail = 0; | 1706 | mmc->ocr_avail = 0; |
1694 | if (caps & SDHCI_CAN_VDD_330) | 1707 | if (caps & SDHCI_CAN_VDD_330) |
1695 | mmc->ocr_avail |= MMC_VDD_32_33|MMC_VDD_33_34; | 1708 | mmc->ocr_avail |= MMC_VDD_32_33|MMC_VDD_33_34; |