xref: /openbmc/linux/drivers/watchdog/acquirewdt.c (revision 487722cf2d66126338217896642bd5eec832c34b)
1b7e04f8cSWim Van Sebroeck /*
2b7e04f8cSWim Van Sebroeck  *	Acquire Single Board Computer Watchdog Timer driver
3b7e04f8cSWim Van Sebroeck  *
4b7e04f8cSWim Van Sebroeck  *	Based on wdt.c. Original copyright messages:
5b7e04f8cSWim Van Sebroeck  *
629fa0586SAlan Cox  *	(c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>,
729fa0586SAlan Cox  *						All Rights Reserved.
8b7e04f8cSWim Van Sebroeck  *
9b7e04f8cSWim Van Sebroeck  *	This program is free software; you can redistribute it and/or
10b7e04f8cSWim Van Sebroeck  *	modify it under the terms of the GNU General Public License
11b7e04f8cSWim Van Sebroeck  *	as published by the Free Software Foundation; either version
12b7e04f8cSWim Van Sebroeck  *	2 of the License, or (at your option) any later version.
13b7e04f8cSWim Van Sebroeck  *
14b7e04f8cSWim Van Sebroeck  *	Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
15b7e04f8cSWim Van Sebroeck  *	warranty for any of this software. This material is provided
16b7e04f8cSWim Van Sebroeck  *	"AS-IS" and at no charge.
17b7e04f8cSWim Van Sebroeck  *
1829fa0586SAlan Cox  *	(c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
19b7e04f8cSWim Van Sebroeck  *
20b7e04f8cSWim Van Sebroeck  *	14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
21b7e04f8cSWim Van Sebroeck  *	    Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
22b7e04f8cSWim Van Sebroeck  *	    Can't add timeout - driver doesn't allow changing value
23b7e04f8cSWim Van Sebroeck  */
24b7e04f8cSWim Van Sebroeck 
25b7e04f8cSWim Van Sebroeck /*
26b7e04f8cSWim Van Sebroeck  *	Theory of Operation:
27b7e04f8cSWim Van Sebroeck  *		The Watch-Dog Timer is provided to ensure that standalone
28b7e04f8cSWim Van Sebroeck  *		Systems can always recover from catastrophic conditions that
2925985edcSLucas De Marchi  *		caused the CPU to crash. This condition may have occurred by
30b7e04f8cSWim Van Sebroeck  *		external EMI or a software bug. When the CPU stops working
31b7e04f8cSWim Van Sebroeck  *		correctly, hardware on the board will either perform a hardware
32b7e04f8cSWim Van Sebroeck  *		reset (cold boot) or a non-maskable interrupt (NMI) to bring the
33b7e04f8cSWim Van Sebroeck  *		system back to a known state.
34b7e04f8cSWim Van Sebroeck  *
35b7e04f8cSWim Van Sebroeck  *		The Watch-Dog Timer is controlled by two I/O Ports.
36b7e04f8cSWim Van Sebroeck  *		  443 hex	- Read	- Enable or refresh the Watch-Dog Timer
37b7e04f8cSWim Van Sebroeck  *		  043 hex	- Read	- Disable the Watch-Dog Timer
38b7e04f8cSWim Van Sebroeck  *
39b7e04f8cSWim Van Sebroeck  *		To enable the Watch-Dog Timer, a read from I/O port 443h must
40b7e04f8cSWim Van Sebroeck  *		be performed. This will enable and activate the countdown timer
41b7e04f8cSWim Van Sebroeck  *		which will eventually time out and either reset the CPU or cause
42b7e04f8cSWim Van Sebroeck  *		an NMI depending on the setting of a jumper. To ensure that this
43b7e04f8cSWim Van Sebroeck  *		reset condition does not occur, the Watch-Dog Timer must be
44b7e04f8cSWim Van Sebroeck  *		periodically refreshed by reading the same I/O port 443h.
45b7e04f8cSWim Van Sebroeck  *		The Watch-Dog Timer is disabled by reading I/O port 043h.
46b7e04f8cSWim Van Sebroeck  *
47b7e04f8cSWim Van Sebroeck  *		The Watch-Dog Timer Time-Out Period is set via jumpers.
48b7e04f8cSWim Van Sebroeck  *		It can be 1, 2, 10, 20, 110 or 220 seconds.
49b7e04f8cSWim Van Sebroeck  */
50b7e04f8cSWim Van Sebroeck 
51b7e04f8cSWim Van Sebroeck /*
52b7e04f8cSWim Van Sebroeck  *	Includes, defines, variables, module parameters, ...
53b7e04f8cSWim Van Sebroeck  */
54b7e04f8cSWim Van Sebroeck 
5527c766aaSJoe Perches #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
5627c766aaSJoe Perches 
57b7e04f8cSWim Van Sebroeck /* Includes */
58b7e04f8cSWim Van Sebroeck #include <linux/module.h>		/* For module specific items */
59b7e04f8cSWim Van Sebroeck #include <linux/moduleparam.h>		/* For new moduleparam's */
60b7e04f8cSWim Van Sebroeck #include <linux/types.h>		/* For standard types (like size_t) */
61b7e04f8cSWim Van Sebroeck #include <linux/errno.h>		/* For the -ENODEV/... values */
62b7e04f8cSWim Van Sebroeck #include <linux/kernel.h>		/* For printk/panic/... */
63*487722cfSJean Delvare #include <linux/miscdevice.h>		/* For struct miscdevice */
64b7e04f8cSWim Van Sebroeck #include <linux/watchdog.h>		/* For the watchdog specific items */
65b7e04f8cSWim Van Sebroeck #include <linux/fs.h>			/* For file operations */
66b7e04f8cSWim Van Sebroeck #include <linux/ioport.h>		/* For io-port access */
67b7e04f8cSWim Van Sebroeck #include <linux/platform_device.h>	/* For platform_driver framework */
68b7e04f8cSWim Van Sebroeck #include <linux/init.h>			/* For __init/__exit/... */
6994da1e2eSAlan Cox #include <linux/uaccess.h>		/* For copy_to_user/put_user/... */
7094da1e2eSAlan Cox #include <linux/io.h>			/* For inb/outb/... */
71b7e04f8cSWim Van Sebroeck 
72b7e04f8cSWim Van Sebroeck /* Module information */
73b7e04f8cSWim Van Sebroeck #define DRV_NAME "acquirewdt"
74b7e04f8cSWim Van Sebroeck #define WATCHDOG_NAME "Acquire WDT"
7594da1e2eSAlan Cox /* There is no way to see what the correct time-out period is */
7694da1e2eSAlan Cox #define WATCHDOG_HEARTBEAT 0
77b7e04f8cSWim Van Sebroeck 
78b7e04f8cSWim Van Sebroeck /* internal variables */
7994da1e2eSAlan Cox /* the watchdog platform device */
8094da1e2eSAlan Cox static struct platform_device *acq_platform_device;
81b7e04f8cSWim Van Sebroeck static unsigned long acq_is_open;
82b7e04f8cSWim Van Sebroeck static char expect_close;
83b7e04f8cSWim Van Sebroeck 
84b7e04f8cSWim Van Sebroeck /* module parameters */
8594da1e2eSAlan Cox /* You must set this - there is no sane way to probe for this board. */
8694da1e2eSAlan Cox static int wdt_stop = 0x43;
87b7e04f8cSWim Van Sebroeck module_param(wdt_stop, int, 0);
88b7e04f8cSWim Van Sebroeck MODULE_PARM_DESC(wdt_stop, "Acquire WDT 'stop' io port (default 0x43)");
89b7e04f8cSWim Van Sebroeck 
9094da1e2eSAlan Cox /* You must set this - there is no sane way to probe for this board. */
9194da1e2eSAlan Cox static int wdt_start = 0x443;
92b7e04f8cSWim Van Sebroeck module_param(wdt_start, int, 0);
93b7e04f8cSWim Van Sebroeck MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)");
94b7e04f8cSWim Van Sebroeck 
9586a1e189SWim Van Sebroeck static bool nowayout = WATCHDOG_NOWAYOUT;
9686a1e189SWim Van Sebroeck module_param(nowayout, bool, 0);
9794da1e2eSAlan Cox MODULE_PARM_DESC(nowayout,
9894da1e2eSAlan Cox 	"Watchdog cannot be stopped once started (default="
9994da1e2eSAlan Cox 	__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
100b7e04f8cSWim Van Sebroeck 
101b7e04f8cSWim Van Sebroeck /*
102b7e04f8cSWim Van Sebroeck  *	Watchdog Operations
103b7e04f8cSWim Van Sebroeck  */
104b7e04f8cSWim Van Sebroeck 
105b7e04f8cSWim Van Sebroeck static void acq_keepalive(void)
106b7e04f8cSWim Van Sebroeck {
107b7e04f8cSWim Van Sebroeck 	/* Write a watchdog value */
108b7e04f8cSWim Van Sebroeck 	inb_p(wdt_start);
109b7e04f8cSWim Van Sebroeck }
110b7e04f8cSWim Van Sebroeck 
111b7e04f8cSWim Van Sebroeck static void acq_stop(void)
112b7e04f8cSWim Van Sebroeck {
113b7e04f8cSWim Van Sebroeck 	/* Turn the card off */
114b7e04f8cSWim Van Sebroeck 	inb_p(wdt_stop);
115b7e04f8cSWim Van Sebroeck }
116b7e04f8cSWim Van Sebroeck 
117b7e04f8cSWim Van Sebroeck /*
118b7e04f8cSWim Van Sebroeck  *	/dev/watchdog handling
119b7e04f8cSWim Van Sebroeck  */
120b7e04f8cSWim Van Sebroeck 
12194da1e2eSAlan Cox static ssize_t acq_write(struct file *file, const char __user *buf,
12294da1e2eSAlan Cox 						size_t count, loff_t *ppos)
123b7e04f8cSWim Van Sebroeck {
124b7e04f8cSWim Van Sebroeck 	/* See if we got the magic character 'V' and reload the timer */
125b7e04f8cSWim Van Sebroeck 	if (count) {
126b7e04f8cSWim Van Sebroeck 		if (!nowayout) {
127b7e04f8cSWim Van Sebroeck 			size_t i;
128b7e04f8cSWim Van Sebroeck 			/* note: just in case someone wrote the magic character
1297944d3a5SWim Van Sebroeck 			   five months ago... */
130b7e04f8cSWim Van Sebroeck 			expect_close = 0;
13194da1e2eSAlan Cox 			/* scan to see whether or not we got the
13294da1e2eSAlan Cox 			   magic character */
133b7e04f8cSWim Van Sebroeck 			for (i = 0; i != count; i++) {
134b7e04f8cSWim Van Sebroeck 				char c;
135b7e04f8cSWim Van Sebroeck 				if (get_user(c, buf + i))
136b7e04f8cSWim Van Sebroeck 					return -EFAULT;
137b7e04f8cSWim Van Sebroeck 				if (c == 'V')
138b7e04f8cSWim Van Sebroeck 					expect_close = 42;
139b7e04f8cSWim Van Sebroeck 			}
140b7e04f8cSWim Van Sebroeck 		}
14194da1e2eSAlan Cox 		/* Well, anyhow someone wrote to us, we should
14294da1e2eSAlan Cox 				return that favour */
143b7e04f8cSWim Van Sebroeck 		acq_keepalive();
144b7e04f8cSWim Van Sebroeck 	}
145b7e04f8cSWim Van Sebroeck 	return count;
146b7e04f8cSWim Van Sebroeck }
147b7e04f8cSWim Van Sebroeck 
14894da1e2eSAlan Cox static long acq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
149b7e04f8cSWim Van Sebroeck {
150b7e04f8cSWim Van Sebroeck 	int options, retval = -EINVAL;
151b7e04f8cSWim Van Sebroeck 	void __user *argp = (void __user *)arg;
152b7e04f8cSWim Van Sebroeck 	int __user *p = argp;
15342747d71SWim Van Sebroeck 	static const struct watchdog_info ident = {
154b7e04f8cSWim Van Sebroeck 		.options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
155b7e04f8cSWim Van Sebroeck 		.firmware_version = 1,
156b7e04f8cSWim Van Sebroeck 		.identity = WATCHDOG_NAME,
157b7e04f8cSWim Van Sebroeck 	};
158b7e04f8cSWim Van Sebroeck 
15994da1e2eSAlan Cox 	switch (cmd) {
160b7e04f8cSWim Van Sebroeck 	case WDIOC_GETSUPPORT:
161b7e04f8cSWim Van Sebroeck 		return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
162b7e04f8cSWim Van Sebroeck 
163b7e04f8cSWim Van Sebroeck 	case WDIOC_GETSTATUS:
164b7e04f8cSWim Van Sebroeck 	case WDIOC_GETBOOTSTATUS:
165b7e04f8cSWim Van Sebroeck 		return put_user(0, p);
166b7e04f8cSWim Van Sebroeck 
167b7e04f8cSWim Van Sebroeck 	case WDIOC_SETOPTIONS:
168b7e04f8cSWim Van Sebroeck 	{
169b7e04f8cSWim Van Sebroeck 		if (get_user(options, p))
170b7e04f8cSWim Van Sebroeck 			return -EFAULT;
17194da1e2eSAlan Cox 		if (options & WDIOS_DISABLECARD) {
172b7e04f8cSWim Van Sebroeck 			acq_stop();
173b7e04f8cSWim Van Sebroeck 			retval = 0;
174b7e04f8cSWim Van Sebroeck 		}
17594da1e2eSAlan Cox 		if (options & WDIOS_ENABLECARD) {
176b7e04f8cSWim Van Sebroeck 			acq_keepalive();
177b7e04f8cSWim Van Sebroeck 			retval = 0;
178b7e04f8cSWim Van Sebroeck 		}
179b7e04f8cSWim Van Sebroeck 		return retval;
180b7e04f8cSWim Van Sebroeck 	}
1810c06090cSWim Van Sebroeck 	case WDIOC_KEEPALIVE:
1820c06090cSWim Van Sebroeck 		acq_keepalive();
1830c06090cSWim Van Sebroeck 		return 0;
1840c06090cSWim Van Sebroeck 
1850c06090cSWim Van Sebroeck 	case WDIOC_GETTIMEOUT:
1860c06090cSWim Van Sebroeck 		return put_user(WATCHDOG_HEARTBEAT, p);
1870c06090cSWim Van Sebroeck 
188b7e04f8cSWim Van Sebroeck 	default:
189b7e04f8cSWim Van Sebroeck 		return -ENOTTY;
190b7e04f8cSWim Van Sebroeck 	}
191b7e04f8cSWim Van Sebroeck }
192b7e04f8cSWim Van Sebroeck 
193b7e04f8cSWim Van Sebroeck static int acq_open(struct inode *inode, struct file *file)
194b7e04f8cSWim Van Sebroeck {
195b7e04f8cSWim Van Sebroeck 	if (test_and_set_bit(0, &acq_is_open))
196b7e04f8cSWim Van Sebroeck 		return -EBUSY;
197b7e04f8cSWim Van Sebroeck 
198b7e04f8cSWim Van Sebroeck 	if (nowayout)
199b7e04f8cSWim Van Sebroeck 		__module_get(THIS_MODULE);
200b7e04f8cSWim Van Sebroeck 
201b7e04f8cSWim Van Sebroeck 	/* Activate */
202b7e04f8cSWim Van Sebroeck 	acq_keepalive();
203b7e04f8cSWim Van Sebroeck 	return nonseekable_open(inode, file);
204b7e04f8cSWim Van Sebroeck }
205b7e04f8cSWim Van Sebroeck 
206b7e04f8cSWim Van Sebroeck static int acq_close(struct inode *inode, struct file *file)
207b7e04f8cSWim Van Sebroeck {
208b7e04f8cSWim Van Sebroeck 	if (expect_close == 42) {
209b7e04f8cSWim Van Sebroeck 		acq_stop();
210b7e04f8cSWim Van Sebroeck 	} else {
21127c766aaSJoe Perches 		pr_crit("Unexpected close, not stopping watchdog!\n");
212b7e04f8cSWim Van Sebroeck 		acq_keepalive();
213b7e04f8cSWim Van Sebroeck 	}
214b7e04f8cSWim Van Sebroeck 	clear_bit(0, &acq_is_open);
215b7e04f8cSWim Van Sebroeck 	expect_close = 0;
216b7e04f8cSWim Van Sebroeck 	return 0;
217b7e04f8cSWim Van Sebroeck }
218b7e04f8cSWim Van Sebroeck 
219b7e04f8cSWim Van Sebroeck /*
220b7e04f8cSWim Van Sebroeck  *	Kernel Interfaces
221b7e04f8cSWim Van Sebroeck  */
222b7e04f8cSWim Van Sebroeck 
223b7e04f8cSWim Van Sebroeck static const struct file_operations acq_fops = {
224b7e04f8cSWim Van Sebroeck 	.owner		= THIS_MODULE,
225b7e04f8cSWim Van Sebroeck 	.llseek		= no_llseek,
226b7e04f8cSWim Van Sebroeck 	.write		= acq_write,
22794da1e2eSAlan Cox 	.unlocked_ioctl	= acq_ioctl,
228b7e04f8cSWim Van Sebroeck 	.open		= acq_open,
229b7e04f8cSWim Van Sebroeck 	.release	= acq_close,
230b7e04f8cSWim Van Sebroeck };
231b7e04f8cSWim Van Sebroeck 
232b7e04f8cSWim Van Sebroeck static struct miscdevice acq_miscdev = {
233b7e04f8cSWim Van Sebroeck 	.minor	= WATCHDOG_MINOR,
234b7e04f8cSWim Van Sebroeck 	.name	= "watchdog",
235b7e04f8cSWim Van Sebroeck 	.fops	= &acq_fops,
236b7e04f8cSWim Van Sebroeck };
237b7e04f8cSWim Van Sebroeck 
238b7e04f8cSWim Van Sebroeck /*
239b7e04f8cSWim Van Sebroeck  *	Init & exit routines
240b7e04f8cSWim Van Sebroeck  */
241b7e04f8cSWim Van Sebroeck 
2422d991a16SBill Pemberton static int acq_probe(struct platform_device *dev)
243b7e04f8cSWim Van Sebroeck {
244b7e04f8cSWim Van Sebroeck 	int ret;
245b7e04f8cSWim Van Sebroeck 
246b7e04f8cSWim Van Sebroeck 	if (wdt_stop != wdt_start) {
247b7e04f8cSWim Van Sebroeck 		if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) {
24827c766aaSJoe Perches 			pr_err("I/O address 0x%04x already in use\n", wdt_stop);
249b7e04f8cSWim Van Sebroeck 			ret = -EIO;
250b7e04f8cSWim Van Sebroeck 			goto out;
251b7e04f8cSWim Van Sebroeck 		}
252b7e04f8cSWim Van Sebroeck 	}
253b7e04f8cSWim Van Sebroeck 
254b7e04f8cSWim Van Sebroeck 	if (!request_region(wdt_start, 1, WATCHDOG_NAME)) {
25527c766aaSJoe Perches 		pr_err("I/O address 0x%04x already in use\n", wdt_start);
256b7e04f8cSWim Van Sebroeck 		ret = -EIO;
257b7e04f8cSWim Van Sebroeck 		goto unreg_stop;
258b7e04f8cSWim Van Sebroeck 	}
259b7e04f8cSWim Van Sebroeck 	ret = misc_register(&acq_miscdev);
260b7e04f8cSWim Van Sebroeck 	if (ret != 0) {
26127c766aaSJoe Perches 		pr_err("cannot register miscdev on minor=%d (err=%d)\n",
262b7e04f8cSWim Van Sebroeck 		       WATCHDOG_MINOR, ret);
263b7e04f8cSWim Van Sebroeck 		goto unreg_regions;
264b7e04f8cSWim Van Sebroeck 	}
26527c766aaSJoe Perches 	pr_info("initialized. (nowayout=%d)\n", nowayout);
266b7e04f8cSWim Van Sebroeck 
267b7e04f8cSWim Van Sebroeck 	return 0;
268b7e04f8cSWim Van Sebroeck unreg_regions:
269b7e04f8cSWim Van Sebroeck 	release_region(wdt_start, 1);
270b7e04f8cSWim Van Sebroeck unreg_stop:
271b7e04f8cSWim Van Sebroeck 	if (wdt_stop != wdt_start)
272b7e04f8cSWim Van Sebroeck 		release_region(wdt_stop, 1);
273b7e04f8cSWim Van Sebroeck out:
274b7e04f8cSWim Van Sebroeck 	return ret;
275b7e04f8cSWim Van Sebroeck }
276b7e04f8cSWim Van Sebroeck 
2774b12b896SBill Pemberton static int acq_remove(struct platform_device *dev)
278b7e04f8cSWim Van Sebroeck {
279b7e04f8cSWim Van Sebroeck 	misc_deregister(&acq_miscdev);
280b7e04f8cSWim Van Sebroeck 	release_region(wdt_start, 1);
281b7e04f8cSWim Van Sebroeck 	if (wdt_stop != wdt_start)
282b7e04f8cSWim Van Sebroeck 		release_region(wdt_stop, 1);
283b7e04f8cSWim Van Sebroeck 
284b7e04f8cSWim Van Sebroeck 	return 0;
285b7e04f8cSWim Van Sebroeck }
286b7e04f8cSWim Van Sebroeck 
287b7e04f8cSWim Van Sebroeck static void acq_shutdown(struct platform_device *dev)
288b7e04f8cSWim Van Sebroeck {
289b7e04f8cSWim Van Sebroeck 	/* Turn the WDT off if we have a soft shutdown */
290b7e04f8cSWim Van Sebroeck 	acq_stop();
291b7e04f8cSWim Van Sebroeck }
292b7e04f8cSWim Van Sebroeck 
293b7e04f8cSWim Van Sebroeck static struct platform_driver acquirewdt_driver = {
294b7e04f8cSWim Van Sebroeck 	.probe		= acq_probe,
29582268714SBill Pemberton 	.remove		= acq_remove,
296b7e04f8cSWim Van Sebroeck 	.shutdown	= acq_shutdown,
297b7e04f8cSWim Van Sebroeck 	.driver		= {
298b7e04f8cSWim Van Sebroeck 		.owner	= THIS_MODULE,
299b7e04f8cSWim Van Sebroeck 		.name	= DRV_NAME,
300b7e04f8cSWim Van Sebroeck 	},
301b7e04f8cSWim Van Sebroeck };
302b7e04f8cSWim Van Sebroeck 
303b7e04f8cSWim Van Sebroeck static int __init acq_init(void)
304b7e04f8cSWim Van Sebroeck {
305b7e04f8cSWim Van Sebroeck 	int err;
306b7e04f8cSWim Van Sebroeck 
30727c766aaSJoe Perches 	pr_info("WDT driver for Acquire single board computer initialising\n");
308b7e04f8cSWim Van Sebroeck 
309b7e04f8cSWim Van Sebroeck 	err = platform_driver_register(&acquirewdt_driver);
310b7e04f8cSWim Van Sebroeck 	if (err)
311b7e04f8cSWim Van Sebroeck 		return err;
312b7e04f8cSWim Van Sebroeck 
31394da1e2eSAlan Cox 	acq_platform_device = platform_device_register_simple(DRV_NAME,
31494da1e2eSAlan Cox 								-1, NULL, 0);
315b7e04f8cSWim Van Sebroeck 	if (IS_ERR(acq_platform_device)) {
316b7e04f8cSWim Van Sebroeck 		err = PTR_ERR(acq_platform_device);
317b7e04f8cSWim Van Sebroeck 		goto unreg_platform_driver;
318b7e04f8cSWim Van Sebroeck 	}
319b7e04f8cSWim Van Sebroeck 	return 0;
320b7e04f8cSWim Van Sebroeck 
321b7e04f8cSWim Van Sebroeck unreg_platform_driver:
322b7e04f8cSWim Van Sebroeck 	platform_driver_unregister(&acquirewdt_driver);
323b7e04f8cSWim Van Sebroeck 	return err;
324b7e04f8cSWim Van Sebroeck }
325b7e04f8cSWim Van Sebroeck 
326b7e04f8cSWim Van Sebroeck static void __exit acq_exit(void)
327b7e04f8cSWim Van Sebroeck {
328b7e04f8cSWim Van Sebroeck 	platform_device_unregister(acq_platform_device);
329b7e04f8cSWim Van Sebroeck 	platform_driver_unregister(&acquirewdt_driver);
33027c766aaSJoe Perches 	pr_info("Watchdog Module Unloaded\n");
331b7e04f8cSWim Van Sebroeck }
332b7e04f8cSWim Van Sebroeck 
333b7e04f8cSWim Van Sebroeck module_init(acq_init);
334b7e04f8cSWim Van Sebroeck module_exit(acq_exit);
335b7e04f8cSWim Van Sebroeck 
336b7e04f8cSWim Van Sebroeck MODULE_AUTHOR("David Woodhouse");
337b7e04f8cSWim Van Sebroeck MODULE_DESCRIPTION("Acquire Inc. Single Board Computer Watchdog Timer driver");
338b7e04f8cSWim Van Sebroeck MODULE_LICENSE("GPL");
339