TMIO_STAT_WRPROTECT);
 }
 
+static int tmio_mmc_get_cd(struct mmc_host *mmc)
+{
+       struct tmio_mmc_host *host = mmc_priv(mmc);
+
+       return !!(sd_ctrl_read16_and_16_as_32(host, CTL_STATUS) &
+                 TMIO_STAT_SIGSTATE);
+}
+
 static int tmio_multi_io_quirk(struct mmc_card *card,
                               unsigned int direction, int blk_size)
 {
        .request        = tmio_mmc_request,
        .set_ios        = tmio_mmc_set_ios,
        .get_ro         = tmio_mmc_get_ro,
-       .get_cd         = mmc_gpio_get_cd,
+       .get_cd         = tmio_mmc_get_cd,
        .enable_sdio_irq = tmio_mmc_enable_sdio_irq,
        .multi_io_quirk = tmio_multi_io_quirk,
        .hw_reset       = tmio_mmc_hw_reset,
        if (mmc_can_gpio_ro(mmc))
                _host->ops.get_ro = mmc_gpio_get_ro;
 
+       if (mmc_can_gpio_cd(mmc))
+               _host->ops.get_cd = mmc_gpio_get_cd;
+
        _host->native_hotplug = !(mmc_can_gpio_cd(mmc) ||
                                  mmc->caps & MMC_CAP_NEEDS_POLL ||
                                  !mmc_card_is_removable(mmc));