Lines Matching +full:msb +full:- +full:-
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 /
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="
154 static int send_command(int cmd, int *msb, int *lsb) in send_command() argument
159 pr_debug("sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x\n", in send_command()
160 cmd, *msb, *lsb); in send_command()
166 * and MSB to port 5. in send_command()
170 outb_p(*msb, pcipcwd_private.io_addr + 5); in send_command()
195 *msb = inb_p(pcipcwd_private.io_addr + 5); in send_command()
201 pr_debug("received following data for cmd=0x%02x: msb=0x%02x lsb=0x%02x\n", in send_command()
202 cmd, *msb, *lsb); in send_command()
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()
360 int msb; in pcipcwd_clear_status() local
379 msb = 0; in pcipcwd_clear_status()
381 send_command(CMD_GET_CLEAR_RESET_COUNT, &msb, &reset_counter); in pcipcwd_clear_status()
394 return -ENODEV; in pcipcwd_get_temperature()
415 int msb; in pcipcwd_get_timeleft() local
420 send_command(CMD_READ_WATCHDOG_TIMEOUT, &msb, &lsb); in pcipcwd_get_timeleft()
422 *time_left = (msb << 8) + lsb; 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()
606 return -EFAULT; in pcipcwd_temp_read()
609 return -EFAULT; in pcipcwd_temp_read()
617 return -ENODEV; in pcipcwd_temp_open()
683 int ret = -EIO; in pcipcwd_card_init()
691 return -ENODEV; in pcipcwd_card_init()
696 return -ENODEV; in pcipcwd_card_init()
700 pr_err("No I/O-Address for card detected\n"); in pcipcwd_card_init()
701 ret = -ENODEV; in pcipcwd_card_init()
712 ret = -EIO; in pcipcwd_card_init()
731 /* If heartbeat = 0 then we use the heartbeat from the dip-switches */ in pcipcwd_card_init()
796 cards_found--; in pcipcwd_card_exit()
816 MODULE_DESCRIPTION("Berkshire PCI-PC Watchdog driver");