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

mmc: dw_mmc-pltfm: deploy runtime PM facilities

Let's migrate it to use runtime PM and remove the system
PM callback from this driver. With this patch, it could
handle system PM properly and could also use runtime PM
if we enable it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Shawn Lin and committed by
Ulf Hansson
ee2112be 53b27288

+8 -20
+8 -20
drivers/mmc/host/dw_mmc-pltfm.c
··· 16 16 #include <linux/io.h> 17 17 #include <linux/irq.h> 18 18 #include <linux/platform_device.h> 19 + #include <linux/pm_runtime.h> 19 20 #include <linux/slab.h> 20 21 #include <linux/mmc/host.h> 21 22 #include <linux/mmc/mmc.h> ··· 59 58 } 60 59 EXPORT_SYMBOL_GPL(dw_mci_pltfm_register); 61 60 62 - #ifdef CONFIG_PM_SLEEP 63 - /* 64 - * TODO: we should probably disable the clock to the card in the suspend path. 65 - */ 66 - static int dw_mci_pltfm_suspend(struct device *dev) 67 - { 68 - struct dw_mci *host = dev_get_drvdata(dev); 69 - 70 - return dw_mci_suspend(host); 71 - } 72 - 73 - static int dw_mci_pltfm_resume(struct device *dev) 74 - { 75 - struct dw_mci *host = dev_get_drvdata(dev); 76 - 77 - return dw_mci_resume(host); 78 - } 79 - #endif /* CONFIG_PM_SLEEP */ 80 - 81 - SIMPLE_DEV_PM_OPS(dw_mci_pltfm_pmops, dw_mci_pltfm_suspend, dw_mci_pltfm_resume); 61 + const struct dev_pm_ops dw_mci_pltfm_pmops = { 62 + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 63 + pm_runtime_force_resume) 64 + SET_RUNTIME_PM_OPS(dw_mci_runtime_suspend, 65 + dw_mci_runtime_resume, 66 + NULL) 67 + }; 82 68 EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops); 83 69 84 70 static const struct of_device_id dw_mci_pltfm_match[] = {