aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorJaehoon Chung <jh80.chung@samsung.com>2011-12-08 05:23:03 -0500
committerChris Ball <cjb@laptop.org>2012-01-11 23:58:44 -0500
commit6fe8890d0200ea0c2b7d83936d58f97d7ba7c1ff (patch)
treed400d13d6de15abf9f02eeec326ad47aab08fb9a /drivers/mmc
parenta8ad82cc1b22d04916d9cdb1dc75052e80ac803c (diff)
mmc: dw_mmc: use dev_pm_ops for dw_mmc controllers
This patch modifies dw_mmc to use dev_pm_ops. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/dw_mmc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 3aaeb0841914..44bc11e8761e 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2062,14 +2062,14 @@ static int __exit dw_mci_remove(struct platform_device *pdev)
2062 return 0; 2062 return 0;
2063} 2063}
2064 2064
2065#ifdef CONFIG_PM 2065#ifdef CONFIG_PM_SLEEP
2066/* 2066/*
2067 * TODO: we should probably disable the clock to the card in the suspend path. 2067 * TODO: we should probably disable the clock to the card in the suspend path.
2068 */ 2068 */
2069static int dw_mci_suspend(struct platform_device *pdev, pm_message_t mesg) 2069static int dw_mci_suspend(struct device *dev)
2070{ 2070{
2071 int i, ret; 2071 int i, ret;
2072 struct dw_mci *host = platform_get_drvdata(pdev); 2072 struct dw_mci *host = dev_get_drvdata(dev);
2073 2073
2074 for (i = 0; i < host->num_slots; i++) { 2074 for (i = 0; i < host->num_slots; i++) {
2075 struct dw_mci_slot *slot = host->slot[i]; 2075 struct dw_mci_slot *slot = host->slot[i];
@@ -2092,10 +2092,10 @@ static int dw_mci_suspend(struct platform_device *pdev, pm_message_t mesg)
2092 return 0; 2092 return 0;
2093} 2093}
2094 2094
2095static int dw_mci_resume(struct platform_device *pdev) 2095static int dw_mci_resume(struct device *dev)
2096{ 2096{
2097 int i, ret; 2097 int i, ret;
2098 struct dw_mci *host = platform_get_drvdata(pdev); 2098 struct dw_mci *host = dev_get_drvdata(dev);
2099 2099
2100 if (host->vmmc) 2100 if (host->vmmc)
2101 regulator_enable(host->vmmc); 2101 regulator_enable(host->vmmc);
@@ -2103,7 +2103,7 @@ static int dw_mci_resume(struct platform_device *pdev)
2103 if (host->dma_ops->init) 2103 if (host->dma_ops->init)
2104 host->dma_ops->init(host); 2104 host->dma_ops->init(host);
2105 2105
2106 if (!mci_wait_reset(&pdev->dev, host)) { 2106 if (!mci_wait_reset(dev, host)) {
2107 ret = -ENODEV; 2107 ret = -ENODEV;
2108 return ret; 2108 return ret;
2109 } 2109 }
@@ -2131,14 +2131,15 @@ static int dw_mci_resume(struct platform_device *pdev)
2131#else 2131#else
2132#define dw_mci_suspend NULL 2132#define dw_mci_suspend NULL
2133#define dw_mci_resume NULL 2133#define dw_mci_resume NULL
2134#endif /* CONFIG_PM */ 2134#endif /* CONFIG_PM_SLEEP */
2135
2136static SIMPLE_DEV_PM_OPS(dw_mci_pmops, dw_mci_suspend, dw_mci_resume);
2135 2137
2136static struct platform_driver dw_mci_driver = { 2138static struct platform_driver dw_mci_driver = {
2137 .remove = __exit_p(dw_mci_remove), 2139 .remove = __exit_p(dw_mci_remove),
2138 .suspend = dw_mci_suspend,
2139 .resume = dw_mci_resume,
2140 .driver = { 2140 .driver = {
2141 .name = "dw_mmc", 2141 .name = "dw_mmc",
2142 .pm = &dw_mci_pmops,
2142 }, 2143 },
2143}; 2144};
2144 2145