Commit 58e56373 authored by Dinh Nguyen's avatar Dinh Nguyen Committed by Wim Van Sebroeck

watchdog: dw: Enable OF support for DW watchdog timer

Add device tree support to the DW watchdog timer.
Signed-off-by: default avatarDinh Nguyen <dinguyen@altera.com>
Acked-by: default avatarJamie Iles <jamie@jamieiles.com>
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Reviewed-by: default avatarPavel Machek <pavel@denx.de>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
Cc: Viresh Kumar <viresh.linux@gmail.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: devicetree@vger.kernel.org
Cc: linux-watchdog@vger.kernel.org
parent 487722cf
Synopsys Designware Watchdog Timer
Required Properties:
- compatible : Should contain "snps,dw-wdt"
- reg : Base address and size of the watchdog timer registers.
- clocks : phandle + clock-specifier for the clock that drives the
watchdog timer.
Optional Properties:
- interrupts : The interrupt used for the watchdog timeout warning.
Example:
watchdog0: wd@ffd02000 {
compatible = "snps,dw-wdt";
reg = <0xffd02000 0x1000>;
interrupts = <0 171 4>;
clocks = <&per_base_clk>;
};
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/of.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
...@@ -337,12 +338,21 @@ static int dw_wdt_drv_remove(struct platform_device *pdev) ...@@ -337,12 +338,21 @@ static int dw_wdt_drv_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_OF
static const struct of_device_id dw_wdt_of_match[] = {
{ .compatible = "snps,dw-wdt", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, dw_wdt_of_match);
#endif
static struct platform_driver dw_wdt_driver = { static struct platform_driver dw_wdt_driver = {
.probe = dw_wdt_drv_probe, .probe = dw_wdt_drv_probe,
.remove = dw_wdt_drv_remove, .remove = dw_wdt_drv_remove,
.driver = { .driver = {
.name = "dw_wdt", .name = "dw_wdt",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = of_match_ptr(dw_wdt_of_match),
.pm = &dw_wdt_pm_ops, .pm = &dw_wdt_pm_ops,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment