static int rk28_sdmmc0_resume(struct platform_device *pdev) { struct mmc_host *mmc = platform_get_drvdata(pdev); int ret = 0; /*sd card remove/insert occuerd when suspend, do resume work themselve in the isr*/ spin_lock( &sdmmc0_spinlock); if(sd_cdt_resume) { sd_cdt_resume = 0; spin_unlock( &sdmmc0_spinlock); return 0; } spin_unlock( &sdmmc0_spinlock); if (mmc) { spin_lock( &sdmmc0_spinlock); sdmmc0_disable_Irq_ForRemoval = 1; //关中断 spin_unlock( &sdmmc0_spinlock); ret = mmc_resume_host(mmc); } spin_lock( &sdmmc0_spinlock); sd_is_suspend_mmc = 0; spin_unlock( &sdmmc0_spinlock); return ret; }
int msmsdcc_resume(struct platform_device *dev) { struct mmc_host *mmc = mmc_get_drvdata(dev); unsigned long flags; if (mmc) { struct msmsdcc_host *host = mmc_priv(mmc); spin_lock_irqsave(&host->lock, flags); if (!host->clks_on) { clk_enable(host->pclk); clk_enable(host->clk); host->clks_on = 1; } writel(host->saved_irq0mask, host->base + MMCIMASK0); spin_unlock_irqrestore(&host->lock, flags); if (mmc->card && mmc->card->type != MMC_TYPE_SDIO) #ifdef CONFIG_MMC_MSM7X00A_RESUME_IN_WQ schedule_work(&host->resume_task); #else mmc_resume_host(mmc); if (host->stat_irq) enable_irq(host->stat_irq); #endif else if (host->stat_irq) enable_irq(host->stat_irq); } return 0; }
static int sslsd_resume(struct platform_device *dev) { struct mmc_host *mmc = platform_get_drvdata(dev); enable_irq(sdhc_irq); //printk("sslsd: resume level=%d\n", level); return mmc_resume_host(mmc); }
static int msmsdcc_resume(struct platform_device *dev) { struct mmc_host *mmc = mmc_get_drvdata(dev); unsigned long flags; if (mmc) { struct msmsdcc_host *host = mmc_priv(mmc); spin_lock_irqsave(&host->lock, flags); if (!host->clks_on) { clk_enable(host->pclk); clk_enable(host->clk); host->clks_on = 1; } writel(host->saved_irq0mask, host->base + MMCIMASK0); spin_unlock_irqrestore(&host->lock, flags); if (mmc->card && mmc->card->type != MMC_TYPE_SDIO) mmc_resume_host(mmc); if (host->stat_irq) enable_irq(host->stat_irq); } return 0; }
static int at91_mci_resume(struct platform_device *pdev) { struct mmc_host *mmc = platform_get_drvdata(pdev); int ret = 0; if (mmc) ret = mmc_resume_host(mmc); return ret; }
static int s3c_hsmmc_resume(struct platform_device *pdev) { struct s3c_hsmmc_host *s3c_host = global_host[pdev->id]; struct mmc_host *host = s3c_host->mmc; s3c_hsmmc_ios_init(s3c_host); mmc_resume_host(host); return 0; }
static int sdhci_bcm2708_resume(struct platform_device *dev) { struct sdhci_host *host = (struct sdhci_host *) platform_get_drvdata(dev); int ret = 0; if (host->mmc) { ret = mmc_resume_host(host->mmc); } return ret; }
static void do_resume_work(struct work_struct *work) { struct msmsdcc_host *host = container_of(work, struct msmsdcc_host, resume_task); struct mmc_host *mmc = host->mmc; if (mmc) { mmc_resume_host(mmc); if (host->stat_irq) enable_irq(host->stat_irq); } }
static int at91_mci_resume(struct platform_device *pdev) { struct mmc_host *mmc = platform_get_drvdata(pdev); struct at91mci_host *host = mmc_priv(mmc); int ret = 0; if (host->board->det_pin && device_may_wakeup(&pdev->dev)) disable_irq_wake(host->board->det_pin); if (mmc) ret = mmc_resume_host(mmc); return ret; }
static int mmci_resume(struct amba_device *dev) { struct mmc_host *mmc = amba_get_drvdata(dev); int ret = 0; if (mmc) { struct mmci_host *host = mmc_priv(mmc); writel(MCI_IRQENABLE, host->base + MMCIMASK0); ret = mmc_resume_host(mmc); } return ret; }
static int imxmci_resume(struct platform_device *dev) { struct mmc_host *mmc = platform_get_drvdata(dev); struct imxmci_host *host; int ret = 0; if (mmc) { host = mmc_priv(mmc); if(host) set_bit(IMXMCI_PEND_SET_INIT_b, &host->pending_events); ret = mmc_resume_host(mmc); } return ret; }
static int ak98_sdio_resume(struct platform_device *dev) { struct mmc_host *mmc = platform_get_drvdata(dev); int ret = 0; if (mmc) { struct ak98_mci_host *host = mmc_priv(mmc); writel(MCI_IRQENABLE, host->base + AK88MCIMASK0); ret = mmc_resume_host(mmc); } return ret; }
static int s3c_sdi_resume(struct device *dev, u32 level) { struct platform_device* pdev = to_platform_device(dev); struct mmc_host *mmc = platform_get_drvdata(pdev); struct s3c_sdi_host *host = mmc_priv(mmc); int ret = 0; if (host && (level == RESUME_POWER_ON)) { s3c_dma_request(host->dma,&s3c_sdi_dma_client,NULL); if (mmc) ret = mmc_resume_host(mmc); } return ret; }
static int ak98_mci_resume(struct platform_device *dev) { struct mmc_host *mmc = platform_get_drvdata(dev); int ret = 0; if (mmc) { struct ak98_mci_host *host = mmc_priv(mmc); writel(MCI_CMDIRQMASKS | MCI_DATAIRQMASKS, host->base + AK98MCIMASK); ret = mmc_resume_host(mmc); } return ret; }
/* Routine to resume the MMC device */ static int omap_hsmmc_resume(struct platform_device *pdev) { int ret = 0; struct omap_hsmmc_host *host = platform_get_drvdata(pdev); if (host && !host->suspended) return 0; if (host) { ret = clk_enable(host->iclk); if (ret) goto clk_en_err; if (mmc_host_enable(host->mmc) != 0) { clk_disable(host->iclk); goto clk_en_err; } if (host->got_dbclk) clk_enable(host->dbclk); omap_hsmmc_conf_bus_power(host); if (host->pdata->resume) { ret = host->pdata->resume(&pdev->dev, host->slot_id); if (ret) dev_dbg(mmc_dev(host->mmc), "Unmask interrupt failed\n"); } omap_hsmmc_protect_card(host); /* Notify the core to resume the host */ ret = mmc_resume_host(host->mmc); if (ret == 0) host->suspended = 0; mmc_host_lazy_disable(host->mmc); } return ret; clk_en_err: dev_dbg(mmc_dev(host->mmc), "Failed to enable MMC clocks during resume\n"); return ret; }
static int tmio_mmc_resume(struct platform_device *dev) { const struct mfd_cell *cell = mfd_get_cell(dev); struct mmc_host *mmc = platform_get_drvdata(dev); int ret = 0; /* Tell the MFD core we are ready to be enabled */ if (cell->resume) { ret = cell->resume(dev); if (ret) goto out; } mmc_resume_host(mmc); out: return ret; }
/* Routine to resume the MMC device */ static int omap_mmc_resume(struct platform_device *pdev) { int ret = 0; struct mmc_omap_host *host = platform_get_drvdata(pdev); if (host && !host->suspended) return 0; if (host) { ret = clk_enable(host->fclk); if (ret) goto clk_en_err; ret = clk_enable(host->iclk); if (ret) { clk_disable(host->fclk); clk_put(host->fclk); goto clk_en_err; } if (clk_enable(host->dbclk) != 0) dev_dbg(mmc_dev(host->mmc), "Enabling debounce clk failed\n"); ret = host->pdata->resume(&pdev->dev, host->slot_id); if (ret) dev_dbg(mmc_dev(host->mmc), "Unmask interrupt failed\n"); /* Notify the core to resume the host */ ret = mmc_resume_host(host->mmc); if (ret == 0) host->suspended = 0; } return ret; clk_en_err: dev_dbg(mmc_dev(host->mmc), "Failed to enable MMC clocks during resume\n"); return ret; }
static int mmc_omap_resume(struct platform_device *pdev) { int i, ret = 0; struct mmc_omap_host *host = platform_get_drvdata(pdev); if (host == NULL || !host->suspended) return 0; for (i = 0; i < host->nr_slots; i++) { struct mmc_omap_slot *slot; slot = host->slots[i]; ret = mmc_resume_host(slot->mmc); if (ret < 0) return ret; host->suspended = 0; } return 0; }
static int msmsdcc_resume(struct platform_device *dev) { struct mmc_host *mmc = mmc_get_drvdata(dev); struct msmsdcc_host *host = mmc_priv(mmc); unsigned long flags; pr_debug("%s ++ entering\n", __func__); #ifdef CONFIG_MMC_AUTO_SUSPEND if (!test_and_clear_bit(0, &host->suspended)) return 0; #endif if (mmc) { spin_lock_irqsave(&host->lock, flags); if (!host->clks_on) { clk_enable(host->pclk); clk_enable(host->clk); host->clks_on = 1; } writel(host->mci_irqenable, host->base + MMCIMASK0); spin_unlock_irqrestore(&host->lock, flags); if (host->plat->sdiowakeup_irq) disable_irq(host->plat->sdiowakeup_irq); if (!mmc->card || mmc->card->type != MMC_TYPE_SDIO) { #ifdef CONFIG_MMC_MSM7X00A_RESUME_IN_WQ schedule_work(&host->resume_task); #else mmc_resume_host(mmc); if (host->plat->status_irq) enable_irq(host->plat->status_irq); #endif } else if (host->plat->status_irq) enable_irq(host->plat->status_irq); } pr_debug("%s -- leaving\n", __func__); return 0; }
static int msmsdcc_resume(struct platform_device *dev) { //#ifdef LG_FW_SD_CARD #if 0 printk(KERN_ERR "[yoohoo] msmsdcc_resume : start \n"); return 0; #else struct mmc_host *mmc = mmc_get_drvdata(dev); struct msmsdcc_host *host = mmc_priv(mmc); unsigned long flags; #ifdef CONFIG_MMC_AUTO_SUSPEND if (!test_and_clear_bit(0, &host->suspended)) return 0; #endif if (mmc) { spin_lock_irqsave(&host->lock, flags); if (!host->clks_on) { clk_enable(host->pclk); clk_enable(host->clk); host->clks_on = 1; } writel(MCI_IRQENABLE, host->base + MMCIMASK0); spin_unlock_irqrestore(&host->lock, flags); if (!mmc->card || mmc->card->type != MMC_TYPE_SDIO) #ifdef CONFIG_MMC_MSM7X00A_RESUME_IN_WQ schedule_work(&host->resume_task); #else mmc_resume_host(mmc); if (host->plat->status_irq) enable_irq(host->plat->status_irq); #endif else if (host->plat->status_irq) enable_irq(host->plat->status_irq); } return 0; #endif }
static int stmp3xxx_mmc_resume(struct platform_device *pdev) { struct stmp3xxx_mmc_host *host; struct stmp3xxxmmc_platform_data *mmc_data; struct mmc_host *mmc; dev_dbg(&pdev->dev, "Resuming\n"); mmc_data = pdev->dev.platform_data; mmc = platform_get_drvdata(pdev); host = mmc_priv(mmc); clk_enable(host->clk); if (mmc_data->hw_init) mmc_data->hw_init(); stmp3xxx_mmc_reset(host); stmp3xxx_mmc_dma_init(host, 1); return mmc_resume_host(mmc); }
/* Routine to resume the MMC device */ static int omap_mmc_resume(struct platform_device *pdev) { int ret = 0; struct mmc_omap_host *host = platform_get_drvdata(pdev); if (host && !host->suspended){ if (host->card_sleep){/*mmc is sleeping but mmc regulator power on*/ if (mmc_card_can_sleep(host->mmc)) mmc_card_awake(host->mmc); host->card_sleep = 0; } return 0; } if (host) { if (host->card_sleep){ host->card_sleep = 0; } if (host->pdata->resume) { ret = host->pdata->resume(&pdev->dev, host->slot_id); if (ret) dev_dbg(mmc_dev(host->mmc), "Unmask interrupt failed\n"); } /* Notify the core to resume the host */ ret = mmc_resume_host(host->mmc); if (ret == 0) host->suspended = 0; } return ret; }
static int hi_mci_resume(struct platform_device *dev) { struct mmc_host *mmc = platform_get_drvdata(dev); struct himci_host *host; int ret = 0; himci_trace(2, "begin"); himci_assert(dev); if (mmc) { host = mmc_priv(mmc); /* enable mmc clk */ hi_mci_sys_ctrl_init(host); /* enable card */ hi_mci_init_card(host); ret = mmc_resume_host(mmc); } himci_trace(2, "end"); return ret; }
int ubicom32sd_resume_host(struct ubicom32sd_host *host) { int ret; if (host->flags & UBICOM32SD_USE_DMA) { if (host->ops->enable_dma) host->ops->enable_dma(host); } ret = request_irq(host->irq, ubicom32sd_irq, IRQF_SHARED, mmc_hostname(host->mmc), host); if (ret) return ret; ubicom32sd_init(host); mmiowb(); ret = mmc_resume_host(host->mmc); if (ret) return ret; return 0; }
static int sunximmc_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct mmc_host *mmc = platform_get_drvdata(pdev); int ret = 0; if (mmc) { struct sunxi_mmc_host *smc_host = mmc_priv(mmc); if (smc_host->power_on) { /* resume pins to correct status */ sunximmc_resume_pins(smc_host); /* enable mmc hclk */ if (mmc->card && mmc->card->type!=MMC_TYPE_SDIO) clk_enable(smc_host->hclk); /* enable mmc mclk */ clk_enable(smc_host->mclk); /* restore registers */ if (mmc->card && mmc->card->type!=MMC_TYPE_SDIO) sdxc_regs_restore(smc_host); sdxc_program_clk(smc_host); /* enable irq */ enable_irq(smc_host->irq); } if (mmc->card && (mmc->card->type!=MMC_TYPE_SDIO || mmc_pm_io_shd_suspend_host())) ret = mmc_resume_host(mmc); } SMC_DBG("smc %d resume\n", pdev->id); return ret; }
/* Routine to resume the MMC device */ static int omap_mmc_resume(struct platform_device *pdev) { int ret = 0; struct mmc_omap_host *host = platform_get_drvdata(pdev); if (host && !host->suspended) return 0; if (host) { if (host->pdata->resume) { ret = host->pdata->resume(&pdev->dev, host->slot_id); if (ret) dev_dbg(mmc_dev(host->mmc), "Unmask interrupt failed\n"); } /* Notify the core to resume the host */ ret = mmc_resume_host(host->mmc); if (ret == 0) host->suspended = 0; } return ret; }
static int mmc_omap_suspend(struct platform_device *pdev, pm_message_t mesg) { int i, ret = 0; struct mmc_omap_host *host = platform_get_drvdata(pdev); if (host == NULL || host->suspended) return 0; for (i = 0; i < host->nr_slots; i++) { struct mmc_omap_slot *slot; slot = host->slots[i]; ret = mmc_suspend_host(slot->mmc, mesg); if (ret < 0) { while (--i >= 0) { slot = host->slots[i]; mmc_resume_host(slot->mmc); } return ret; } } host->suspended = 1; return 0; }
static int sh_mmcif_resume(struct device *dev) { struct sh_mmcif_host *host = dev_get_drvdata(dev); return mmc_resume_host(host->mmc); }
static int s3cmci_resume(struct platform_device *dev) { struct mmc_host *mmc = platform_get_drvdata(dev); return mmc_resume_host(mmc); }
static int sdhci_of_resume(struct of_device *ofdev) { struct sdhci_host *host = dev_get_drvdata(&ofdev->dev); return mmc_resume_host(host->mmc); }