diff options
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/at91sam9_wdt.c | 11 | ||||
-rw-r--r-- | drivers/watchdog/imx2_wdt.c | 1 | ||||
-rw-r--r-- | drivers/watchdog/omap_wdt.c | 26 |
3 files changed, 23 insertions, 15 deletions
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c index 05e1be85fdee..dc42e44b6bc1 100644 --- a/drivers/watchdog/at91sam9_wdt.c +++ b/drivers/watchdog/at91sam9_wdt.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/timer.h> | 32 | #include <linux/timer.h> |
33 | #include <linux/bitops.h> | 33 | #include <linux/bitops.h> |
34 | #include <linux/uaccess.h> | 34 | #include <linux/uaccess.h> |
35 | #include <linux/of.h> | ||
35 | 36 | ||
36 | #include "at91sam9_wdt.h" | 37 | #include "at91sam9_wdt.h" |
37 | 38 | ||
@@ -302,11 +303,21 @@ static int __exit at91wdt_remove(struct platform_device *pdev) | |||
302 | return res; | 303 | return res; |
303 | } | 304 | } |
304 | 305 | ||
306 | #if defined(CONFIG_OF) | ||
307 | static const struct of_device_id at91_wdt_dt_ids[] __initconst = { | ||
308 | { .compatible = "atmel,at91sam9260-wdt" }, | ||
309 | { /* sentinel */ } | ||
310 | }; | ||
311 | |||
312 | MODULE_DEVICE_TABLE(of, at91_wdt_dt_ids); | ||
313 | #endif | ||
314 | |||
305 | static struct platform_driver at91wdt_driver = { | 315 | static struct platform_driver at91wdt_driver = { |
306 | .remove = __exit_p(at91wdt_remove), | 316 | .remove = __exit_p(at91wdt_remove), |
307 | .driver = { | 317 | .driver = { |
308 | .name = "at91_wdt", | 318 | .name = "at91_wdt", |
309 | .owner = THIS_MODULE, | 319 | .owner = THIS_MODULE, |
320 | .of_match_table = of_match_ptr(at91_wdt_dt_ids), | ||
310 | }, | 321 | }, |
311 | }; | 322 | }; |
312 | 323 | ||
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index bcfab2b00ad2..9a45d0294cf4 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/uaccess.h> | 33 | #include <linux/uaccess.h> |
34 | #include <linux/timer.h> | 34 | #include <linux/timer.h> |
35 | #include <linux/jiffies.h> | 35 | #include <linux/jiffies.h> |
36 | #include <mach/hardware.h> | ||
37 | 36 | ||
38 | #define DRIVER_NAME "imx2-wdt" | 37 | #define DRIVER_NAME "imx2-wdt" |
39 | 38 | ||
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index f5db18dbc0f9..477a1d47a64c 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c | |||
@@ -46,8 +46,8 @@ | |||
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 | |
50 | #include <plat/prcm.h> | 50 | #include <linux/platform_data/omap-wd-timer.h> |
51 | 51 | ||
52 | #include "omap_wdt.h" | 52 | #include "omap_wdt.h" |
53 | 53 | ||
@@ -202,8 +202,10 @@ static ssize_t omap_wdt_write(struct file *file, const char __user *data, | |||
202 | static long omap_wdt_ioctl(struct file *file, unsigned int cmd, | 202 | static long omap_wdt_ioctl(struct file *file, unsigned int cmd, |
203 | unsigned long arg) | 203 | unsigned long arg) |
204 | { | 204 | { |
205 | struct omap_wd_timer_platform_data *pdata; | ||
205 | struct omap_wdt_dev *wdev; | 206 | struct omap_wdt_dev *wdev; |
206 | int new_margin; | 207 | u32 rs; |
208 | int new_margin, bs; | ||
207 | static const struct watchdog_info ident = { | 209 | static const struct watchdog_info ident = { |
208 | .identity = "OMAP Watchdog", | 210 | .identity = "OMAP Watchdog", |
209 | .options = WDIOF_SETTIMEOUT, | 211 | .options = WDIOF_SETTIMEOUT, |
@@ -211,6 +213,7 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd, | |||
211 | }; | 213 | }; |
212 | 214 | ||
213 | wdev = file->private_data; | 215 | wdev = file->private_data; |
216 | pdata = wdev->dev->platform_data; | ||
214 | 217 | ||
215 | switch (cmd) { | 218 | switch (cmd) { |
216 | case WDIOC_GETSUPPORT: | 219 | case WDIOC_GETSUPPORT: |
@@ -219,17 +222,12 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd, | |||
219 | case WDIOC_GETSTATUS: | 222 | case WDIOC_GETSTATUS: |
220 | return put_user(0, (int __user *)arg); | 223 | return put_user(0, (int __user *)arg); |
221 | case WDIOC_GETBOOTSTATUS: | 224 | case WDIOC_GETBOOTSTATUS: |
222 | #ifdef CONFIG_ARCH_OMAP1 | 225 | if (!pdata || !pdata->read_reset_sources) |
223 | if (cpu_is_omap16xx()) | 226 | return put_user(0, (int __user *)arg); |
224 | return put_user(__raw_readw(ARM_SYSST), | 227 | rs = pdata->read_reset_sources(); |
225 | (int __user *)arg); | 228 | bs = (rs & (1 << OMAP_MPU_WD_RST_SRC_ID_SHIFT)) ? |
226 | #endif | 229 | WDIOF_CARDRESET : 0; |
227 | #ifdef CONFIG_ARCH_OMAP2PLUS | 230 | return put_user(bs, (int __user *)arg); |
228 | if (cpu_is_omap24xx()) | ||
229 | return put_user(omap_prcm_get_reset_sources(), | ||
230 | (int __user *)arg); | ||
231 | #endif | ||
232 | return put_user(0, (int __user *)arg); | ||
233 | case WDIOC_KEEPALIVE: | 231 | case WDIOC_KEEPALIVE: |
234 | spin_lock(&wdt_lock); | 232 | spin_lock(&wdt_lock); |
235 | omap_wdt_ping(wdev); | 233 | omap_wdt_ping(wdev); |