Skip to contentSkip to conversation

watchdog: dw: Enable OF support for DW watchdog timer

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

Subsystems (2)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

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

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

Acked-by
#2 lore raw
Quoted 40 lines · On Tue, Oct 22, 2013 at 03:38:47PM +0100…

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

---
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        |   20 ++++++++++++++++++++
 drivers/watchdog/dw_wdt.c                          |    8 ++++++++
 2 files changed, 28 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..3af5c13

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

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

s/register/registers/ ?

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

Quoted 1 line
Documentation/devicetree/bindings/watchdog/dw_wdt.txt new file +1 -0
+- clocks	: phandle to the clock that drives the watchdog timer.

Nit: clocks aren't necessarily described by just a phandle.

How about:

- clocks: phandle + clock-specifier for the clock that drives the watchdog timer.

Otherwise, given previous comments this looks fine to me.

Thanks,
Mark.
--
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

Hi Mark,

Quoted 52 lines · Mark Rutland
Quoted 40 lines · On Tue, Oct 22, 2013 at 03:38:47PM +0100…

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

---
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        |   20 ++++++++++++++++++++
  drivers/watchdog/dw_wdt.c                          |    8 ++++++++
  2 files changed, 28 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..3af5c13

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

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

s/register/registers/ ?

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

Quoted 1 line
Documentation/devicetree/bindings/watchdog/dw_wdt.txt new file +1 -0
+- clocks	: phandle to the clock that drives the watchdog timer.

Nit: clocks aren't necessarily described by just a phandle.

Quoted 8 lines

How about:

- clocks: phandle + clock-specifier for the clock that drives the watchdog timer.

Otherwise, given previous comments this looks fine to me.

Fixed with above and added your Ack. So now the question is can take this through the arm-soc tree or through Wim Van Sebroeck's drivers/watchdog tree?

Thanks,
Dinh

Quoted 3 lines

Thanks,
Mark.

--
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): [email protected]

#5 lore raw
Quoted 60 lines · Dinh Nguyen

Hi Mark,

Quoted 57 lines · Mark Rutland
Quoted 40 lines · On Tue, Oct 22, 2013 at 03:38:47PM +0100…

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

---
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        |   20 ++++++++++++++++++++
 drivers/watchdog/dw_wdt.c                          |    8 ++++++++
 2 files changed, 28 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..3af5c13

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

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

s/register/registers/ ?

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

Quoted 1 line
Documentation/devicetree/bindings/watchdog/dw_wdt.txt new file +1 -0
+- clocks	: phandle to the clock that drives the watchdog timer.

Nit: clocks aren't necessarily described by just a phandle.

How about:

- clocks: phandle + clock-specifier for the clock that drives the watchdog timer.

Quoted 7 lines
Quoted 3 lines

Otherwise, given previous comments this looks fine to me.

Fixed with above and added your Ack. So now the question is can take this through the
arm-soc tree or through Wim Van Sebroeck's drivers/watchdog tree?

Guess that depends on Wim as the maintainer. There are other patches pending for the same driver, so it would be good if they are all merged through the same tree.

Can you send the final version of your patch so I can add it to my watchdog-next tree for tracking ?

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