Lines Matching +full:power +full:- +full:off +full:- +full:time +full:- +full:sec

1 // SPDX-License-Identifier: GPL-2.0+
3 * Berkshire PCI-PC Watchdog Card Driver
5 * (c) Copyright 2003-2007 Wim Van Sebroeck <wim@iguana.be>.
16 * provided "AS-IS" and at no charge.
36 #include <linux/errno.h> /* For the -ENODEV/... values */
46 #include <linux/ioport.h> /* For io-port access */
53 #define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog"
68 * PCI-PC Watchdog card.
76 #define WD_PCI_R2DS 0x40 /* Relay 2 Disable Temperature-trip /
85 /* according to documentation max. time to process a command for the pci
98 5, /* OFF-OFF-OFF = 5 Sec */
99 10, /* OFF-OFF-ON = 10 Sec */
100 30, /* OFF-ON-OFF = 30 Sec */
101 60, /* OFF-ON-ON = 1 Min */
102 300, /* ON-OFF-OFF = 5 Min */
103 600, /* ON-OFF-ON = 10 Min */
104 1800, /* ON-ON-OFF = 30 Min */
105 3600, /* ON-ON-ON = 1 hour */
115 /* this is private data for each PCI-PC watchdog card */
125 /* the PCI-device */
138 delay-time from dip-switches */
142 "(0<heartbeat<65536 or 0=delay-time from dip-switches, default="
185 pr_debug("time to process command was: %d ms\n", in send_command()
244 pr_info("Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", in pcipcwd_show_card_info()
246 ((option_switches & 0x10) ? "ON" : "OFF"), in pcipcwd_show_card_info()
247 ((option_switches & 0x08) ? "ON" : "OFF")); in pcipcwd_show_card_info()
256 pr_info("No previous trip detected - Cold boot or reset\n"); in pcipcwd_show_card_info()
272 return -1; in pcipcwd_start()
297 return -1; in pcipcwd_stop()
308 /* Re-trigger watchdog by writing to port 0 */ in pcipcwd_keepalive()
325 return -EINVAL; in pcipcwd_set_heartbeat()
394 return -ENODEV; in pcipcwd_get_temperature()
418 /* Read the time that's left before rebooting */ in pcipcwd_get_timeleft()
425 pr_debug("Time left before next reboot: %d\n", *time_left); in pcipcwd_get_timeleft()
451 return -EFAULT; in pcipcwd_write()
480 return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; in pcipcwd_ioctl()
497 return -EFAULT; in pcipcwd_ioctl()
504 int new_options, retval = -EINVAL; in pcipcwd_ioctl()
507 return -EFAULT; in pcipcwd_ioctl()
511 return -EIO; in pcipcwd_ioctl()
517 return -EIO; in pcipcwd_ioctl()
538 return -EFAULT; in pcipcwd_ioctl()
541 return -EINVAL; in pcipcwd_ioctl()
555 return -EFAULT; in pcipcwd_ioctl()
561 return -ENOTTY; in pcipcwd_ioctl()
571 return -EBUSY; in pcipcwd_open()
583 * Shut off the timer. in pcipcwd_release()
606 return -EFAULT; in pcipcwd_temp_read()
609 return -EFAULT; in pcipcwd_temp_read()
617 return -ENODEV; in pcipcwd_temp_open()
635 pcipcwd_stop(); /* Turn the WDT off */ in pcipcwd_notify_sys()
685 int ret = -EIO; in pcipcwd_card_init()
693 return -ENODEV; in pcipcwd_card_init()
698 return -ENODEV; in pcipcwd_card_init()
702 pr_err("No I/O-Address for card detected\n"); in pcipcwd_card_init()
703 ret = -ENODEV; in pcipcwd_card_init()
714 ret = -EIO; in pcipcwd_card_init()
733 /* If heartbeat = 0 then we use the heartbeat from the dip-switches */ in pcipcwd_card_init()
768 pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", in pcipcwd_card_init()
798 cards_found--; in pcipcwd_card_exit()
818 MODULE_DESCRIPTION("Berkshire PCI-PC Watchdog driver");