diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-09-10 00:06:44 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2009-09-14 20:27:00 +0200 |
commit | 33f82d141c897f39cd8bce592d88cb3c5af58342 (patch) | |
tree | 7765831183d05fb635e60e8f8bf92e0bdfe06b5c | |
parent | 3eb132c986f04f64b9c360abd67a1e0d18d6d5b4 (diff) |
at_hdmac: Rework suspend_late()/resume_early()
This patch reworks platform driver power management code
for at_hdmac from legacy late/early callbacks to dev_pm_ops.
The callbacks are converted for CONFIG_SUSPEND like this:
suspend_late() -> suspend_noirq()
resume_early() -> resume_noirq()
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r-- | drivers/dma/at_hdmac.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 9a1e5fb412ed..c8522e6f1ad2 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1166,32 +1166,37 @@ static void at_dma_shutdown(struct platform_device *pdev) clk_disable(atdma->clk); } -static int at_dma_suspend_late(struct platform_device *pdev, pm_message_t mesg) +static int at_dma_suspend_noirq(struct device *dev) { - struct at_dma *atdma = platform_get_drvdata(pdev); + struct platform_device *pdev = to_platform_device(dev); + struct at_dma *atdma = platform_get_drvdata(pdev); at_dma_off(platform_get_drvdata(pdev)); clk_disable(atdma->clk); return 0; } -static int at_dma_resume_early(struct platform_device *pdev) +static int at_dma_resume_noirq(struct device *dev) { - struct at_dma *atdma = platform_get_drvdata(pdev); + struct platform_device *pdev = to_platform_device(dev); + struct at_dma *atdma = platform_get_drvdata(pdev); clk_enable(atdma->clk); dma_writel(atdma, EN, AT_DMA_ENABLE); return 0; - } +static struct dev_pm_ops at_dma_dev_pm_ops = { + .suspend_noirq = at_dma_suspend_noirq, + .resume_noirq = at_dma_resume_noirq, +}; + static struct platform_driver at_dma_driver = { .remove = __exit_p(at_dma_remove), .shutdown = at_dma_shutdown, - .suspend_late = at_dma_suspend_late, - .resume_early = at_dma_resume_early, .driver = { .name = "at_hdmac", + .pm = &at_dma_dev_pm_ops, }, }; |