Lines Matching +full:revision +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0-only
10 * 960108 Fixed end-of-file pointer (Thanks to Dan Hollis), added
24 * added watchdog disable/re-enable routines. Added firmware
26 * Removed some extra defines, added an autodetect Revision
60 #include <linux/errno.h> /* For the -ENODEV/... values */
71 #include <linux/ioport.h> /* For io-port access */
79 #define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog"
94 * These are the auto-probe addresses available.
96 * Revision A only uses ports 0x270 and 0x370. Revision C introduced 0x350.
97 * Revision A has an address range of 2 addresses, while Revision C has 4.
104 * PCI-PC Watchdog card.
106 /* Port 1 : Control Status #1 for the PC Watchdog card, revision A. */
112 /* Port 1 : Control Status #1 for the PC Watchdog card, revision C. */
117 on-board processor */
125 (1:SW1 <-> 0:SW2) */
150 20, /* OFF-OFF-OFF = 20 Sec */
151 40, /* OFF-OFF-ON = 40 Sec */
152 60, /* OFF-ON-OFF = 1 Min */
153 300, /* OFF-ON-ON = 5 Min */
154 600, /* ON-OFF-OFF = 10 Min */
155 1800, /* ON-OFF-ON = 30 Min */
156 3600, /* ON-ON-OFF = 1 Hour */
157 7200, /* ON-ON-ON = 2 hour */
176 /* this is private data for each ISA-PC watchdog card */
179 int revision; /* The card's revision */ member
200 /* default heartbeat = delay-time from dip-switches */
205 "(2 <= heartbeat <= 7200 or 0=delay-time from dip-switches, default="
336 if (pcwd_private.revision == PCWD_REVISION_A) in pcwd_show_card_info()
337 pr_info("ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", in pcwd_show_card_info()
339 else if (pcwd_private.revision == PCWD_REVISION_C) { in pcwd_show_card_info()
341 pr_info("ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n", in pcwd_show_card_info()
368 pr_info("No previous trip detected - Cold boot or reset\n"); in pcwd_show_card_info()
380 if (pcwd_private.revision == PCWD_REVISION_A) { in pcwd_timer_ping()
389 /* Re-trigger watchdog by writing to port 0 */ in pcwd_timer_ping()
393 /* Re-set the timer interval */ in pcwd_timer_ping()
412 if (pcwd_private.revision == PCWD_REVISION_C) { in pcwd_start()
420 return -EIO; in pcwd_start()
438 if (pcwd_private.revision == PCWD_REVISION_C) { in pcwd_stop()
448 return -EIO; in pcwd_stop()
472 return -EINVAL; in pcwd_set_heartbeat()
488 if (pcwd_private.revision == PCWD_REVISION_A) in pcwd_get_status()
497 * over-temperature condition. And the reboot in pcwd_get_status()
503 if (pcwd_private.revision == PCWD_REVISION_A) { in pcwd_get_status()
534 if (pcwd_private.revision == PCWD_REVISION_C) { in pcwd_clear_status()
561 return -1; in pcwd_get_temperature()
565 return -ENODEV; in pcwd_get_temperature()
606 return -EFAULT; in pcwd_ioctl()
618 return -EFAULT; in pcwd_ioctl()
623 if (pcwd_private.revision == PCWD_REVISION_C) { in pcwd_ioctl()
625 return -EFAULT; in pcwd_ioctl()
640 return -EINVAL; in pcwd_ioctl()
648 return -EFAULT; in pcwd_ioctl()
651 return -EINVAL; in pcwd_ioctl()
660 return -ENOTTY; in pcwd_ioctl()
680 return -EFAULT; in pcwd_write()
693 return -EBUSY; in pcwd_open()
725 return -EFAULT; in pcwd_temp_read()
728 return -EFAULT; in pcwd_temp_read()
736 return -ENODEV; in pcwd_temp_open()
804 static int pcwd_isa_match(struct device *dev, unsigned int id) in pcwd_isa_match() argument
806 int base_addr = pcwd_ioports[id]; in pcwd_isa_match()
813 pr_debug("pcwd_isa_match id=%d\n", id); in pcwd_isa_match()
849 static int pcwd_isa_probe(struct device *dev, unsigned int id) in pcwd_isa_probe() argument
854 pr_debug("pcwd_isa_probe id=%d\n", id); in pcwd_isa_probe()
863 return -ENODEV; in pcwd_isa_probe()
866 if (pcwd_ioports[id] == 0x0000) { in pcwd_isa_probe()
867 pr_err("No I/O-Address for card detected\n"); in pcwd_isa_probe()
868 return -ENODEV; in pcwd_isa_probe()
870 pcwd_private.io_addr = pcwd_ioports[id]; in pcwd_isa_probe()
874 /* Check card's revision */ in pcwd_isa_probe()
875 pcwd_private.revision = get_revision(); in pcwd_isa_probe()
878 (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) { in pcwd_isa_probe()
881 ret = -EIO; in pcwd_isa_probe()
907 /* If heartbeat = 0 then we use the heartbeat from the dip-switches */ in pcwd_isa_probe()
945 (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4); in pcwd_isa_probe()
948 cards_found--; in pcwd_isa_probe()
952 static void pcwd_isa_remove(struct device *dev, unsigned int id) in pcwd_isa_remove() argument
955 pr_debug("pcwd_isa_remove id=%d\n", id); in pcwd_isa_remove()
966 (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4); in pcwd_isa_remove()
968 cards_found--; in pcwd_isa_remove()
971 static void pcwd_isa_shutdown(struct device *dev, unsigned int id) in pcwd_isa_shutdown() argument
974 pr_debug("pcwd_isa_shutdown id=%d\n", id); in pcwd_isa_shutdown()
994 MODULE_DESCRIPTION("Berkshire ISA-PC Watchdog driver");