#define sdhci_pci_power_up_host NULL
#endif
+static int sdhci_pci_get_cd(struct sdhci_host *host)
+{
+ bool present;
+
+ /* If nonremovable or polling, assume that the card is always present */
+ if ((host->mmc->caps & MMC_CAP_NONREMOVABLE) ||
+ (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION))
+ present = true;
+ else
+ present = sdhci_readl(host, SDHCI_PRESENT_STATE) &
+ SDHCI_CARD_PRESENT;
+
+ return present;
+}
+
static struct sdhci_ops sdhci_pci_ops = {
.enable_dma = sdhci_pci_enable_dma,
.platform_8bit_width = sdhci_pci_8bit_width,
.hw_reset = sdhci_pci_hw_reset,
.power_up_host = sdhci_pci_power_up_host,
+ .get_cd = sdhci_pci_get_cd,
};
/*****************************************************************************\
sdhci_runtime_pm_put(host);
}
+static int sdhci_get_cd(struct mmc_host *mmc)
+{
+ struct sdhci_host *host = mmc_priv(mmc);
+ int present = -EOPNOTSUPP;
+
+ if (host->ops->get_cd) {
+ sdhci_runtime_pm_get(host);
+ present = host->ops->get_cd(host);
+ sdhci_runtime_pm_put(host);
+ }
+
+ return present;
+}
+
static const struct mmc_host_ops sdhci_ops = {
.request = sdhci_request,
.set_ios = sdhci_set_ios,
.start_signal_voltage_switch = sdhci_start_signal_voltage_switch,
.execute_tuning = sdhci_execute_tuning,
.enable_preset_value = sdhci_enable_preset_value,
+ .get_cd = sdhci_get_cd,
};
/*****************************************************************************\
host = (struct sdhci_host*)param;
+ cancel_delayed_work(&host->mmc->detect);
+
spin_lock_irqsave(&host->lock, flags);
/* Check host->mrq first in case we are runtime suspended */
spin_unlock_irqrestore(&host->lock, flags);
- mmc_detect_change(host->mmc, msecs_to_jiffies(200));
+ mmc_detect_change(host->mmc, msecs_to_jiffies(500));
}
static void sdhci_tasklet_finish(unsigned long param)
* upon error conditions.
*/
if (!(host->flags & SDHCI_DEVICE_DEAD) &&
- ((mrq->cmd && mrq->cmd->error) ||
+ ((mrq->cmd && mrq->cmd->error && mrq->cmd->error != -ENOMEDIUM) ||
(mrq->data && (mrq->data->error ||
(mrq->data->stop && mrq->data->stop->error))) ||
(host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) {