19 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21 #include <linux/module.h>
23 #include <linux/types.h>
24 #include <linux/kernel.h>
28 #include <linux/watchdog.h>
29 #include <linux/reboot.h>
34 #include <mach/hardware.h>
45 static unsigned int soft_margin = 60;
46 static unsigned int reload;
47 static unsigned long timer_alive;
53 static void watchdog_fire(
int irq,
void *
dev_id)
64 static void watchdog_ping(
void)
113 static int watchdog_release(
struct inode *inode,
struct file *file)
122 static ssize_t watchdog_write(
struct file *file,
const char __user *
data,
123 size_t len, loff_t *ppos)
136 .identity =
"Footbridge Watchdog",
139 static long watchdog_ioctl(
struct file *file,
unsigned int cmd,
142 unsigned int new_margin;
149 if (
copy_to_user((
void __user *)arg, &ident,
sizeof(ident)))
164 ret =
get_user(new_margin, int_arg);
169 if (new_margin < 0 || new_margin > 60) {
174 soft_margin = new_margin;
179 ret =
put_user(soft_margin, int_arg);
188 .write = watchdog_write,
189 .unlocked_ioctl = watchdog_ioctl,
190 .open = watchdog_open,
191 .release = watchdog_release,
197 .fops = &watchdog_fops,
200 static int __init footbridge_watchdog_init(
void)
211 pr_info(
"Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n",
214 if (machine_is_cats())
215 pr_warn(
"Warning: Watchdog reset may not work on this machine\n");
219 static void __exit footbridge_watchdog_exit(
void)