diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-07-08 07:22:27 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2009-07-21 18:28:39 -0400 |
commit | 4aebac2fb9645e897864e12cdb8d1e4aadf5b2a4 (patch) | |
tree | 45dbbdc9a75cb12bfbf908588f9984a7dad70aae | |
parent | 4a256b5fc028e6dad0fd1b59745f743ee528c944 (diff) |
DMA: Rework txx9dmac suspend_late()/resume_early()
This patch reworks platform driver power management code
for txx9dmac 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: Magnus Damm <damm@igel.co.jp>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r-- | drivers/dma/txx9dmac.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c index 88dab52926f4..7837930146a4 100644 --- a/drivers/dma/txx9dmac.c +++ b/drivers/dma/txx9dmac.c | |||
@@ -1291,17 +1291,18 @@ static void txx9dmac_shutdown(struct platform_device *pdev) | |||
1291 | txx9dmac_off(ddev); | 1291 | txx9dmac_off(ddev); |
1292 | } | 1292 | } |
1293 | 1293 | ||
1294 | static int txx9dmac_suspend_late(struct platform_device *pdev, | 1294 | static int txx9dmac_suspend_noirq(struct device *dev) |
1295 | pm_message_t mesg) | ||
1296 | { | 1295 | { |
1296 | struct platform_device *pdev = to_platform_device(dev); | ||
1297 | struct txx9dmac_dev *ddev = platform_get_drvdata(pdev); | 1297 | struct txx9dmac_dev *ddev = platform_get_drvdata(pdev); |
1298 | 1298 | ||
1299 | txx9dmac_off(ddev); | 1299 | txx9dmac_off(ddev); |
1300 | return 0; | 1300 | return 0; |
1301 | } | 1301 | } |
1302 | 1302 | ||
1303 | static int txx9dmac_resume_early(struct platform_device *pdev) | 1303 | static int txx9dmac_resume_noirq(struct device *dev) |
1304 | { | 1304 | { |
1305 | struct platform_device *pdev = to_platform_device(dev); | ||
1305 | struct txx9dmac_dev *ddev = platform_get_drvdata(pdev); | 1306 | struct txx9dmac_dev *ddev = platform_get_drvdata(pdev); |
1306 | struct txx9dmac_platform_data *pdata = pdev->dev.platform_data; | 1307 | struct txx9dmac_platform_data *pdata = pdev->dev.platform_data; |
1307 | u32 mcr; | 1308 | u32 mcr; |
@@ -1314,6 +1315,11 @@ static int txx9dmac_resume_early(struct platform_device *pdev) | |||
1314 | 1315 | ||
1315 | } | 1316 | } |
1316 | 1317 | ||
1318 | static struct dev_pm_ops txx9dmac_dev_pm_ops = { | ||
1319 | .suspend_noirq = txx9dmac_suspend_noirq, | ||
1320 | .resume_noirq = txx9dmac_resume_noirq, | ||
1321 | }; | ||
1322 | |||
1317 | static struct platform_driver txx9dmac_chan_driver = { | 1323 | static struct platform_driver txx9dmac_chan_driver = { |
1318 | .remove = __exit_p(txx9dmac_chan_remove), | 1324 | .remove = __exit_p(txx9dmac_chan_remove), |
1319 | .driver = { | 1325 | .driver = { |
@@ -1324,10 +1330,9 @@ static struct platform_driver txx9dmac_chan_driver = { | |||
1324 | static struct platform_driver txx9dmac_driver = { | 1330 | static struct platform_driver txx9dmac_driver = { |
1325 | .remove = __exit_p(txx9dmac_remove), | 1331 | .remove = __exit_p(txx9dmac_remove), |
1326 | .shutdown = txx9dmac_shutdown, | 1332 | .shutdown = txx9dmac_shutdown, |
1327 | .suspend_late = txx9dmac_suspend_late, | ||
1328 | .resume_early = txx9dmac_resume_early, | ||
1329 | .driver = { | 1333 | .driver = { |
1330 | .name = "txx9dmac", | 1334 | .name = "txx9dmac", |
1335 | .pm = &txx9dmac_dev_pm_ops, | ||
1331 | }, | 1336 | }, |
1332 | }; | 1337 | }; |
1333 | 1338 | ||