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>
This commit is contained in:
parent
fad0a9dd0d
commit
641e4f4495
|
@ -407,12 +407,35 @@ static int __devexit mpcore_wdt_remove(struct platform_device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM
|
||||||
|
static int mpcore_wdt_suspend(struct platform_device *dev, pm_message_t msg)
|
||||||
|
{
|
||||||
|
struct mpcore_wdt *wdt = platform_get_drvdata(dev);
|
||||||
|
mpcore_wdt_stop(wdt); /* Turn the WDT off */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int mpcore_wdt_resume(struct platform_device *dev)
|
||||||
|
{
|
||||||
|
struct mpcore_wdt *wdt = platform_get_drvdata(dev);
|
||||||
|
/* re-activate timer */
|
||||||
|
if (test_bit(0, &wdt->timer_alive))
|
||||||
|
mpcore_wdt_start(wdt);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define mpcore_wdt_suspend NULL
|
||||||
|
#define mpcore_wdt_resume NULL
|
||||||
|
#endif
|
||||||
|
|
||||||
/* work with hotplug and coldplug */
|
/* work with hotplug and coldplug */
|
||||||
MODULE_ALIAS("platform:mpcore_wdt");
|
MODULE_ALIAS("platform:mpcore_wdt");
|
||||||
|
|
||||||
static struct platform_driver mpcore_wdt_driver = {
|
static struct platform_driver mpcore_wdt_driver = {
|
||||||
.probe = mpcore_wdt_probe,
|
.probe = mpcore_wdt_probe,
|
||||||
.remove = __devexit_p(mpcore_wdt_remove),
|
.remove = __devexit_p(mpcore_wdt_remove),
|
||||||
|
.suspend = mpcore_wdt_suspend,
|
||||||
|
.resume = mpcore_wdt_resume,
|
||||||
.shutdown = mpcore_wdt_shutdown,
|
.shutdown = mpcore_wdt_shutdown,
|
||||||
.driver = {
|
.driver = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
|
Loading…
Reference in New Issue