Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdhci-pltfm: export sdhci_pltfm_suspend/resume

This will be useful when drivers want to reuse either suspend or
resume callback instead of whole of sdhci_pltfm_pmops.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Masahiro Yamada and committed by
Ulf Hansson
83a7b32a 1ab0d2d7

+7 -21
+1 -19
drivers/mmc/host/sdhci-cadence.c
··· 391 391 } 392 392 393 393 #ifdef CONFIG_PM_SLEEP 394 - static int sdhci_cdns_suspend(struct device *dev) 395 - { 396 - struct sdhci_host *host = dev_get_drvdata(dev); 397 - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); 398 - int ret; 399 - 400 - if (host->tuning_mode != SDHCI_TUNING_MODE_3) 401 - mmc_retune_needed(host->mmc); 402 - 403 - ret = sdhci_suspend_host(host); 404 - if (ret) 405 - return ret; 406 - 407 - clk_disable_unprepare(pltfm_host->clk); 408 - 409 - return 0; 410 - } 411 - 412 394 static int sdhci_cdns_resume(struct device *dev) 413 395 { 414 396 struct sdhci_host *host = dev_get_drvdata(dev); ··· 420 438 #endif 421 439 422 440 static const struct dev_pm_ops sdhci_cdns_pm_ops = { 423 - SET_SYSTEM_SLEEP_PM_OPS(sdhci_cdns_suspend, sdhci_cdns_resume) 441 + SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_cdns_resume) 424 442 }; 425 443 426 444 static const struct of_device_id sdhci_cdns_match[] = {
+4 -2
drivers/mmc/host/sdhci-pltfm.c
··· 209 209 EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister); 210 210 211 211 #ifdef CONFIG_PM_SLEEP 212 - static int sdhci_pltfm_suspend(struct device *dev) 212 + int sdhci_pltfm_suspend(struct device *dev) 213 213 { 214 214 struct sdhci_host *host = dev_get_drvdata(dev); 215 215 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); ··· 226 226 227 227 return 0; 228 228 } 229 + EXPORT_SYMBOL_GPL(sdhci_pltfm_suspend); 229 230 230 - static int sdhci_pltfm_resume(struct device *dev) 231 + int sdhci_pltfm_resume(struct device *dev) 231 232 { 232 233 struct sdhci_host *host = dev_get_drvdata(dev); 233 234 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); ··· 244 243 245 244 return ret; 246 245 } 246 + EXPORT_SYMBOL_GPL(sdhci_pltfm_resume); 247 247 #endif 248 248 249 249 const struct dev_pm_ops sdhci_pltfm_pmops = {
+2
drivers/mmc/host/sdhci-pltfm.h
··· 109 109 return host->private; 110 110 } 111 111 112 + int sdhci_pltfm_suspend(struct device *dev); 113 + int sdhci_pltfm_resume(struct device *dev); 112 114 extern const struct dev_pm_ops sdhci_pltfm_pmops; 113 115 114 116 #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */