diff options
author | Peter Fordham <peter.fordham@gmail.com> | 2011-06-15 16:18:32 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2011-07-22 05:00:20 -0400 |
commit | 641e4f449512ced3a3b784b33ce191e664a6d2dd (patch) | |
tree | 391a4f648f81762295989973be9d5ceb3e0a1a0e /drivers/watchdog | |
parent | fad0a9dd0da2dc9971e0e71f41134c791f2030c2 (diff) |
watchdog: mpcore_wdt: Add suspend/resume support.
Add support for suspend and resume to the MPCore watchdog driver.
Signed-off-by: Peter Fordham <peter.fordham@gmail.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/mpcore_wdt.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c index 2b4af222b5f2..4dc31024d26c 100644 --- a/drivers/watchdog/mpcore_wdt.c +++ b/drivers/watchdog/mpcore_wdt.c | |||
@@ -407,12 +407,35 @@ static int __devexit mpcore_wdt_remove(struct platform_device *dev) | |||
407 | return 0; | 407 | return 0; |
408 | } | 408 | } |
409 | 409 | ||
410 | #ifdef CONFIG_PM | ||
411 | static int mpcore_wdt_suspend(struct platform_device *dev, pm_message_t msg) | ||
412 | { | ||
413 | struct mpcore_wdt *wdt = platform_get_drvdata(dev); | ||
414 | mpcore_wdt_stop(wdt); /* Turn the WDT off */ | ||
415 | return 0; | ||
416 | } | ||
417 | |||
418 | static int mpcore_wdt_resume(struct platform_device *dev) | ||
419 | { | ||
420 | struct mpcore_wdt *wdt = platform_get_drvdata(dev); | ||
421 | /* re-activate timer */ | ||
422 | if (test_bit(0, &wdt->timer_alive)) | ||
423 | mpcore_wdt_start(wdt); | ||
424 | return 0; | ||
425 | } | ||
426 | #else | ||
427 | #define mpcore_wdt_suspend NULL | ||
428 | #define mpcore_wdt_resume NULL | ||
429 | #endif | ||
430 | |||
410 | /* work with hotplug and coldplug */ | 431 | /* work with hotplug and coldplug */ |
411 | MODULE_ALIAS("platform:mpcore_wdt"); | 432 | MODULE_ALIAS("platform:mpcore_wdt"); |
412 | 433 | ||
413 | static struct platform_driver mpcore_wdt_driver = { | 434 | static struct platform_driver mpcore_wdt_driver = { |
414 | .probe = mpcore_wdt_probe, | 435 | .probe = mpcore_wdt_probe, |
415 | .remove = __devexit_p(mpcore_wdt_remove), | 436 | .remove = __devexit_p(mpcore_wdt_remove), |
437 | .suspend = mpcore_wdt_suspend, | ||
438 | .resume = mpcore_wdt_resume, | ||
416 | .shutdown = mpcore_wdt_shutdown, | 439 | .shutdown = mpcore_wdt_shutdown, |
417 | .driver = { | 440 | .driver = { |
418 | .owner = THIS_MODULE, | 441 | .owner = THIS_MODULE, |