19 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21 #include <linux/module.h>
23 #include <linux/types.h>
24 #include <linux/kernel.h>
27 #include <linux/watchdog.h>
29 #include <linux/bitops.h>
39 static unsigned long wdt_status;
42 #define WDT_OK_TO_CLOSE 1
44 static void wdt_enable(
void)
62 static void wdt_disable(
void)
72 static void wdt_keepalive(
void)
91 static ssize_t m54xx_wdt_write(
struct file *file,
const char *
data,
92 size_t len, loff_t *ppos)
100 for (i = 0; i != len; i++) {
117 .identity =
"Coldfire M54xx Watchdog",
120 static long m54xx_wdt_ioctl(
struct file *file,
unsigned int cmd,
129 sizeof(ident)) ? -
EFAULT : 0;
150 if (time <= 0 || time > 30) {
166 static int m54xx_wdt_release(
struct inode *inode,
struct file *file)
171 pr_crit(
"Device closed unexpectedly - timer will not stop\n");
184 .write = m54xx_wdt_write,
185 .unlocked_ioctl = m54xx_wdt_ioctl,
186 .open = m54xx_wdt_open,
187 .release = m54xx_wdt_release,
190 static struct miscdevice m54xx_wdt_miscdev = {
193 .fops = &m54xx_wdt_fops,
196 static int __init m54xx_wdt_init(
void)
207 static void __exit m54xx_wdt_exit(
void)