Thread (1 message) 1 message, 1 author, 2013-10-02

Re: [RESEND PATCHv2] watchdog: dw: Enable OF support for DW watchdog timer.

From: Guenter Roeck <hidden>
Date: 2013-10-02 19:27:43
Also in: linux-watchdog

On Wed, Oct 02, 2013 at 01:44:32PM -0500, dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org wrote:
quoted hunk
From: Dinh Nguyen <redacted>

Add device tree support to the DW watchdog timer.

Signed-off-by: Dinh Nguyen <redacted>
Acked-by: Jamie Iles <redacted>
Reviewed-by: Pavel Machek <redacted>
Cc: Guenter Roeck <redacted>
Cc: Jamie Iles <redacted>
Cc: Viresh Kumar <redacted>
Cc: Wim Van Sebroeck <redacted>
Cc: Pavel Machek <redacted>
Cc: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
Cc: Pawel Moll <redacted>
Cc: Mark Rutland <redacted>
Cc: Stephen Warren <redacted>
Cc: Ian Campbell <redacted>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
v2:
- Use of_match_ptr() for of_match_table
---
 .../devicetree/bindings/watchdog/dw_wdt.txt        |   16 ++++++++++++++++
 drivers/watchdog/dw_wdt.c                          |    8 ++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/dw_wdt.txt
diff --git a/Documentation/devicetree/bindings/watchdog/dw_wdt.txt b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt
new file mode 100644
index 0000000..29e150b
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt
@@ -0,0 +1,16 @@
+Synopsys Designware Watchdog Timer
+
+Required Properties:
+
+- Compatiblity	: "snps,dw-wdt"
+- reg		: Base address of the watchdog timer register.
+
+Example:
+
+	watchdog0: wd@ffd02000 {
+		compatible = "snps,dw-wdt";
+		reg = <0xffd02000 0x1000>;
+		interrupts = <0 171 4>;
+		clocks = <&per_base_clk>;
+		status = "okay";
+	};
diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
index 2037669..a720f9b 100644
--- a/drivers/watchdog/dw_wdt.c
+++ b/drivers/watchdog/dw_wdt.c
@@ -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>
@@ -343,12 +344,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),
There is a separate set of patches from Sachin, removing unnecessary
uses of of_match_ptr() from various watchdog drivers. Sachin's argument
is that it does not make sense to use of_match_ptr if the function
it points to (dw_wdt_of_match in this case) is always compiled
unconditionally anyway.

Your comments suggest that you actually _added_ of_match_ptr() in v2 of this
patch, even though dw_wdt_of_match always exists and of_match_ptr is thus
technically unnecessary.

Not that I really care one way or another, but can we get an authoritative
answer what subsystem maintainers are supposed to accept ?

Thanks,
Guenter
 #ifdef CONFIG_PM
 		.pm	= &dw_wdt_pm_ops,
 #endif /* CONFIG_PM */
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help