Commit a7d403cf authored by Eric Bénard's avatar Eric Bénard Committed by Sascha Hauer

mxcmmc: convert to pm_ops and enable/disable clock

Signed-off-by: default avatarEric Bénard <eric@eukrea.com>
Cc: s.hauer@pengutronix.de
Cc: linux-mmc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent d5efe255
...@@ -936,43 +936,47 @@ static int mxcmci_remove(struct platform_device *pdev) ...@@ -936,43 +936,47 @@ static int mxcmci_remove(struct platform_device *pdev)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int mxcmci_suspend(struct platform_device *dev, pm_message_t state) static int mxcmci_suspend(struct device *dev)
{ {
struct mmc_host *mmc = platform_get_drvdata(dev); struct mmc_host *mmc = dev_get_drvdata(dev);
struct mxcmci_host *host = mmc_priv(mmc);
int ret = 0; int ret = 0;
if (mmc) if (mmc)
ret = mmc_suspend_host(mmc); ret = mmc_suspend_host(mmc);
clk_disable(host->clk);
return ret; return ret;
} }
static int mxcmci_resume(struct platform_device *dev) static int mxcmci_resume(struct device *dev)
{ {
struct mmc_host *mmc = platform_get_drvdata(dev); struct mmc_host *mmc = dev_get_drvdata(dev);
struct mxcmci_host *host; struct mxcmci_host *host = mmc_priv(mmc);
int ret = 0; int ret = 0;
if (mmc) { clk_enable(host->clk);
host = mmc_priv(mmc); if (mmc)
ret = mmc_resume_host(mmc); ret = mmc_resume_host(mmc);
}
return ret; return ret;
} }
#else
#define mxcmci_suspend NULL static const struct dev_pm_ops mxcmci_pm_ops = {
#define mxcmci_resume NULL .suspend = mxcmci_suspend,
#endif /* CONFIG_PM */ .resume = mxcmci_resume,
};
#endif
static struct platform_driver mxcmci_driver = { static struct platform_driver mxcmci_driver = {
.probe = mxcmci_probe, .probe = mxcmci_probe,
.remove = mxcmci_remove, .remove = mxcmci_remove,
.suspend = mxcmci_suspend,
.resume = mxcmci_resume,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &mxcmci_pm_ops,
#endif
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment