watchdog: dw: Enable OF support for DW watchdog timer
Subsystems (2)
PATCH v6 1/1 watchdog: dw: Enable OF support for DW watchdog timer
From: Dinh Nguyen <[email protected]>
Add device tree support to the DW watchdog timer.
---
v6:
- Minor documentation fix and add Acked-by: Mark Rutland v5:
- Add documentation for clocks property
v4:
- Add interrupts as an optional property, use "should contain". v3:
- Clean up documentation
v2:
- Use of_match_ptr() for of_match_table
--- .../devicetree/bindings/watchdog/dw_wdt.txt | 21 ++++++++++++++++++++ drivers/watchdog/dw_wdt.c | 8 ++++++++ 2 files changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/watchdog/dw_wdt.txt
Documentation/devicetree/bindings/watchdog/dw_wdt.txt new file +21 -0
@@ -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>; + };
drivers/watchdog/dw_wdt.c +8 -0
@@ -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>
@@ -340,12 +341,19 @@ static int dw_wdt_drv_remove(struct platform_device *pdev)return 0 ; } +static const struct of_device_id dw_wdt_of_match[] = { + { .compatible ="snps,dw-wdt" , }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, dw_wdt_of_match); +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), #ifdef CONFIG_PM .pm = &dw_wdt_pm_ops, #endif /* CONFIG_PM */
Signature · 7 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Guenter Roeck
Reviewed-byQuoted 9 lines · On Tue, Oct 22, 2013 at 11:59:12AM -0500…
From: Dinh Nguyen <[email protected]>
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]>Cc Guenter Roeck <[email protected]>
I'll also add the patch to the watchdog-next branch of my repository at kernel.org.
Thanks,
Guenter
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Dinh,
Quoted 4 lines
From: Dinh Nguyen <[email protected]>
Add device tree support to the DW watchdog timer.
Quoted 13 lines
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]>Cc Guenter Roeck <[email protected]>Cc Viresh Kumar <[email protected]>Cc Wim Van Sebroeck <[email protected]>Cc Rob Herring <rob.herring-bsGFqQB8/[email protected]>Cc Pawel Moll <[email protected]>Cc Stephen Warren <[email protected]>Cc Ian Campbell <[email protected]>
Patch has been added to linux-watchdog-next.
I also added a #ifdef CONFIG_OF to the patch.
Reason: either we us the ifdef around the MODULE_DEVICE_TABLE together with the of_match_ptr
or we us no ifdef but then also no of_match_ptr. See also Sachin Kamat's patch (watchdog: Remove redundant of_match_ptr).
Kind regards,
Wim.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html