Skip to contentSkip to conversation

watchdog: dw: Enable OF support for DW watchdog timer

PATCH In review [email protected] 3 participants 3 messages Oct 22, 2013 – Oct 29, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

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]>

---
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
new file mode 100644
index 0000000..08e16f6
@@ -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
index e621098..261fa42 100644
@@ -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

A message that is not in the archive (sent off-list or not yet received): 1382461152-22891-1-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 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.

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

#3 lore raw
In reply to a message not in the archive

Hi Dinh,

Quoted 4 lines

From: Dinh Nguyen <[email protected]>

Add device tree support to the DW watchdog timer.

Quoted 13 lines
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