Skip to content

Commit 83a7b32

Browse files
masahir0ystorulf
authored andcommitted
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 <[email protected]> Acked-by: Adrian Hunter <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent 1ab0d2d commit 83a7b32

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

drivers/mmc/host/sdhci-cadence.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -391,24 +391,6 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
391391
}
392392

393393
#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-
412394
static int sdhci_cdns_resume(struct device *dev)
413395
{
414396
struct sdhci_host *host = dev_get_drvdata(dev);
@@ -438,7 +420,7 @@ static int sdhci_cdns_resume(struct device *dev)
438420
#endif
439421

440422
static const struct dev_pm_ops sdhci_cdns_pm_ops = {
441-
SET_SYSTEM_SLEEP_PM_OPS(sdhci_cdns_suspend, sdhci_cdns_resume)
423+
SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_cdns_resume)
442424
};
443425

444426
static const struct of_device_id sdhci_cdns_match[] = {

drivers/mmc/host/sdhci-pltfm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ int sdhci_pltfm_unregister(struct platform_device *pdev)
209209
EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister);
210210

211211
#ifdef CONFIG_PM_SLEEP
212-
static int sdhci_pltfm_suspend(struct device *dev)
212+
int sdhci_pltfm_suspend(struct device *dev)
213213
{
214214
struct sdhci_host *host = dev_get_drvdata(dev);
215215
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -226,8 +226,9 @@ static int sdhci_pltfm_suspend(struct device *dev)
226226

227227
return 0;
228228
}
229+
EXPORT_SYMBOL_GPL(sdhci_pltfm_suspend);
229230

230-
static int sdhci_pltfm_resume(struct device *dev)
231+
int sdhci_pltfm_resume(struct device *dev)
231232
{
232233
struct sdhci_host *host = dev_get_drvdata(dev);
233234
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -243,6 +244,7 @@ static int sdhci_pltfm_resume(struct device *dev)
243244

244245
return ret;
245246
}
247+
EXPORT_SYMBOL_GPL(sdhci_pltfm_resume);
246248
#endif
247249

248250
const struct dev_pm_ops sdhci_pltfm_pmops = {

drivers/mmc/host/sdhci-pltfm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ static inline void *sdhci_pltfm_priv(struct sdhci_pltfm_host *host)
109109
return host->private;
110110
}
111111

112+
int sdhci_pltfm_suspend(struct device *dev);
113+
int sdhci_pltfm_resume(struct device *dev);
112114
extern const struct dev_pm_ops sdhci_pltfm_pmops;
113115

114116
#endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */

0 commit comments

Comments
 (0)