diff options
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/Kconfig | 6 | ||||
-rw-r--r-- | drivers/watchdog/booke_wdt.c | 7 | ||||
-rw-r--r-- | drivers/watchdog/da9052_wdt.c | 1 | ||||
-rw-r--r-- | drivers/watchdog/hpwdt.c | 3 | ||||
-rw-r--r-- | drivers/watchdog/ks8695_wdt.c | 14 | ||||
-rw-r--r-- | drivers/watchdog/mpc8xxx_wdt.c | 2 | ||||
-rw-r--r-- | drivers/watchdog/omap_wdt.c | 5 | ||||
-rw-r--r-- | drivers/watchdog/watchdog_core.c | 3 |
8 files changed, 30 insertions, 11 deletions
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 53d75719078e..ad1bb9382a96 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
@@ -237,12 +237,12 @@ config OMAP_WATCHDOG | |||
237 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. | 237 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. |
238 | 238 | ||
239 | config PNX4008_WATCHDOG | 239 | config PNX4008_WATCHDOG |
240 | tristate "PNX4008 and LPC32XX Watchdog" | 240 | tristate "LPC32XX Watchdog" |
241 | depends on ARCH_PNX4008 || ARCH_LPC32XX | 241 | depends on ARCH_LPC32XX |
242 | select WATCHDOG_CORE | 242 | select WATCHDOG_CORE |
243 | help | 243 | help |
244 | Say Y here if to include support for the watchdog timer | 244 | Say Y here if to include support for the watchdog timer |
245 | in the PNX4008 or LPC32XX processor. | 245 | in the LPC32XX processor. |
246 | This driver can be built as a module by choosing M. The module | 246 | This driver can be built as a module by choosing M. The module |
247 | will be called pnx4008_wdt. | 247 | will be called pnx4008_wdt. |
248 | 248 | ||
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c index 3fe82d0e8caa..5b06d31ab6a9 100644 --- a/drivers/watchdog/booke_wdt.c +++ b/drivers/watchdog/booke_wdt.c | |||
@@ -166,18 +166,17 @@ static long booke_wdt_ioctl(struct file *file, | |||
166 | 166 | ||
167 | switch (cmd) { | 167 | switch (cmd) { |
168 | case WDIOC_GETSUPPORT: | 168 | case WDIOC_GETSUPPORT: |
169 | if (copy_to_user((void *)arg, &ident, sizeof(ident))) | 169 | return copy_to_user(p, &ident, sizeof(ident)) ? -EFAULT : 0; |
170 | return -EFAULT; | ||
171 | case WDIOC_GETSTATUS: | 170 | case WDIOC_GETSTATUS: |
172 | return put_user(0, p); | 171 | return put_user(0, p); |
173 | case WDIOC_GETBOOTSTATUS: | 172 | case WDIOC_GETBOOTSTATUS: |
174 | /* XXX: something is clearing TSR */ | 173 | /* XXX: something is clearing TSR */ |
175 | tmp = mfspr(SPRN_TSR) & TSR_WRS(3); | 174 | tmp = mfspr(SPRN_TSR) & TSR_WRS(3); |
176 | /* returns CARDRESET if last reset was caused by the WDT */ | 175 | /* returns CARDRESET if last reset was caused by the WDT */ |
177 | return (tmp ? WDIOF_CARDRESET : 0); | 176 | return put_user((tmp ? WDIOF_CARDRESET : 0), p); |
178 | case WDIOC_SETOPTIONS: | 177 | case WDIOC_SETOPTIONS: |
179 | if (get_user(tmp, p)) | 178 | if (get_user(tmp, p)) |
180 | return -EINVAL; | 179 | return -EFAULT; |
181 | if (tmp == WDIOS_ENABLECARD) { | 180 | if (tmp == WDIOS_ENABLECARD) { |
182 | booke_wdt_ping(); | 181 | booke_wdt_ping(); |
183 | break; | 182 | break; |
diff --git a/drivers/watchdog/da9052_wdt.c b/drivers/watchdog/da9052_wdt.c index 3f75129eb0a9..f7abbaeebcaf 100644 --- a/drivers/watchdog/da9052_wdt.c +++ b/drivers/watchdog/da9052_wdt.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/jiffies.h> | 23 | #include <linux/jiffies.h> |
24 | #include <linux/delay.h> | ||
25 | 24 | ||
26 | #include <linux/mfd/da9052/reg.h> | 25 | #include <linux/mfd/da9052/reg.h> |
27 | #include <linux/mfd/da9052/da9052.h> | 26 | #include <linux/mfd/da9052/da9052.h> |
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 1eff743ec497..ae60406ea8a1 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
@@ -814,6 +814,9 @@ static int __devinit hpwdt_init_one(struct pci_dev *dev, | |||
814 | hpwdt_timer_reg = pci_mem_addr + 0x70; | 814 | hpwdt_timer_reg = pci_mem_addr + 0x70; |
815 | hpwdt_timer_con = pci_mem_addr + 0x72; | 815 | hpwdt_timer_con = pci_mem_addr + 0x72; |
816 | 816 | ||
817 | /* Make sure that timer is disabled until /dev/watchdog is opened */ | ||
818 | hpwdt_stop(); | ||
819 | |||
817 | /* Make sure that we have a valid soft_margin */ | 820 | /* Make sure that we have a valid soft_margin */ |
818 | if (hpwdt_change_timer(soft_margin)) | 821 | if (hpwdt_change_timer(soft_margin)) |
819 | hpwdt_change_timer(DEFAULT_MARGIN); | 822 | hpwdt_change_timer(DEFAULT_MARGIN); |
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c index 59e75d9a6b7f..c1a4d3bf581d 100644 --- a/drivers/watchdog/ks8695_wdt.c +++ b/drivers/watchdog/ks8695_wdt.c | |||
@@ -24,7 +24,19 @@ | |||
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/uaccess.h> | 25 | #include <linux/uaccess.h> |
26 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
27 | #include <mach/regs-timer.h> | 27 | |
28 | #define KS8695_TMR_OFFSET (0xF0000 + 0xE400) | ||
29 | #define KS8695_TMR_VA (KS8695_IO_VA + KS8695_TMR_OFFSET) | ||
30 | |||
31 | /* | ||
32 | * Timer registers | ||
33 | */ | ||
34 | #define KS8695_TMCON (0x00) /* Timer Control Register */ | ||
35 | #define KS8695_T0TC (0x08) /* Timer 0 Timeout Count Register */ | ||
36 | #define TMCON_T0EN (1 << 0) /* Timer 0 Enable */ | ||
37 | |||
38 | /* Timer0 Timeout Counter Register */ | ||
39 | #define T0TC_WATCHDOG (0xff) /* Enable watchdog mode */ | ||
28 | 40 | ||
29 | #define WDT_DEFAULT_TIME 5 /* seconds */ | 41 | #define WDT_DEFAULT_TIME 5 /* seconds */ |
30 | #define WDT_MAX_TIME 171 /* seconds */ | 42 | #define WDT_MAX_TIME 171 /* seconds */ |
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c index 40f7bf1f8654..e6a038ae8dc2 100644 --- a/drivers/watchdog/mpc8xxx_wdt.c +++ b/drivers/watchdog/mpc8xxx_wdt.c | |||
@@ -193,7 +193,7 @@ static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev) | |||
193 | int ret; | 193 | int ret; |
194 | const struct of_device_id *match; | 194 | const struct of_device_id *match; |
195 | struct device_node *np = ofdev->dev.of_node; | 195 | struct device_node *np = ofdev->dev.of_node; |
196 | struct mpc8xxx_wdt_type *wdt_type; | 196 | const struct mpc8xxx_wdt_type *wdt_type; |
197 | u32 freq = fsl_get_sys_freq(); | 197 | u32 freq = fsl_get_sys_freq(); |
198 | bool enabled; | 198 | bool enabled; |
199 | 199 | ||
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index fceec4f4eb7e..f5db18dbc0f9 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <linux/slab.h> | 46 | #include <linux/slab.h> |
47 | #include <linux/pm_runtime.h> | 47 | #include <linux/pm_runtime.h> |
48 | #include <mach/hardware.h> | 48 | #include <mach/hardware.h> |
49 | #include <plat/cpu.h> | ||
49 | #include <plat/prcm.h> | 50 | #include <plat/prcm.h> |
50 | 51 | ||
51 | #include "omap_wdt.h" | 52 | #include "omap_wdt.h" |
@@ -218,12 +219,16 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd, | |||
218 | case WDIOC_GETSTATUS: | 219 | case WDIOC_GETSTATUS: |
219 | return put_user(0, (int __user *)arg); | 220 | return put_user(0, (int __user *)arg); |
220 | case WDIOC_GETBOOTSTATUS: | 221 | case WDIOC_GETBOOTSTATUS: |
222 | #ifdef CONFIG_ARCH_OMAP1 | ||
221 | if (cpu_is_omap16xx()) | 223 | if (cpu_is_omap16xx()) |
222 | return put_user(__raw_readw(ARM_SYSST), | 224 | return put_user(__raw_readw(ARM_SYSST), |
223 | (int __user *)arg); | 225 | (int __user *)arg); |
226 | #endif | ||
227 | #ifdef CONFIG_ARCH_OMAP2PLUS | ||
224 | if (cpu_is_omap24xx()) | 228 | if (cpu_is_omap24xx()) |
225 | return put_user(omap_prcm_get_reset_sources(), | 229 | return put_user(omap_prcm_get_reset_sources(), |
226 | (int __user *)arg); | 230 | (int __user *)arg); |
231 | #endif | ||
227 | return put_user(0, (int __user *)arg); | 232 | return put_user(0, (int __user *)arg); |
228 | case WDIOC_KEEPALIVE: | 233 | case WDIOC_KEEPALIVE: |
229 | spin_lock(&wdt_lock); | 234 | spin_lock(&wdt_lock); |
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c index 6aa46a90ff02..3796434991fa 100644 --- a/drivers/watchdog/watchdog_core.c +++ b/drivers/watchdog/watchdog_core.c | |||
@@ -128,11 +128,12 @@ EXPORT_SYMBOL_GPL(watchdog_register_device); | |||
128 | void watchdog_unregister_device(struct watchdog_device *wdd) | 128 | void watchdog_unregister_device(struct watchdog_device *wdd) |
129 | { | 129 | { |
130 | int ret; | 130 | int ret; |
131 | int devno = wdd->cdev.dev; | 131 | int devno; |
132 | 132 | ||
133 | if (wdd == NULL) | 133 | if (wdd == NULL) |
134 | return; | 134 | return; |
135 | 135 | ||
136 | devno = wdd->cdev.dev; | ||
136 | ret = watchdog_dev_unregister(wdd); | 137 | ret = watchdog_dev_unregister(wdd); |
137 | if (ret) | 138 | if (ret) |
138 | pr_err("error unregistering /dev/watchdog (err=%d)\n", ret); | 139 | pr_err("error unregistering /dev/watchdog (err=%d)\n", ret); |