diff options
author | Joonyoung Shim <jy0922.shim@samsung.com> | 2016-11-23 04:36:02 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2016-12-05 04:31:14 -0500 |
commit | 9b93d392fdbd336b0f1558592010c0169801afa5 (patch) | |
tree | 06952371c5f5fe2a54c5b8a72ee078e27b781e48 | |
parent | f28ef5617254a946c1a8576dc3f243347b143794 (diff) |
mmc: dw_mmc: exynos: fix to call suspend callback
The dw_mmc-exynos should be RPM_ACTIVE on probe() to call suspend
callback of runtime PM in pm_runtime_force_suspend() during first system
suspend. Also call pm_runtime_get_noresume() on probe() because it
doesn't call suspend/resume callback by runtime PM now.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/dw_mmc-exynos.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index e2439a108873..e1335289316c 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c | |||
@@ -516,10 +516,34 @@ static int dw_mci_exynos_probe(struct platform_device *pdev) | |||
516 | { | 516 | { |
517 | const struct dw_mci_drv_data *drv_data; | 517 | const struct dw_mci_drv_data *drv_data; |
518 | const struct of_device_id *match; | 518 | const struct of_device_id *match; |
519 | int ret; | ||
519 | 520 | ||
520 | match = of_match_node(dw_mci_exynos_match, pdev->dev.of_node); | 521 | match = of_match_node(dw_mci_exynos_match, pdev->dev.of_node); |
521 | drv_data = match->data; | 522 | drv_data = match->data; |
522 | return dw_mci_pltfm_register(pdev, drv_data); | 523 | |
524 | pm_runtime_get_noresume(&pdev->dev); | ||
525 | pm_runtime_set_active(&pdev->dev); | ||
526 | pm_runtime_enable(&pdev->dev); | ||
527 | |||
528 | ret = dw_mci_pltfm_register(pdev, drv_data); | ||
529 | if (ret) { | ||
530 | pm_runtime_disable(&pdev->dev); | ||
531 | pm_runtime_set_suspended(&pdev->dev); | ||
532 | pm_runtime_put_noidle(&pdev->dev); | ||
533 | |||
534 | return ret; | ||
535 | } | ||
536 | |||
537 | return 0; | ||
538 | } | ||
539 | |||
540 | static int dw_mci_exynos_remove(struct platform_device *pdev) | ||
541 | { | ||
542 | pm_runtime_disable(&pdev->dev); | ||
543 | pm_runtime_set_suspended(&pdev->dev); | ||
544 | pm_runtime_put_noidle(&pdev->dev); | ||
545 | |||
546 | return dw_mci_pltfm_remove(pdev); | ||
523 | } | 547 | } |
524 | 548 | ||
525 | static const struct dev_pm_ops dw_mci_exynos_pmops = { | 549 | static const struct dev_pm_ops dw_mci_exynos_pmops = { |
@@ -535,7 +559,7 @@ static const struct dev_pm_ops dw_mci_exynos_pmops = { | |||
535 | 559 | ||
536 | static struct platform_driver dw_mci_exynos_pltfm_driver = { | 560 | static struct platform_driver dw_mci_exynos_pltfm_driver = { |
537 | .probe = dw_mci_exynos_probe, | 561 | .probe = dw_mci_exynos_probe, |
538 | .remove = dw_mci_pltfm_remove, | 562 | .remove = dw_mci_exynos_remove, |
539 | .driver = { | 563 | .driver = { |
540 | .name = "dwmmc_exynos", | 564 | .name = "dwmmc_exynos", |
541 | .of_match_table = dw_mci_exynos_match, | 565 | .of_match_table = dw_mci_exynos_match, |