Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jerry Hoemann and committed by
Wim Van Sebroeck
12b8ab42 588b8254

+25
+25
drivers/watchdog/hpwdt.c
··· 378 378 pci_disable_device(dev); 379 379 } 380 380 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 + 381 401 static struct pci_driver hpwdt_driver = { 382 402 .name = "hpwdt", 383 403 .id_table = hpwdt_devices, 384 404 .probe = hpwdt_init_one, 385 405 .remove = hpwdt_exit, 406 + 407 + .driver = { 408 + .name = "hpwdt", 409 + .pm = &hpwdt_pm_ops, 410 + } 386 411 }; 387 412 388 413 MODULE_AUTHOR("Tom Mingarelli");