aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/at_hdmac.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-09-09 18:06:44 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2009-09-14 14:27:00 -0400
commit33f82d141c897f39cd8bce592d88cb3c5af58342 (patch)
tree7765831183d05fb635e60e8f8bf92e0bdfe06b5c /drivers/dma/at_hdmac.c
parent3eb132c986f04f64b9c360abd67a1e0d18d6d5b4 (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>
Diffstat (limited to 'drivers/dma/at_hdmac.c')
-rw-r--r--drivers/dma/at_hdmac.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 9a1e5fb412e..c8522e6f1ad 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)
1166 clk_disable(atdma->clk); 1166 clk_disable(atdma->clk);
1167} 1167}
1168 1168
1169static int at_dma_suspend_late(struct platform_device *pdev, pm_message_t mesg) 1169static int at_dma_suspend_noirq(struct device *dev)
1170{ 1170{
1171 struct at_dma *atdma = platform_get_drvdata(pdev); 1171 struct platform_device *pdev = to_platform_device(dev);
1172 struct at_dma *atdma = platform_get_drvdata(pdev);
1172 1173
1173 at_dma_off(platform_get_drvdata(pdev)); 1174 at_dma_off(platform_get_drvdata(pdev));
1174 clk_disable(atdma->clk); 1175 clk_disable(atdma->clk);
1175 return 0; 1176 return 0;
1176} 1177}
1177 1178
1178static int at_dma_resume_early(struct platform_device *pdev) 1179static int at_dma_resume_noirq(struct device *dev)
1179{ 1180{
1180 struct at_dma *atdma = platform_get_drvdata(pdev); 1181 struct platform_device *pdev = to_platform_device(dev);
1182 struct at_dma *atdma = platform_get_drvdata(pdev);
1181 1183
1182 clk_enable(atdma->clk); 1184 clk_enable(atdma->clk);
1183 dma_writel(atdma, EN, AT_DMA_ENABLE); 1185 dma_writel(atdma, EN, AT_DMA_ENABLE);
1184 return 0; 1186 return 0;
1185
1186} 1187}
1187 1188
1189static struct dev_pm_ops at_dma_dev_pm_ops = {
1190 .suspend_noirq = at_dma_suspend_noirq,
1191 .resume_noirq = at_dma_resume_noirq,
1192};
1193
1188static struct platform_driver at_dma_driver = { 1194static struct platform_driver at_dma_driver = {
1189 .remove = __exit_p(at_dma_remove), 1195 .remove = __exit_p(at_dma_remove),
1190 .shutdown = at_dma_shutdown, 1196 .shutdown = at_dma_shutdown,
1191 .suspend_late = at_dma_suspend_late,
1192 .resume_early = at_dma_resume_early,
1193 .driver = { 1197 .driver = {
1194 .name = "at_hdmac", 1198 .name = "at_hdmac",
1199 .pm = &at_dma_dev_pm_ops,
1195 }, 1200 },
1196}; 1201};
1197 1202