Commit 12b8ab42 authored by Jerry Hoemann's avatar Jerry Hoemann Committed by Wim Van Sebroeck

watchdog/hpwdt: Support Suspend and Resume

Add call backs to support suspend and resume.
Signed-off-by: default avatarJerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240214164941.630775-2-jerry.hoemann@hpe.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 588b8254
......@@ -378,11 +378,36 @@ static void hpwdt_exit(struct pci_dev *dev)
pci_disable_device(dev);
}
static int hpwdt_suspend(struct device *dev)
{
if (watchdog_active(&hpwdt_dev))
hpwdt_stop();
return 0;
}
static int hpwdt_resume(struct device *dev)
{
if (watchdog_active(&hpwdt_dev))
hpwdt_start(&hpwdt_dev);
return 0;
}
static const struct dev_pm_ops hpwdt_pm_ops = {
LATE_SYSTEM_SLEEP_PM_OPS(hpwdt_suspend, hpwdt_resume)
};
static struct pci_driver hpwdt_driver = {
.name = "hpwdt",
.id_table = hpwdt_devices,
.probe = hpwdt_init_one,
.remove = hpwdt_exit,
.driver = {
.name = "hpwdt",
.pm = &hpwdt_pm_ops,
}
};
MODULE_AUTHOR("Tom Mingarelli");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment