|
@@ -28,6 +28,7 @@
|
|
|
#include <linux/mmc/mmc.h>
|
|
|
#include <linux/mmc/host.h>
|
|
|
#include <linux/mmc/card.h>
|
|
|
+#include <linux/mmc/slot-gpio.h>
|
|
|
|
|
|
#include "sdhci.h"
|
|
|
|
|
@@ -1293,6 +1294,13 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
|
|
|
present = sdhci_readl(host, SDHCI_PRESENT_STATE) &
|
|
|
SDHCI_CARD_PRESENT;
|
|
|
|
|
|
+ /* If we're using a cd-gpio, testing the presence bit might fail. */
|
|
|
+ if (!present) {
|
|
|
+ int ret = mmc_gpio_get_cd(host->mmc);
|
|
|
+ if (ret > 0)
|
|
|
+ present = true;
|
|
|
+ }
|
|
|
+
|
|
|
if (!present || host->flags & SDHCI_DEVICE_DEAD) {
|
|
|
host->mrq->cmd->error = -ENOMEDIUM;
|
|
|
tasklet_schedule(&host->finish_tasklet);
|