21 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
23 #include <linux/module.h>
25 #include <linux/types.h>
26 #include <linux/kernel.h>
29 #include <linux/watchdog.h>
32 #include <linux/bitops.h>
34 #include <linux/timex.h>
36 #ifdef CONFIG_ARCH_PXA
37 #include <mach/regs-ost.h>
40 #include <mach/reset.h>
41 #include <mach/hardware.h>
43 static unsigned long oscr_freq;
44 static unsigned long sa1100wdt_users;
45 static unsigned int pre_margin;
73 pr_crit(
"Device closed - timer will not stop\n");
79 size_t len, loff_t *ppos)
90 .identity =
"SA1100/PXA255 Watchdog",
91 .firmware_version = 1,
94 static long sa1100dog_ioctl(
struct file *file,
unsigned int cmd,
105 sizeof(ident)) ? -
EFAULT : 0;
126 if (time <= 0 || (oscr_freq * (
long long)time >= 0xffffffff)) {
131 pre_margin = oscr_freq *
time;
136 ret =
put_user(pre_margin / oscr_freq, p);
145 .write = sa1100dog_write,
146 .unlocked_ioctl = sa1100dog_ioctl,
147 .open = sa1100dog_open,
148 .release = sa1100dog_release,
151 static struct miscdevice sa1100dog_miscdev = {
154 .fops = &sa1100dog_fops,
159 static int __init sa1100dog_init(
void)
172 pre_margin = oscr_freq * margin;
176 pr_info(
"SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n",
181 static void __exit sa1100dog_exit(
void)