mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
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>
This commit is contained in:
parent
a8ad82cc1b
commit
6fe8890d02
1 changed files with 10 additions and 9 deletions
|
@ -2062,14 +2062,14 @@ static int __exit dw_mci_remove(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
/*
|
/*
|
||||||
* TODO: we should probably disable the clock to the card in the suspend path.
|
* TODO: we should probably disable the clock to the card in the suspend path.
|
||||||
*/
|
*/
|
||||||
static int dw_mci_suspend(struct platform_device *pdev, pm_message_t mesg)
|
static int dw_mci_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
struct dw_mci *host = platform_get_drvdata(pdev);
|
struct dw_mci *host = dev_get_drvdata(dev);
|
||||||
|
|
||||||
for (i = 0; i < host->num_slots; i++) {
|
for (i = 0; i < host->num_slots; i++) {
|
||||||
struct dw_mci_slot *slot = host->slot[i];
|
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)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dw_mci_resume(struct platform_device *pdev)
|
static int dw_mci_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
struct dw_mci *host = platform_get_drvdata(pdev);
|
struct dw_mci *host = dev_get_drvdata(dev);
|
||||||
|
|
||||||
if (host->vmmc)
|
if (host->vmmc)
|
||||||
regulator_enable(host->vmmc);
|
regulator_enable(host->vmmc);
|
||||||
|
@ -2103,7 +2103,7 @@ static int dw_mci_resume(struct platform_device *pdev)
|
||||||
if (host->dma_ops->init)
|
if (host->dma_ops->init)
|
||||||
host->dma_ops->init(host);
|
host->dma_ops->init(host);
|
||||||
|
|
||||||
if (!mci_wait_reset(&pdev->dev, host)) {
|
if (!mci_wait_reset(dev, host)) {
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2131,14 +2131,15 @@ static int dw_mci_resume(struct platform_device *pdev)
|
||||||
#else
|
#else
|
||||||
#define dw_mci_suspend NULL
|
#define dw_mci_suspend NULL
|
||||||
#define dw_mci_resume NULL
|
#define dw_mci_resume NULL
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM_SLEEP */
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(dw_mci_pmops, dw_mci_suspend, dw_mci_resume);
|
||||||
|
|
||||||
static struct platform_driver dw_mci_driver = {
|
static struct platform_driver dw_mci_driver = {
|
||||||
.remove = __exit_p(dw_mci_remove),
|
.remove = __exit_p(dw_mci_remove),
|
||||||
.suspend = dw_mci_suspend,
|
|
||||||
.resume = dw_mci_resume,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "dw_mmc",
|
.name = "dw_mmc",
|
||||||
|
.pm = &dw_mci_pmops,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue