Skip to content

Commit 12b8ab4

Browse files
jah63Wim Van Sebroeck
authored andcommitted
watchdog/hpwdt: Support Suspend and Resume
Add call backs to support suspend and resume. Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20240214164941.630775-2-jerry.hoemann@hpe.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent 588b825 commit 12b8ab4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

drivers/watchdog/hpwdt.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,36 @@ static void hpwdt_exit(struct pci_dev *dev)
378378
pci_disable_device(dev);
379379
}
380380

381+
static int hpwdt_suspend(struct device *dev)
382+
{
383+
if (watchdog_active(&hpwdt_dev))
384+
hpwdt_stop();
385+
386+
return 0;
387+
}
388+
389+
static int hpwdt_resume(struct device *dev)
390+
{
391+
if (watchdog_active(&hpwdt_dev))
392+
hpwdt_start(&hpwdt_dev);
393+
394+
return 0;
395+
}
396+
397+
static const struct dev_pm_ops hpwdt_pm_ops = {
398+
LATE_SYSTEM_SLEEP_PM_OPS(hpwdt_suspend, hpwdt_resume)
399+
};
400+
381401
static struct pci_driver hpwdt_driver = {
382402
.name = "hpwdt",
383403
.id_table = hpwdt_devices,
384404
.probe = hpwdt_init_one,
385405
.remove = hpwdt_exit,
406+
407+
.driver = {
408+
.name = "hpwdt",
409+
.pm = &hpwdt_pm_ops,
410+
}
386411
};
387412

388413
MODULE_AUTHOR("Tom Mingarelli");

0 commit comments

Comments
 (0)