mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-04 01:36:58 -05:00
watchdog: dw: Enable OF support for DW watchdog timer
Add device tree support to the DW watchdog timer. Signed-off-by: Dinh Nguyen <[email protected]> Acked-by: Jamie Iles <[email protected]> Acked-by: Mark Rutland <[email protected]> Reviewed-by: Pavel Machek <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]> Cc: Viresh Kumar <[email protected]> Cc: Rob Herring <[email protected]> Cc: Pawel Moll <[email protected]> Cc: Stephen Warren <[email protected]> Cc: Ian Campbell <[email protected]> Cc: [email protected] Cc: [email protected]
This commit is contained in:
parent
487722cf2d
commit
58e5637333
2 changed files with 31 additions and 0 deletions
21
Documentation/devicetree/bindings/watchdog/dw_wdt.txt
Normal file
21
Documentation/devicetree/bindings/watchdog/dw_wdt.txt
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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 @@
|
|||
#include <linux/miscdevice.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/spinlock.h>
|
||||
|
|
@ -337,12 +338,21 @@ static int dw_wdt_drv_remove(struct platform_device *pdev)
|
|||
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 = {
|
||||
.probe = dw_wdt_drv_probe,
|
||||
.remove = dw_wdt_drv_remove,
|
||||
.driver = {
|
||||
.name = "dw_wdt",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = of_match_ptr(dw_wdt_of_match),
|
||||
.pm = &dw_wdt_pm_ops,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue