sdhci-pltfm.c (1ab0d2d79b9a3868afd1afb172f0e084f0915892) sdhci-pltfm.c (83a7b32ac66d863bfbd7bfdbf29dd61db72193de)
1/*
2 * sdhci-pltfm.c Support for SDHCI platform devices
3 * Copyright (c) 2009 Intel Corporation
4 *
5 * Copyright (c) 2007, 2011 Freescale Semiconductor, Inc.
6 * Copyright (c) 2009 MontaVista Software, Inc.
7 *
8 * Authors: Xiaobo Xie <X.Xie@freescale.com>

--- 195 unchanged lines hidden (view full) ---

204 clk_disable_unprepare(pltfm_host->clk);
205 sdhci_pltfm_free(pdev);
206
207 return 0;
208}
209EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister);
210
211#ifdef CONFIG_PM_SLEEP
1/*
2 * sdhci-pltfm.c Support for SDHCI platform devices
3 * Copyright (c) 2009 Intel Corporation
4 *
5 * Copyright (c) 2007, 2011 Freescale Semiconductor, Inc.
6 * Copyright (c) 2009 MontaVista Software, Inc.
7 *
8 * Authors: Xiaobo Xie <X.Xie@freescale.com>

--- 195 unchanged lines hidden (view full) ---

204 clk_disable_unprepare(pltfm_host->clk);
205 sdhci_pltfm_free(pdev);
206
207 return 0;
208}
209EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister);
210
211#ifdef CONFIG_PM_SLEEP
212static int sdhci_pltfm_suspend(struct device *dev)
212int sdhci_pltfm_suspend(struct device *dev)
213{
214 struct sdhci_host *host = dev_get_drvdata(dev);
215 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
216 int ret;
217
218 if (host->tuning_mode != SDHCI_TUNING_MODE_3)
219 mmc_retune_needed(host->mmc);
220
221 ret = sdhci_suspend_host(host);
222 if (ret)
223 return ret;
224
225 clk_disable_unprepare(pltfm_host->clk);
226
227 return 0;
228}
213{
214 struct sdhci_host *host = dev_get_drvdata(dev);
215 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
216 int ret;
217
218 if (host->tuning_mode != SDHCI_TUNING_MODE_3)
219 mmc_retune_needed(host->mmc);
220
221 ret = sdhci_suspend_host(host);
222 if (ret)
223 return ret;
224
225 clk_disable_unprepare(pltfm_host->clk);
226
227 return 0;
228}
229EXPORT_SYMBOL_GPL(sdhci_pltfm_suspend);
229
230
230static int sdhci_pltfm_resume(struct device *dev)
231int sdhci_pltfm_resume(struct device *dev)
231{
232 struct sdhci_host *host = dev_get_drvdata(dev);
233 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
234 int ret;
235
236 ret = clk_prepare_enable(pltfm_host->clk);
237 if (ret)
238 return ret;
239
240 ret = sdhci_resume_host(host);
241 if (ret)
242 clk_disable_unprepare(pltfm_host->clk);
243
244 return ret;
245}
232{
233 struct sdhci_host *host = dev_get_drvdata(dev);
234 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
235 int ret;
236
237 ret = clk_prepare_enable(pltfm_host->clk);
238 if (ret)
239 return ret;
240
241 ret = sdhci_resume_host(host);
242 if (ret)
243 clk_disable_unprepare(pltfm_host->clk);
244
245 return ret;
246}
247EXPORT_SYMBOL_GPL(sdhci_pltfm_resume);
246#endif
247
248const struct dev_pm_ops sdhci_pltfm_pmops = {
249 SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_pltfm_resume)
250};
251EXPORT_SYMBOL_GPL(sdhci_pltfm_pmops);
252
253static int __init sdhci_pltfm_drv_init(void)

--- 15 unchanged lines hidden ---
248#endif
249
250const struct dev_pm_ops sdhci_pltfm_pmops = {
251 SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_pltfm_resume)
252};
253EXPORT_SYMBOL_GPL(sdhci_pltfm_pmops);
254
255static int __init sdhci_pltfm_drv_init(void)

--- 15 unchanged lines hidden ---