diff options
| -rw-r--r-- | Documentation/devicetree/bindings/watchdog/dw_wdt.txt | 21 | ||||
| -rw-r--r-- | drivers/watchdog/dw_wdt.c | 10 |
2 files changed, 31 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/watchdog/dw_wdt.txt b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt new file mode 100644 index 000000000000..08e16f684f2d --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | Synopsys Designware Watchdog Timer | ||
| 2 | |||
| 3 | Required Properties: | ||
| 4 | |||
| 5 | - compatible : Should contain "snps,dw-wdt" | ||
| 6 | - reg : Base address and size of the watchdog timer registers. | ||
| 7 | - clocks : phandle + clock-specifier for the clock that drives the | ||
| 8 | watchdog timer. | ||
| 9 | |||
| 10 | Optional Properties: | ||
| 11 | |||
| 12 | - interrupts : The interrupt used for the watchdog timeout warning. | ||
| 13 | |||
| 14 | Example: | ||
| 15 | |||
| 16 | watchdog0: wd@ffd02000 { | ||
| 17 | compatible = "snps,dw-wdt"; | ||
| 18 | reg = <0xffd02000 0x1000>; | ||
| 19 | interrupts = <0 171 4>; | ||
| 20 | clocks = <&per_base_clk>; | ||
| 21 | }; | ||
diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c index 42cfd79edf2a..a46f5c7ee7ff 100644 --- a/drivers/watchdog/dw_wdt.c +++ b/drivers/watchdog/dw_wdt.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/miscdevice.h> | 29 | #include <linux/miscdevice.h> |
| 30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
| 31 | #include <linux/moduleparam.h> | 31 | #include <linux/moduleparam.h> |
| 32 | #include <linux/of.h> | ||
| 32 | #include <linux/pm.h> | 33 | #include <linux/pm.h> |
| 33 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
| 34 | #include <linux/spinlock.h> | 35 | #include <linux/spinlock.h> |
| @@ -337,12 +338,21 @@ static int dw_wdt_drv_remove(struct platform_device *pdev) | |||
| 337 | return 0; | 338 | return 0; |
| 338 | } | 339 | } |
| 339 | 340 | ||
| 341 | #ifdef CONFIG_OF | ||
| 342 | static const struct of_device_id dw_wdt_of_match[] = { | ||
| 343 | { .compatible = "snps,dw-wdt", }, | ||
| 344 | { /* sentinel */ } | ||
| 345 | }; | ||
| 346 | MODULE_DEVICE_TABLE(of, dw_wdt_of_match); | ||
| 347 | #endif | ||
| 348 | |||
| 340 | static struct platform_driver dw_wdt_driver = { | 349 | static struct platform_driver dw_wdt_driver = { |
| 341 | .probe = dw_wdt_drv_probe, | 350 | .probe = dw_wdt_drv_probe, |
| 342 | .remove = dw_wdt_drv_remove, | 351 | .remove = dw_wdt_drv_remove, |
| 343 | .driver = { | 352 | .driver = { |
| 344 | .name = "dw_wdt", | 353 | .name = "dw_wdt", |
| 345 | .owner = THIS_MODULE, | 354 | .owner = THIS_MODULE, |
| 355 | .of_match_table = of_match_ptr(dw_wdt_of_match), | ||
| 346 | .pm = &dw_wdt_pm_ops, | 356 | .pm = &dw_wdt_pm_ops, |
| 347 | }, | 357 | }, |
| 348 | }; | 358 | }; |
