Skip to contentSkip to conversation

watchdog: dw: Enable OF support for DW watchdog timer

PATCH Superseded [email protected] 2 participants 2 messages Oct 22, 2013 1 message not in the archive

Subsystems (2)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 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 Jamie Iles <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Wim Van Sebroeck <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Rob Herring <rob.herring-bsGFqQB8/[email protected]>
Cc Pawel Moll <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Ian Campbell <[email protected]>

---
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        |   19 +++++++++++++++++++
 drivers/watchdog/dw_wdt.c                          |    8 ++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/dw_wdt.txt
Documentation/devicetree/bindings/watchdog/dw_wdt.txt new file +19 -0
new file mode 100644
index 0000000..8f5948a
@@ -0,0 +1,19 @@
+Synopsys Designware Watchdog Timer
+
+Required Properties:
+
+- compatible	: Should contain "snps,dw-wdt"
+- reg		: Base address and size of the watchdog timer register.
+
+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): 1382441671-18444-1-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org

#2 lore raw
Quoted 38 lines · On 10/22/2013 04:34 AM, [email protected] wrote:

From: Dinh Nguyen <[email protected]>

Add device tree support to the DW watchdog timer.

Cc Guenter Roeck <[email protected]>
Cc Jamie Iles <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Wim Van Sebroeck <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Rob Herring <rob.herring-bsGFqQB8/[email protected]>
Cc Pawel Moll <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Ian Campbell <[email protected]>

---
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        |   19 +++++++++++++++++++
  drivers/watchdog/dw_wdt.c                          |    8 ++++++++
  2 files changed, 27 insertions(+)

create mode 100644 Documentation/devicetree/bindings/watchdog/dw_wdt.txt

Documentation/devicetree/bindings/watchdog/dw_wdt.txt new file +0 -0
new file mode 100644
index 0000000..8f5948a

Documentation/devicetree/bindings/watchdog/dw_wdt.txt line 7

Quoted 7 lines
Documentation/devicetree/bindings/watchdog/dw_wdt.txt new file +7 -0
@@ -0,0 +1,19 @@
+Synopsys Designware Watchdog Timer
+
+Required Properties:
+
+- compatible	: Should contain "snps,dw-wdt"
+- reg		: Base address and size of the watchdog timer register.
+

Still missing 'clocks' here.

Thanks,
Guenter

Quoted 35 lines
Documentation/devicetree/bindings/watchdog/dw_wdt.txt new file +12 -0
+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 +7 -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);
+

drivers/watchdog/dw_wdt.c static int dw_wdt_drv_remove(struct platform_device *pdev) · line 359

Quoted 10 lines
drivers/watchdog/dw_wdt.c +1 -0
  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 */

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