struct mmc_driver *drv = to_mmc_driver(dev->driver);
struct mmc_card *card = mmc_dev_to_card(dev);
struct mmc_host *host = card->host;
- int ret;
+ int ret = 0;
if (dev->driver && drv->suspend) {
ret = drv->suspend(card);
if (ret)
return ret;
}
-
- ret = host->bus_ops->suspend(host);
+
+ if(host->bus_ops->suspend)
+ ret = host->bus_ops->suspend(host);
return ret;
}
struct mmc_driver *drv = to_mmc_driver(dev->driver);
struct mmc_card *card = mmc_dev_to_card(dev);
struct mmc_host *host = card->host;
- int ret;
-
- ret = host->bus_ops->resume(host);
- if (ret)
- pr_warn("%s: error %d during resume (card was removed?)\n",
- mmc_hostname(host), ret);
+ int ret = 0;
+ if(host->bus_ops->resume){
+ ret = host->bus_ops->resume(host);
+ if (ret)
+ pr_warn("%s: error %d during resume (card was removed?)\n",
+ mmc_hostname(host), ret);
+ }
+
if (dev->driver && drv->resume)
ret = drv->resume(card);
if (of_find_property(host->dev->of_node, "supports-emmc", NULL))
mmc->restrict_caps |= RESTRICT_CARD_TYPE_EMMC;
+ //if(mmc->restrict_caps & RESTRICT_CARD_TYPE_EMMC)
+ // mmc->caps |= MMC_CAP_NONREMOVABLE;
+
+ /* eMMC should not sched into pm mgmt framework*/
+ if(mmc->restrict_caps & RESTRICT_CARD_TYPE_EMMC)
+ mmc->pm_flags |= MMC_PM_IGNORE_PM_NOTIFY;
+
if (host->pdata->get_ocr)
mmc->ocr_avail = host->pdata->get_ocr(id);
else{
mci_writel(host, RINTSTS, 0xFFFFFFFF);
regs = SDMMC_INT_CMD_DONE | SDMMC_INT_DATA_OVER | SDMMC_INT_TXDR |
SDMMC_INT_RXDR | DW_MCI_ERROR_FLAGS;
- if(!(host->mmc->restrict_caps & RESTRICT_CARD_TYPE_SDIO))
- regs |= SDMMC_INT_CD;
+ if(!(host->mmc->restrict_caps & RESTRICT_CARD_TYPE_SDIO)
+ && !(host->mmc->restrict_caps & RESTRICT_CARD_TYPE_EMMC))
+ regs |= SDMMC_INT_CD;
+
mci_writel(host, INTMASK, regs);
-
- mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); /* Enable mci interrupt */
+ mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); /* Enable mci interrupt */
+
dev_info(host->dev, "DW MMC controller at irq %d, "
"%d bit host data width, "
"%u deep fifo\n",
*/
int dw_mci_suspend(struct dw_mci *host)
{
- /*int i, ret = 0;
-
- for (i = 0; i < host->num_slots; i++) {
- struct dw_mci_slot *slot = host->slot[i];
- if (!slot)
- continue;
- ret = mmc_suspend_host(slot->mmc);
- if (ret < 0) {
- while (--i >= 0) {
- slot = host->slot[i];
- if (slot)
- mmc_resume_host(host->slot[i]->mmc);
- }
- return ret;
- }
- }
- */
+
if (host->vmmc)
regulator_disable(host->vmmc);
dw_mci_set_ios(slot->mmc, &slot->mmc->ios);
dw_mci_setup_bus(slot, true);
}
-
- // ret = mmc_resume_host(host->slot[i]->mmc);
- // if (ret < 0)
- // return ret;
}
return 0;
}