static int sdhci_pm_resume(struct device *dev) {
    int retval = 0;
    unsigned long flags;
    struct platform_device *pdev = container_of(dev, struct platform_device, dev);
    struct sdhci_host *host = platform_get_drvdata(pdev);
    struct mmc_host *mmc = host->mmc;
    spin_lock_irqsave(&host->lock, flags);
    if(host->ops->set_clock)
        host->ops->set_clock(host, 1);
    spin_unlock_irqrestore(&host->lock, flags);

#ifdef CONFIG_MMC_HOST_WAKEUP_SUPPORTED
        if(!strcmp(host->hw_name, "Spread SDIO host1")) {
            sdhci_host_wakeup_clear(host);
        }
#endif
    retval = sdhci_resume_host(host);
    if(!retval) {
#ifdef CONFIG_PM_RUNTIME
        if(pm_runtime_enabled(dev))
            pm_runtime_put_autosuspend(dev);
#endif
    }
    return retval;

}
示例#2
0
static int sdhci_pm_resume(struct device *dev) {
    int				 retval = 0;
    unsigned long		 flags;
    struct platform_device	*pdev	= container_of(dev, struct platform_device, dev);
    struct sdhci_host		*host	= platform_get_drvdata(pdev);
    printk("%s: %s enter\n", mmc_hostname(host->mmc), __func__);
    if(is_wifi_slot(host) || is_cbp_slot(host) || is_sd_slot(host)) {
	    sdhci_sprd_set_base_clock(host);
    }
    spin_lock_irqsave(&host->lock, flags);
    if(host->ops->set_clock)
        host->ops->set_clock(host, 1);
    spin_unlock_irqrestore(&host->lock, flags);

    if(is_wifi_slot(host))
    {
        printk("[WLAN] resume read REG_AP_CLK_AP_AHB_CFG is %x\n",__raw_readl(REG_AP_CLK_AP_AHB_CFG));
		printk("[WLAN] resume read REG_AP_CLK_SDIO1_CFG is %x\n",__raw_readl(REG_AP_CLK_SDIO1_CFG));
	}
    
#ifdef CONFIG_MMC_HOST_WAKEUP_SUPPORTED
    if (pdev->id == 1)
        sdhci_host_wakeup_clear(host);
#endif
    retval = sdhci_resume_host(host);
#ifdef CONFIG_PM_RUNTIME
    if(pm_runtime_enabled(dev))
        pm_runtime_put_autosuspend(dev);
#endif
    if(is_wifi_slot(host))
     {
        dhd_mmc_suspend	= 0;
	printk("[WLAN] %s,dhd_mmc_suspend=%d\n",__func__,dhd_mmc_suspend);
     }
    printk("%s: %s leave retval %d\n", mmc_hostname(host->mmc), __func__, retval);
    return retval;
}