diff options
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 18d3f19ef4e5..fad9250e4bc9 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -2070,6 +2070,25 @@ static int __devexit omap_hsmmc_remove(struct platform_device *pdev) | |||
2070 | } | 2070 | } |
2071 | 2071 | ||
2072 | #ifdef CONFIG_PM | 2072 | #ifdef CONFIG_PM |
2073 | static int omap_hsmmc_prepare(struct device *dev) | ||
2074 | { | ||
2075 | struct omap_hsmmc_host *host = dev_get_drvdata(dev); | ||
2076 | |||
2077 | if (host->pdata->suspend) | ||
2078 | return host->pdata->suspend(dev, host->slot_id); | ||
2079 | |||
2080 | return 0; | ||
2081 | } | ||
2082 | |||
2083 | static void omap_hsmmc_complete(struct device *dev) | ||
2084 | { | ||
2085 | struct omap_hsmmc_host *host = dev_get_drvdata(dev); | ||
2086 | |||
2087 | if (host->pdata->resume) | ||
2088 | host->pdata->resume(dev, host->slot_id); | ||
2089 | |||
2090 | } | ||
2091 | |||
2073 | static int omap_hsmmc_suspend(struct device *dev) | 2092 | static int omap_hsmmc_suspend(struct device *dev) |
2074 | { | 2093 | { |
2075 | int ret = 0; | 2094 | int ret = 0; |
@@ -2083,23 +2102,10 @@ static int omap_hsmmc_suspend(struct device *dev) | |||
2083 | 2102 | ||
2084 | pm_runtime_get_sync(host->dev); | 2103 | pm_runtime_get_sync(host->dev); |
2085 | host->suspended = 1; | 2104 | host->suspended = 1; |
2086 | if (host->pdata->suspend) { | ||
2087 | ret = host->pdata->suspend(dev, host->slot_id); | ||
2088 | if (ret) { | ||
2089 | dev_dbg(dev, "Unable to handle MMC board" | ||
2090 | " level suspend\n"); | ||
2091 | host->suspended = 0; | ||
2092 | return ret; | ||
2093 | } | ||
2094 | } | ||
2095 | ret = mmc_suspend_host(host->mmc); | 2105 | ret = mmc_suspend_host(host->mmc); |
2096 | 2106 | ||
2097 | if (ret) { | 2107 | if (ret) { |
2098 | host->suspended = 0; | 2108 | host->suspended = 0; |
2099 | if (host->pdata->resume) { | ||
2100 | if (host->pdata->resume(dev, host->slot_id)) | ||
2101 | dev_dbg(dev, "Unmask interrupt failed\n"); | ||
2102 | } | ||
2103 | goto err; | 2109 | goto err; |
2104 | } | 2110 | } |
2105 | 2111 | ||
@@ -2136,12 +2142,6 @@ static int omap_hsmmc_resume(struct device *dev) | |||
2136 | if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) | 2142 | if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) |
2137 | omap_hsmmc_conf_bus_power(host); | 2143 | omap_hsmmc_conf_bus_power(host); |
2138 | 2144 | ||
2139 | if (host->pdata->resume) { | ||
2140 | ret = host->pdata->resume(dev, host->slot_id); | ||
2141 | if (ret) | ||
2142 | dev_dbg(dev, "Unmask interrupt failed\n"); | ||
2143 | } | ||
2144 | |||
2145 | omap_hsmmc_protect_card(host); | 2145 | omap_hsmmc_protect_card(host); |
2146 | 2146 | ||
2147 | /* Notify the core to resume the host */ | 2147 | /* Notify the core to resume the host */ |
@@ -2157,8 +2157,10 @@ static int omap_hsmmc_resume(struct device *dev) | |||
2157 | } | 2157 | } |
2158 | 2158 | ||
2159 | #else | 2159 | #else |
2160 | #define omap_hsmmc_prepare NULL | ||
2161 | #define omap_hsmmc_complete NULL | ||
2160 | #define omap_hsmmc_suspend NULL | 2162 | #define omap_hsmmc_suspend NULL |
2161 | #define omap_hsmmc_resume NULL | 2163 | #define omap_hsmmc_resume NULL |
2162 | #endif | 2164 | #endif |
2163 | 2165 | ||
2164 | static int omap_hsmmc_runtime_suspend(struct device *dev) | 2166 | static int omap_hsmmc_runtime_suspend(struct device *dev) |
@@ -2186,6 +2188,8 @@ static int omap_hsmmc_runtime_resume(struct device *dev) | |||
2186 | static struct dev_pm_ops omap_hsmmc_dev_pm_ops = { | 2188 | static struct dev_pm_ops omap_hsmmc_dev_pm_ops = { |
2187 | .suspend = omap_hsmmc_suspend, | 2189 | .suspend = omap_hsmmc_suspend, |
2188 | .resume = omap_hsmmc_resume, | 2190 | .resume = omap_hsmmc_resume, |
2191 | .prepare = omap_hsmmc_prepare, | ||
2192 | .complete = omap_hsmmc_complete, | ||
2189 | .runtime_suspend = omap_hsmmc_runtime_suspend, | 2193 | .runtime_suspend = omap_hsmmc_runtime_suspend, |
2190 | .runtime_resume = omap_hsmmc_runtime_resume, | 2194 | .runtime_resume = omap_hsmmc_runtime_resume, |
2191 | }; | 2195 | }; |