xref: /openbmc/linux/drivers/watchdog/acquirewdt.c (revision 86a1e1896c2710402e29a875d8d830244274244d)
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/... */
6394da1e2eSAlan Cox #include <linux/miscdevice.h>		/* For MODULE_ALIAS_MISCDEV
6494da1e2eSAlan Cox 							(WATCHDOG_MINOR) */
65b7e04f8cSWim Van Sebroeck #include <linux/watchdog.h>		/* For the watchdog specific items */
66b7e04f8cSWim Van Sebroeck #include <linux/fs.h>			/* For file operations */
67b7e04f8cSWim Van Sebroeck #include <linux/ioport.h>		/* For io-port access */
68b7e04f8cSWim Van Sebroeck #include <linux/platform_device.h>	/* For platform_driver framework */
69b7e04f8cSWim Van Sebroeck #include <linux/init.h>			/* For __init/__exit/... */
7094da1e2eSAlan Cox #include <linux/uaccess.h>		/* For copy_to_user/put_user/... */
7194da1e2eSAlan Cox #include <linux/io.h>			/* For inb/outb/... */
72b7e04f8cSWim Van Sebroeck 
73b7e04f8cSWim Van Sebroeck /* Module information */
74b7e04f8cSWim Van Sebroeck #define DRV_NAME "acquirewdt"
75b7e04f8cSWim Van Sebroeck #define WATCHDOG_NAME "Acquire WDT"
7694da1e2eSAlan Cox /* There is no way to see what the correct time-out period is */
7794da1e2eSAlan Cox #define WATCHDOG_HEARTBEAT 0
78b7e04f8cSWim Van Sebroeck 
79b7e04f8cSWim Van Sebroeck /* internal variables */
8094da1e2eSAlan Cox /* the watchdog platform device */
8194da1e2eSAlan Cox static struct platform_device *acq_platform_device;
82b7e04f8cSWim Van Sebroeck static unsigned long acq_is_open;
83b7e04f8cSWim Van Sebroeck static char expect_close;
84b7e04f8cSWim Van Sebroeck 
85b7e04f8cSWim Van Sebroeck /* module parameters */
8694da1e2eSAlan Cox /* You must set this - there is no sane way to probe for this board. */
8794da1e2eSAlan Cox static int wdt_stop = 0x43;
88b7e04f8cSWim Van Sebroeck module_param(wdt_stop, int, 0);
89b7e04f8cSWim Van Sebroeck MODULE_PARM_DESC(wdt_stop, "Acquire WDT 'stop' io port (default 0x43)");
90b7e04f8cSWim Van Sebroeck 
9194da1e2eSAlan Cox /* You must set this - there is no sane way to probe for this board. */
9294da1e2eSAlan Cox static int wdt_start = 0x443;
93b7e04f8cSWim Van Sebroeck module_param(wdt_start, int, 0);
94b7e04f8cSWim Van Sebroeck MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)");
95b7e04f8cSWim Van Sebroeck 
96*86a1e189SWim Van Sebroeck static bool nowayout = WATCHDOG_NOWAYOUT;
97*86a1e189SWim Van Sebroeck module_param(nowayout, bool, 0);
9894da1e2eSAlan Cox MODULE_PARM_DESC(nowayout,
9994da1e2eSAlan Cox 	"Watchdog cannot be stopped once started (default="
10094da1e2eSAlan Cox 	__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
101b7e04f8cSWim Van Sebroeck 
102b7e04f8cSWim Van Sebroeck /*
103b7e04f8cSWim Van Sebroeck  *	Watchdog Operations
104b7e04f8cSWim Van Sebroeck  */
105b7e04f8cSWim Van Sebroeck 
106b7e04f8cSWim Van Sebroeck static void acq_keepalive(void)
107b7e04f8cSWim Van Sebroeck {
108b7e04f8cSWim Van Sebroeck 	/* Write a watchdog value */
109b7e04f8cSWim Van Sebroeck 	inb_p(wdt_start);
110b7e04f8cSWim Van Sebroeck }
111b7e04f8cSWim Van Sebroeck 
112b7e04f8cSWim Van Sebroeck static void acq_stop(void)
113b7e04f8cSWim Van Sebroeck {
114b7e04f8cSWim Van Sebroeck 	/* Turn the card off */
115b7e04f8cSWim Van Sebroeck 	inb_p(wdt_stop);
116b7e04f8cSWim Van Sebroeck }
117b7e04f8cSWim Van Sebroeck 
118b7e04f8cSWim Van Sebroeck /*
119b7e04f8cSWim Van Sebroeck  *	/dev/watchdog handling
120b7e04f8cSWim Van Sebroeck  */
121b7e04f8cSWim Van Sebroeck 
12294da1e2eSAlan Cox static ssize_t acq_write(struct file *file, const char __user *buf,
12394da1e2eSAlan Cox 						size_t count, loff_t *ppos)
124b7e04f8cSWim Van Sebroeck {
125b7e04f8cSWim Van Sebroeck 	/* See if we got the magic character 'V' and reload the timer */
126b7e04f8cSWim Van Sebroeck 	if (count) {
127b7e04f8cSWim Van Sebroeck 		if (!nowayout) {
128b7e04f8cSWim Van Sebroeck 			size_t i;
129b7e04f8cSWim Van Sebroeck 			/* note: just in case someone wrote the magic character
1307944d3a5SWim Van Sebroeck 			   five months ago... */
131b7e04f8cSWim Van Sebroeck 			expect_close = 0;
13294da1e2eSAlan Cox 			/* scan to see whether or not we got the
13394da1e2eSAlan Cox 			   magic character */
134b7e04f8cSWim Van Sebroeck 			for (i = 0; i != count; i++) {
135b7e04f8cSWim Van Sebroeck 				char c;
136b7e04f8cSWim Van Sebroeck 				if (get_user(c, buf + i))
137b7e04f8cSWim Van Sebroeck 					return -EFAULT;
138b7e04f8cSWim Van Sebroeck 				if (c == 'V')
139b7e04f8cSWim Van Sebroeck 					expect_close = 42;
140b7e04f8cSWim Van Sebroeck 			}
141b7e04f8cSWim Van Sebroeck 		}
14294da1e2eSAlan Cox 		/* Well, anyhow someone wrote to us, we should
14394da1e2eSAlan Cox 				return that favour */
144b7e04f8cSWim Van Sebroeck 		acq_keepalive();
145b7e04f8cSWim Van Sebroeck 	}
146b7e04f8cSWim Van Sebroeck 	return count;
147b7e04f8cSWim Van Sebroeck }
148b7e04f8cSWim Van Sebroeck 
14994da1e2eSAlan Cox static long acq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
150b7e04f8cSWim Van Sebroeck {
151b7e04f8cSWim Van Sebroeck 	int options, retval = -EINVAL;
152b7e04f8cSWim Van Sebroeck 	void __user *argp = (void __user *)arg;
153b7e04f8cSWim Van Sebroeck 	int __user *p = argp;
15442747d71SWim Van Sebroeck 	static const struct watchdog_info ident = {
155b7e04f8cSWim Van Sebroeck 		.options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
156b7e04f8cSWim Van Sebroeck 		.firmware_version = 1,
157b7e04f8cSWim Van Sebroeck 		.identity = WATCHDOG_NAME,
158b7e04f8cSWim Van Sebroeck 	};
159b7e04f8cSWim Van Sebroeck 
16094da1e2eSAlan Cox 	switch (cmd) {
161b7e04f8cSWim Van Sebroeck 	case WDIOC_GETSUPPORT:
162b7e04f8cSWim Van Sebroeck 		return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
163b7e04f8cSWim Van Sebroeck 
164b7e04f8cSWim Van Sebroeck 	case WDIOC_GETSTATUS:
165b7e04f8cSWim Van Sebroeck 	case WDIOC_GETBOOTSTATUS:
166b7e04f8cSWim Van Sebroeck 		return put_user(0, p);
167b7e04f8cSWim Van Sebroeck 
168b7e04f8cSWim Van Sebroeck 	case WDIOC_SETOPTIONS:
169b7e04f8cSWim Van Sebroeck 	{
170b7e04f8cSWim Van Sebroeck 		if (get_user(options, p))
171b7e04f8cSWim Van Sebroeck 			return -EFAULT;
17294da1e2eSAlan Cox 		if (options & WDIOS_DISABLECARD) {
173b7e04f8cSWim Van Sebroeck 			acq_stop();
174b7e04f8cSWim Van Sebroeck 			retval = 0;
175b7e04f8cSWim Van Sebroeck 		}
17694da1e2eSAlan Cox 		if (options & WDIOS_ENABLECARD) {
177b7e04f8cSWim Van Sebroeck 			acq_keepalive();
178b7e04f8cSWim Van Sebroeck 			retval = 0;
179b7e04f8cSWim Van Sebroeck 		}
180b7e04f8cSWim Van Sebroeck 		return retval;
181b7e04f8cSWim Van Sebroeck 	}
1820c06090cSWim Van Sebroeck 	case WDIOC_KEEPALIVE:
1830c06090cSWim Van Sebroeck 		acq_keepalive();
1840c06090cSWim Van Sebroeck 		return 0;
1850c06090cSWim Van Sebroeck 
1860c06090cSWim Van Sebroeck 	case WDIOC_GETTIMEOUT:
1870c06090cSWim Van Sebroeck 		return put_user(WATCHDOG_HEARTBEAT, p);
1880c06090cSWim Van Sebroeck 
189b7e04f8cSWim Van Sebroeck 	default:
190b7e04f8cSWim Van Sebroeck 		return -ENOTTY;
191b7e04f8cSWim Van Sebroeck 	}
192b7e04f8cSWim Van Sebroeck }
193b7e04f8cSWim Van Sebroeck 
194b7e04f8cSWim Van Sebroeck static int acq_open(struct inode *inode, struct file *file)
195b7e04f8cSWim Van Sebroeck {
196b7e04f8cSWim Van Sebroeck 	if (test_and_set_bit(0, &acq_is_open))
197b7e04f8cSWim Van Sebroeck 		return -EBUSY;
198b7e04f8cSWim Van Sebroeck 
199b7e04f8cSWim Van Sebroeck 	if (nowayout)
200b7e04f8cSWim Van Sebroeck 		__module_get(THIS_MODULE);
201b7e04f8cSWim Van Sebroeck 
202b7e04f8cSWim Van Sebroeck 	/* Activate */
203b7e04f8cSWim Van Sebroeck 	acq_keepalive();
204b7e04f8cSWim Van Sebroeck 	return nonseekable_open(inode, file);
205b7e04f8cSWim Van Sebroeck }
206b7e04f8cSWim Van Sebroeck 
207b7e04f8cSWim Van Sebroeck static int acq_close(struct inode *inode, struct file *file)
208b7e04f8cSWim Van Sebroeck {
209b7e04f8cSWim Van Sebroeck 	if (expect_close == 42) {
210b7e04f8cSWim Van Sebroeck 		acq_stop();
211b7e04f8cSWim Van Sebroeck 	} else {
21227c766aaSJoe Perches 		pr_crit("Unexpected close, not stopping watchdog!\n");
213b7e04f8cSWim Van Sebroeck 		acq_keepalive();
214b7e04f8cSWim Van Sebroeck 	}
215b7e04f8cSWim Van Sebroeck 	clear_bit(0, &acq_is_open);
216b7e04f8cSWim Van Sebroeck 	expect_close = 0;
217b7e04f8cSWim Van Sebroeck 	return 0;
218b7e04f8cSWim Van Sebroeck }
219b7e04f8cSWim Van Sebroeck 
220b7e04f8cSWim Van Sebroeck /*
221b7e04f8cSWim Van Sebroeck  *	Kernel Interfaces
222b7e04f8cSWim Van Sebroeck  */
223b7e04f8cSWim Van Sebroeck 
224b7e04f8cSWim Van Sebroeck static const struct file_operations acq_fops = {
225b7e04f8cSWim Van Sebroeck 	.owner		= THIS_MODULE,
226b7e04f8cSWim Van Sebroeck 	.llseek		= no_llseek,
227b7e04f8cSWim Van Sebroeck 	.write		= acq_write,
22894da1e2eSAlan Cox 	.unlocked_ioctl	= acq_ioctl,
229b7e04f8cSWim Van Sebroeck 	.open		= acq_open,
230b7e04f8cSWim Van Sebroeck 	.release	= acq_close,
231b7e04f8cSWim Van Sebroeck };
232b7e04f8cSWim Van Sebroeck 
233b7e04f8cSWim Van Sebroeck static struct miscdevice acq_miscdev = {
234b7e04f8cSWim Van Sebroeck 	.minor	= WATCHDOG_MINOR,
235b7e04f8cSWim Van Sebroeck 	.name	= "watchdog",
236b7e04f8cSWim Van Sebroeck 	.fops	= &acq_fops,
237b7e04f8cSWim Van Sebroeck };
238b7e04f8cSWim Van Sebroeck 
239b7e04f8cSWim Van Sebroeck /*
240b7e04f8cSWim Van Sebroeck  *	Init & exit routines
241b7e04f8cSWim Van Sebroeck  */
242b7e04f8cSWim Van Sebroeck 
243b7e04f8cSWim Van Sebroeck static int __devinit acq_probe(struct platform_device *dev)
244b7e04f8cSWim Van Sebroeck {
245b7e04f8cSWim Van Sebroeck 	int ret;
246b7e04f8cSWim Van Sebroeck 
247b7e04f8cSWim Van Sebroeck 	if (wdt_stop != wdt_start) {
248b7e04f8cSWim Van Sebroeck 		if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) {
24927c766aaSJoe Perches 			pr_err("I/O address 0x%04x already in use\n", wdt_stop);
250b7e04f8cSWim Van Sebroeck 			ret = -EIO;
251b7e04f8cSWim Van Sebroeck 			goto out;
252b7e04f8cSWim Van Sebroeck 		}
253b7e04f8cSWim Van Sebroeck 	}
254b7e04f8cSWim Van Sebroeck 
255b7e04f8cSWim Van Sebroeck 	if (!request_region(wdt_start, 1, WATCHDOG_NAME)) {
25627c766aaSJoe Perches 		pr_err("I/O address 0x%04x already in use\n", wdt_start);
257b7e04f8cSWim Van Sebroeck 		ret = -EIO;
258b7e04f8cSWim Van Sebroeck 		goto unreg_stop;
259b7e04f8cSWim Van Sebroeck 	}
260b7e04f8cSWim Van Sebroeck 	ret = misc_register(&acq_miscdev);
261b7e04f8cSWim Van Sebroeck 	if (ret != 0) {
26227c766aaSJoe Perches 		pr_err("cannot register miscdev on minor=%d (err=%d)\n",
263b7e04f8cSWim Van Sebroeck 		       WATCHDOG_MINOR, ret);
264b7e04f8cSWim Van Sebroeck 		goto unreg_regions;
265b7e04f8cSWim Van Sebroeck 	}
26627c766aaSJoe Perches 	pr_info("initialized. (nowayout=%d)\n", nowayout);
267b7e04f8cSWim Van Sebroeck 
268b7e04f8cSWim Van Sebroeck 	return 0;
269b7e04f8cSWim Van Sebroeck unreg_regions:
270b7e04f8cSWim Van Sebroeck 	release_region(wdt_start, 1);
271b7e04f8cSWim Van Sebroeck unreg_stop:
272b7e04f8cSWim Van Sebroeck 	if (wdt_stop != wdt_start)
273b7e04f8cSWim Van Sebroeck 		release_region(wdt_stop, 1);
274b7e04f8cSWim Van Sebroeck out:
275b7e04f8cSWim Van Sebroeck 	return ret;
276b7e04f8cSWim Van Sebroeck }
277b7e04f8cSWim Van Sebroeck 
278b7e04f8cSWim Van Sebroeck static int __devexit acq_remove(struct platform_device *dev)
279b7e04f8cSWim Van Sebroeck {
280b7e04f8cSWim Van Sebroeck 	misc_deregister(&acq_miscdev);
281b7e04f8cSWim Van Sebroeck 	release_region(wdt_start, 1);
282b7e04f8cSWim Van Sebroeck 	if (wdt_stop != wdt_start)
283b7e04f8cSWim Van Sebroeck 		release_region(wdt_stop, 1);
284b7e04f8cSWim Van Sebroeck 
285b7e04f8cSWim Van Sebroeck 	return 0;
286b7e04f8cSWim Van Sebroeck }
287b7e04f8cSWim Van Sebroeck 
288b7e04f8cSWim Van Sebroeck static void acq_shutdown(struct platform_device *dev)
289b7e04f8cSWim Van Sebroeck {
290b7e04f8cSWim Van Sebroeck 	/* Turn the WDT off if we have a soft shutdown */
291b7e04f8cSWim Van Sebroeck 	acq_stop();
292b7e04f8cSWim Van Sebroeck }
293b7e04f8cSWim Van Sebroeck 
294b7e04f8cSWim Van Sebroeck static struct platform_driver acquirewdt_driver = {
295b7e04f8cSWim Van Sebroeck 	.probe		= acq_probe,
296b7e04f8cSWim Van Sebroeck 	.remove		= __devexit_p(acq_remove),
297b7e04f8cSWim Van Sebroeck 	.shutdown	= acq_shutdown,
298b7e04f8cSWim Van Sebroeck 	.driver		= {
299b7e04f8cSWim Van Sebroeck 		.owner	= THIS_MODULE,
300b7e04f8cSWim Van Sebroeck 		.name	= DRV_NAME,
301b7e04f8cSWim Van Sebroeck 	},
302b7e04f8cSWim Van Sebroeck };
303b7e04f8cSWim Van Sebroeck 
304b7e04f8cSWim Van Sebroeck static int __init acq_init(void)
305b7e04f8cSWim Van Sebroeck {
306b7e04f8cSWim Van Sebroeck 	int err;
307b7e04f8cSWim Van Sebroeck 
30827c766aaSJoe Perches 	pr_info("WDT driver for Acquire single board computer initialising\n");
309b7e04f8cSWim Van Sebroeck 
310b7e04f8cSWim Van Sebroeck 	err = platform_driver_register(&acquirewdt_driver);
311b7e04f8cSWim Van Sebroeck 	if (err)
312b7e04f8cSWim Van Sebroeck 		return err;
313b7e04f8cSWim Van Sebroeck 
31494da1e2eSAlan Cox 	acq_platform_device = platform_device_register_simple(DRV_NAME,
31594da1e2eSAlan Cox 								-1, NULL, 0);
316b7e04f8cSWim Van Sebroeck 	if (IS_ERR(acq_platform_device)) {
317b7e04f8cSWim Van Sebroeck 		err = PTR_ERR(acq_platform_device);
318b7e04f8cSWim Van Sebroeck 		goto unreg_platform_driver;
319b7e04f8cSWim Van Sebroeck 	}
320b7e04f8cSWim Van Sebroeck 	return 0;
321b7e04f8cSWim Van Sebroeck 
322b7e04f8cSWim Van Sebroeck unreg_platform_driver:
323b7e04f8cSWim Van Sebroeck 	platform_driver_unregister(&acquirewdt_driver);
324b7e04f8cSWim Van Sebroeck 	return err;
325b7e04f8cSWim Van Sebroeck }
326b7e04f8cSWim Van Sebroeck 
327b7e04f8cSWim Van Sebroeck static void __exit acq_exit(void)
328b7e04f8cSWim Van Sebroeck {
329b7e04f8cSWim Van Sebroeck 	platform_device_unregister(acq_platform_device);
330b7e04f8cSWim Van Sebroeck 	platform_driver_unregister(&acquirewdt_driver);
33127c766aaSJoe Perches 	pr_info("Watchdog Module Unloaded\n");
332b7e04f8cSWim Van Sebroeck }
333b7e04f8cSWim Van Sebroeck 
334b7e04f8cSWim Van Sebroeck module_init(acq_init);
335b7e04f8cSWim Van Sebroeck module_exit(acq_exit);
336b7e04f8cSWim Van Sebroeck 
337b7e04f8cSWim Van Sebroeck MODULE_AUTHOR("David Woodhouse");
338b7e04f8cSWim Van Sebroeck MODULE_DESCRIPTION("Acquire Inc. Single Board Computer Watchdog Timer driver");
339b7e04f8cSWim Van Sebroeck MODULE_LICENSE("GPL");
340b7e04f8cSWim Van Sebroeck MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
341