Skip to content

Commit

Permalink
watchdog: s3c2410: Add support for device tree based probe
Browse files Browse the repository at this point in the history
This patch adds the of_match_table to enable s3c2410-wdt driver
to be probed when watchdog device node is found in the device tree.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Thomas Abraham authored and Wim Van Sebroeck committed Jul 22, 2011
1 parent 641e4f4 commit 9487a9c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* Samsung's Watchdog Timer Controller

The Samsung's Watchdog controller is used for resuming system operation
after a preset amount of time during which the WDT reset event has not
occured.

Required properties:
- compatible : should be "samsung,s3c2410-wdt"
- reg : base physical address of the controller and length of memory mapped
region.
- interrupts : interrupt number to the cpu.
10 changes: 10 additions & 0 deletions drivers/watchdog/s3c2410_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,15 @@ static int s3c2410wdt_resume(struct platform_device *dev)
#define s3c2410wdt_resume NULL
#endif /* CONFIG_PM */

#ifdef CONFIG_OF
static const struct of_device_id s3c2410_wdt_match[] = {
{ .compatible = "samsung,s3c2410-wdt" },
{},
};
MODULE_DEVICE_TABLE(of, s3c2410_wdt_match);
#else
#define s3c2410_wdt_match NULL
#endif

static struct platform_driver s3c2410wdt_driver = {
.probe = s3c2410wdt_probe,
Expand All @@ -599,6 +608,7 @@ static struct platform_driver s3c2410wdt_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "s3c2410-wdt",
.of_match_table = s3c2410_wdt_match,
},
};

Expand Down

0 comments on commit 9487a9c

Please sign in to comment.